Dev ships Canon CLI to fix AI coding agents rehashing rejected approaches
letsrediit · reddit · 2026-08-15
A developer released Canon, a local-first CLI tool designed to prevent AI coding agents (like Claude Code and Cursor) from repeatedly proposing previously rejected approaches or inventing stale conventions.
The Problem
Agents often lose context between sessions, re-proposing rejected PRs, asking settled questions, or treating old comments as current truth. Maintaining static ADRs manually is costly and prone to staleness.
How Canon Works
- Local & Private: Uses SQLite with no cloud account required. GitHub integration is read-only for PR mining.
- Auto-Injection: Hooks into Claude Code (SessionStart) and Cursor (always-apply rule) to inject only active decisions automatically.
- Decision Tracking: Suggests decisions with provenance (e.g., PR #184) for approval. Replaces rather than deletes old decisions to ensure context accuracy.
- Fail-Safe: Prefers stating "no confirmed decision" over guessing when confidence is low.
Installation
bash
pip install git+https://github.com/Adarshk18/Canon.git
canon init
canon suggest
Currently supports Claude Code and Cursor auto-injection; ChatGPT requires manual attachment of .canon/injection.md.
Related event: Developer Open-Sources Canon, Giving AI Coding Agents a Decision Memory(2 posts)→
More from coding & agent
- Don't Blame the Model: Seven Ways to Inject Context and Control into Agents — bibryam · 2026-08-16
- brain.md: Persistent Memory for Coding Agents via Markdown — alex_verem · 2026-08-16
- What belongs in a shared MCP workspace? — diettcokepaglu · 2026-08-16
- Developer open sources NoiseCheck, exposing statistical fallacies in model evals — Formal-King3851 · 2026-08-16
- User tunes Qwen 3.8 27b on M5 Max, criticizes Opus instruction following — julianharris · 2026-08-16
- Terminology: Search Agents vs. Research Agents and RL Strategy — CShorten30 · 2026-08-16