You have access to a persistent context graph that captures decisions, corrections, insights, and other valuable context from Claude Code sessions. The graph has two domains:
/plugin marketplace add patrickkidd/ccmemory/plugin install ccmemory@ccmemoryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
You have access to a persistent context graph that captures decisions, corrections, insights, and other valuable context from Claude Code sessions. The graph has two domains:
Use these tools to explicitly capture important context:
recordDecision — Record a decision with rationale, options considered, and revisit triggersrecordCorrection — Record when the user corrects your understanding (highest value!)recordException — Record when normal rules don't apply in this contextrecordInsight — Record realizations, analyses, or strategic conclusionsrecordQuestion — Record meaningful Q&A exchangesrecordFailedApproach — Record what was tried and didn't workrecordReference — Record URLs or file paths mentionedUse these tools to retrieve relevant context:
queryContext — Get recent context for the current projectsearchPrecedent — Full-text search across all context typessearchSemantic — Semantic similarity search using embeddingsqueryByTopic — Get all context related to a specific topictraceDecision — Get full context around a specific decisionqueryStaleDecisions — Find decisions that may need reviewqueryFailedApproaches — Get failed approaches to avoid repeating mistakesgetMetrics — Get context graph metrics (cognitive coefficient, etc.)cacheUrl — Fetch and cache a URL as markdowncachePdf — Extract PDF content to markdownindexReference — Rebuild the reference knowledge indexqueryReference — Semantic search over cached referenceslistReferences — List all cached reference filespromoteDecisions — Promote developmental decisions to curated (team-visible) statusccmemory_backfill_conversation — Import a JSONL conversation fileccmemory_backfill_markdown — Import a markdown fileCRITICAL: When backfilling, only import from the CURRENT project's folder.
The JSONL files are at ~/.claude/projects/ in folders matching the full path with slashes replaced by dashes.
Example: If cwd is /Users/patrick/theapp, import ONLY from ~/.claude/projects/-Users-patrick-theapp/
Do NOT import from -Users-patrick-theapp-planner or any other folder.
recordDecisionsearchPrecedentThis is the highest-value capture. When you get something wrong and the user corrects you:
recordCorrection with:
wrong_belief: What you incorrectly believedright_belief: The correct understandingseverity: How significant the error wasExample triggers:
Record with recordException when:
Record with recordFailedApproach when:
Record with recordInsight for:
IMPORTANT: At session start, if the injected context contains a "## Pending History Import" section showing conversations not yet imported, you MUST use AskUserQuestion to offer the user import options:
If the user chooses to import, use ccmemory_list_conversations to get the session list, then call ccmemory_backfill_conversation for each session (reading the JSONL file content first).
At the start of each session, context is automatically injected. Additionally:
searchPrecedent or searchSemanticqueryFailedApproachesThe system tracks a "cognitive coefficient" — a measure of how much the accumulated context improves effectiveness. This grows as:
Current project metrics can be retrieved with getMetrics.
In team mode (CCMEMORY_USER_ID set):
developmental decisions are only visible to their creatorcurated decisions are visible to all team memberspromoteDecisions to make decisions team-visible after they're validatedIf any ccmemory tool returns a response with "error": "session_not_found" and "ask_user": true, the MCP server session was lost (typically due to server restart).
You MUST use AskUserQuestion to ask the user:
"The ccmemory server session was lost. Would you like to:"
- Retry — Re-establishes the session (the session_start hook will run again on your next message)
- Continue without saving — Skip saving this context to the knowledge graph
If the user chooses "Retry", inform them the session will re-establish on the next interaction. If they choose "Continue without saving", proceed normally but note that the current context won't be persisted.