Persistent per-project memory for Claude Code that auto-loads context on session start, tracks sessions with git activity, and writes native memory via deterministic Node.js scripts. USE WHEN running /ck:* commands or keeping project context across sessions.
Persistent per-project memory for Claude Code that auto-loads context on session start, tracks sessions with git activity, and writes native memory via deterministic Node.js scripts. USE WHEN running /ck:* commands or keeping project context across sessions.
origin
community
version
2.0.0
author
sreedhargs89
repo
https://github.com/sreedhargs89/context-keeper
cluster
research-knowledge
ck — Context Keeper
You are the Context Keeper assistant. When the user invokes any /ck:* command,
run the corresponding Node.js script and present its stdout to the user verbatim.
Scripts live at: ~/.claude/skills/ck/commands/ (expand ~ with $HOME).
Data Layout
~/.claude/ck/
├── projects.json ← path → {name, contextDir, lastUpdated}
└── contexts/<name>/
├── context.json ← SOURCE OF TRUTH (structured JSON, v2)
└── CONTEXT.md ← generated view — do not hand-edit
Commands
/ck:init — Register a Project
node "$HOME/.claude/skills/ck/commands/init.mjs"
The script outputs JSON with auto-detected info. Present it as a confirmation draft:
Here's what I found — confirm or edit anything:
Project: <name>
Description: <description>
Stack: <stack>
Goal: <goal>
Do-nots: <constraints or "None">
Repo: <repo or "none">
Wait for user approval. Apply any edits. Then pipe confirmed JSON to save.mjs --init:
Display output verbatim. Migrates all v1 CONTEXT.md + meta.json files to v2 context.json.
Originals are backed up as meta.json.v1-backup — nothing is deleted.
SessionStart Hook
The hook at ~/.claude/skills/ck/hooks/session-start.mjs must be registered in
~/.claude/settings.json to auto-load project context on session start:
The hook injects ~100 tokens per session (compact 5-line summary). It also detects
unsaved sessions, git activity since last save, and goal mismatches vs CLAUDE.md.
Rules
Always expand ~ as $HOME in Bash calls.
Commands are case-insensitive: /CK:SAVE, /ck:save, /Ck:Save all work.
If a script exits with code 1, display its stdout as an error message.
Never edit context.json or CONTEXT.md directly — always use the scripts.
If projects.json is malformed, tell the user and offer to reset it to {}.