Decision memory for Claude Code — captures why choices were made so future sessions inherit context instead of repeating debates. Decisions are markdown files in .claude/decisions/ (committed to the repo, shared via git). Hooks and skills handle everything automatically.
uv sync # install dev deps (first time only)
make check # ruff + mypy + shellcheck + pytest
make dev # symlink plugin into Claude Code cache- Decisions extend Claude Code's memory schema with:
name,description,date,tags,affects - YAML frontmatter with
---delimiters (not TOML) for decision files. Block scalars (|,>) are rejected. - All decisions are lightweight — frontmatter, title, and lead paragraph. No weight distinction.
- DecisionStore = file-based store with FTS5 derived search index. Progressive loading: index stores summaries, full files read on demand.
- Zero-config, advise-only. No strictness settings, no config file. The plugin just nudges — it never blocks or enforces.
Decisions live at .claude/decisions/{slug}.md in the repo — committed to git and shared with the team. The FTS5 index lives at ~/.claude/projects/{project-key}/.decisions/.
Architecture lives in decision files under .claude/decisions/ — see .claude/rules/decisions.md for the full index.
- Markdown is source of truth. SQLite FTS5 is a derived index. Delete it and everything rebuilds.
- Git is the history layer. Edit decisions in place, delete when obsolete. Git tracks the evolution.
- Skill = intent + behavior, hooks = correctness, CLI = data access.
/decisionskill routes intent. Hooks enforce validation and inject context. CLI provides search, stats, and git operations. - Pure methods on DecisionStore. No side effects at import time.
- Plugin is stdlib only. Zero external dependencies in
src/. - No confirmation prompts on capture. Write decisions directly — agents must capture without human approval gates.
/decision undois the safety net.
This section is for you, the agent. Use judgment — not every task involves decisions.
When the user asks you to do something that involves choosing between approaches (architecture, framework selection, API design, migration strategy):
- Search first:
/decision <topic>to check if past decisions constrain your approach - If related decisions exist, acknowledge them before proposing your approach
Skip this step for bug fixes, typo corrections, simple feature additions, test writing, and other tasks where there's an obvious single approach.
When the user states a decision, preference, or trade-off — capture it automatically by writing a decision file. Do not ask for confirmation, do not suggest /decision capture. Just write it, exactly like you auto-save memories.
Trigger on statements like:
- "we should use X because Y"
- "let's go with X — Y is too Z"
- "don't paginate this — only 50 tenants"
- "handle errors inline, webhooks are too slow"
- Any statement that explains why something should be done a certain way
How to capture:
- Write a decision file to
.claude/decisions/{slug}.mdfollowing the decision template (injected at session start). The content-validation hook will reject and guide you if anything is wrong. - Always populate
affects— auto-infer from files edited this session (deduplicate to directory prefixes when 3+ files share a dir). Never leave empty. - Confirm briefly: "Captured: {title}" with the affects paths
Then continue with the user's request. If they asked you to implement something, capture the decision AND do the implementation. Don't stop at capture.
When you (the agent) choose between alternatives (framework, pattern, architecture, API design):
- Capture immediately by writing a decision file while the reasoning is fresh
- Don't batch captures — the best time is right after the choice is made
- Include affected files so future
related-contextmatching is precise
If you're not choosing between alternatives, there's nothing to capture.
When committing changes that involved non-trivial decisions, include the decision rationale directly in the commit message body — the why, alternatives considered, and trade-offs. Make git log self-documenting.
/decision --tagsto browse what topics have been captured and drill into specific tags/decision --statsto check decision coverage health (counts, activity, gaps)/decision debugto see which policies fired, thresholds, and session state
- Capture: choices between alternatives, non-obvious trade-offs, constraints a future agent needs
- Skip: implementation details that are obvious from the code, one-line fixes, style choices
- Decision = a technical choice between alternatives, shared with the team via git. It has
affectspaths so it auto-surfaces when teammates edit related code. - Memory = personal context (user preferences, workflow style, role info). Lives in MEMORY.md, not shared via git.
Rule of thumb: if it should travel with the repo and surface for other developers, it's a decision. If it's about how this user prefers to work, it's a memory.