A lightweight system for preserving Claude Code conversation logic across sessions.
Long conversations hit token limits, forcing resets that lose valuable reasoning. You're left re-explaining decisions you've already made.
Capture knowledge as markdown files as you go — not just the answers, but how you got there. Claude automatically references this knowledge in future sessions.
| Tier | Purpose | Claude's Behavior |
|---|---|---|
| Constraints | Hard rules | Follow strictly, flag violations |
| Decisions | Choices made | Follow, suggest revisiting if stale |
| Context | Background info | Inform, don't constrain |
- Clone this repo (or copy the files) into your project root:
git clone https://github.com/YOUR_USERNAME/context-knowledge-base.git temp-kb
cp -r temp-kb/.claude temp-kb/docs temp-kb/CLAUDE.md your-project/
rm -rf temp-kb-
If you already have a
CLAUDE.md, merge the Knowledge Base section into it. -
Restart Claude Code to register the
/capture-conversationcommand. -
Done. Start capturing.
Run /capture-conversation at the end of a session (or as you make decisions). Claude will:
- Extract knowledge from the conversation
- Classify each item as constraint, decision, or context
- Create files in the appropriate
docs/knowledge/subfolder - Update
_index.mdwith new entries
New sessions automatically benefit:
- Claude reads
docs/knowledge/_index.md(per CLAUDE.md instructions) - Pulls relevant files based on your current task
- Applies knowledge according to tier:
- Constraints → follows strictly
- Decisions → follows, may suggest revisiting
- Context → uses to inform approach
your-project/
├── .claude/
│ └── commands/
│ └── capture-conversation.md # The /capture-conversation command
├── docs/
│ └── knowledge/
│ ├── _index.md # Master index (auto-updated)
│ ├── constraints/ # Hard rules
│ ├── decisions/ # Choices made
│ └── context/ # Background info
└── CLAUDE.md # Project instructions for Claude
- Default to decision, not constraint — constraints should be rare and intentional
- Capture as you go — don't wait until context runs out
- Include "when to revisit" in decision files
- Prune context — it grows fast and gets stale
- Version control everything — your knowledge base evolves with your project
Spec-driven design defines what to build upfront. This captures how you solved things — preserving reasoning for future context injection. Over time, decisions may crystallize into constraints, but that's emergent, not prescribed.
MIT