Why it exists
Code review catches what’s wrong with a diff. It doesn’t tell you why the author went with approach A over approach B, or what constraint forced the ugly workaround on line 42. For AI agents, that context vanishes between sessions — each run starts from scratch. Decision Memory fixes this by:- Capturing reasoning automatically at every turn-complete event.
- Storing it in the repo so the context travels with the code, not with a session.
- Scoping it by PR and by module so you get both branch-level context and long-term module knowledge.
How it works
When enabled, Kodus installs hooks into your AI agent’s turn-complete events. Each turn, the agent’s decisions are captured into:- PR memory lives on the branch. It’s scoped to the current head SHA — as the branch evolves, new files are created for each meaningful state.
- Module memory is long-term. It accumulates decisions per module over time.
modules.ymltells Kodus how to map paths to modules (e.g.,src/auth/**→authmodule).
Supported agents
- Claude Code — via settings hook on stop/agent-turn-complete.
- Cursor — via workspace rules.
- Codex — via
notifyentry in~/.codex/config.toml.
Setup
Enable for all detected agents:Workflow
Enable hooks
.kody/ to git (creating a modules.yml if it doesn’t exist).Work normally
As you (or your agent) work, each turn-complete event captures a decision to
.kody/pr/by-sha/<sha>.md. Commit these files along with your code changes — the reasoning is now in version control.What gets captured
Each decision file is structured markdown:- Summary — what the agent intended to do.
- Context — constraints, prior decisions, referenced files.
- Alternatives considered — approaches the agent rejected and why.
- Outcome — what was actually changed.
Disabling
Remove all hooks and integration files:.kody/ — your history stays intact. Delete the directory manually if you want a clean slate.
Context files the CLI reads
In addition to.kody/, the CLI picks up project context from these files when running reviews:
| File | Description |
|---|---|
.kodus.md | Kodus-specific configuration and guidelines |
claude.md | Claude-specific guidelines |
.cursor/rules/ | Cursor IDE rules directory |
Related
AI Agents
Review-fix loops with Claude Code, Cursor, Codex, and Windsurf.
Concepts
Kody Rules, centralized config, and diff modes.
Command Reference
Full
kodus decisions flag listing.Troubleshooting
Decision hooks not capturing? See the dedicated accordion.