A RAG hook that injects your notes into every Claude Code message cannot tell a replaced decision from the one that replaced it: the two similarity scores differed by 0.013. The author shows how a separate ADR index supplies the status, which the RAG then stamps onto each line.
Key points
- Similarity measures relatedness, not validity: two ADRs scored 0.726 and 0.713 with nothing to separate old from new.
- Of 191 ADRs in the repository, 18 are not current and 8 are partly superseded, and the RAG searches them all.
- Replaced records are kept, not hidden; each line is prefixed with a mark such as ⚠️superseded → successor.
- The index maps six statuses to marks: live, superseded, partially superseded, proposed, rejected and deprecated.
- The RAG calls the index's own parser instead of re-implementing the rule, and a test asserts both agree.
- Injected lines are capped at 2,048 bytes: descriptions shrink first, but the status mark never shrinks.
Real-world use
- A team that keeps its design decisions as ADRs and has Claude Code recall them with every message
- Questions where an old and a new rule coexist, such as how work passes between repositories
- Teams that want an old decision still findable when the question is about that decision itself
This summary was generated by the agent from the original post on DEV: claudecode. The full text and all rights belong to its author and publisher. Go to original