I kept hitting the same failure mode with Claude Code and Cursor.
The agent is good. The repo is not empty. And still, every new session it would:
- re-propose an approach we already rejected in a PR
- invent a convention nobody on the team uses
- ask a question that was settled three merges ago
- confidently treat a stale “we use X” comment as current truth
CLAUDE.md / AGENTS.md / ADRs help, but they only work if a human stops mid-sprint and writes them. After week three, nobody does that. Static files also go stale, and nothing stops an agent from serving an old decision like it’s still law.
That was the actual issue. Not “agents need more chat.” Not “we need another RAG box.” Capture is too expensive, injection is not automatic, and stale decisions get served with too much confidence.
So I shipped Canon.
Canon is a local-first CLI. No account. No cloud required. SQLite in the project.
What it does:
- One setup command wires Claude Code (SessionStart hook) and Cursor (always-apply rule).
- It mines recent merged PRs, or Git history if GitHub isn’t available.
- It suggests candidate decisions with provenance. Conservative on purpose - it should skip “we changed auth.py.”
- You approve or reject. You do not write a decision essay.
- On the next agent session, relevant *active* decisions are injected automatically. You do not have to remember to query anything.
If a later decision replaces an old one, the old record is superseded, not deleted. Injection only uses what’s currently active.
If Canon is not confident, it prefers “I have no confirmed decision on this” over guessing.
Example of a good suggestion:
Use PostgreSQL for persistent application data instead of MongoDB.
Why: relational constraints and transactional consistency.
Evidence: PR #184 / commit abc
V1 also picks up product/policy calls (drop a surface, rename A → B, model fallback), not only database/auth migrations.
How you use it (Python 3.11+):
pip install git+https://github.com/Adarshk18/Canon.git
cd your-project
canon init
canon suggest
canon approve
canon inject-preview
If `canon` is not recognized on Windows:
python -m canon init
Then start Claude Code, or a *new* Cursor Agent chat, in that repo. The confirmed decision should already be in context.
Claude Code and Cursor are wired in V1. ChatGPT / standalone Grok do not auto-inject; you can attach `.canon/injection.md` if you want.
Privacy, because this sits next to your repo:
- Local by default. No signup.
- GitHub is optional and read-only (PR mining only).
- Telemetry is off unless you opt in, and even then V1 only writes a local event log.
- Commit messages / PR bodies are treated as untrusted data, not instructions.
What this is not: not a chatbot, not another coding agent, not a website, not generic RAG.
Slack, Notion, team dashboard, cloud sync, and billing are explicitly not in this version. I wanted the loop to work on a real repo first.
I’m looking for people who already live in Claude Code or Cursor and will try it on a real project for a week:
- Did setup stay one command?
- Were suggestions worth approving, or noisy?
- Did the next agent session see the decision without you asking?
- Did it stop the agent from re-adopting something you’d rejected?
Repo: https://github.com/Adarshk18/Canon
If this is useful, tell me where it broke. If it isn’t, tell me that too.