Why written decisions became the shared context between Claude, Codex, Gemini and friends in lemon-code, and what went wrong with numbering
Published: October 30, 2026
Reading time: 8 min
Series: lemon-code in 30 days, part 6 of 13
lemon-code's ADR folder has six files starting with 0049-. Logs, MCPs, profile, providers. All created on the same day, July 18, 2026.
That wasn't one person being careless. It's the symptom of a project where several agent sessions write decisions at once, each one assuming the "next free number" was theirs. This post is about why ADRs became the project's memory and what that mistake teaches.
Think of a ship crewed in shifts. Whoever takes the helm at 4 a.m. wasn't awake when the captain changed course. The logbook keeps continuity: every change written down with its reason.
Coding agents are crew in shifts. Each session starts with no memory of the last, and each CLI has its own memory store. The logbook is the one place they all read.
A useful ADR for agents is short with four fixed sections:
# ADR: dispatch via CLI first (illustrative example)
## Status
Accepted
## Context
The main agent requires an API key even when CLIs are authenticated locally.
Run an authenticated CLI before any HTTP API, unless explicitly requested.
Four sections, one decision. An agent reading it knows what was decided, why, and what must not break.
## Why ADRs beat tool memory
Each CLI's memory is invisible to the others. A decision stored in Claude Code's memory doesn't exist for Codex. An ADR lives in the repo:
| Property | Why it matters with several agents |
|---|---|
| Versioned in Git | you can see when and in which commit a decision changed |
| Readable by any CLI | it's just markdown |
| Reviewable in a PR | a bad decision gets caught before it becomes code |
lemon-code reached 67 ADR files, from 0001 (architecture overview) to 0060 (Cursor CLI runtime). The first twelve are the founding record. From 0013 on, many are evolution proposals with a declared source, such as the Claude Code changelog.
## A single instruction source
lemon-code's `AGENTS.md` opens by declaring itself the single source of truth for agent behavior; `CLAUDE.md` and `GEMINI.md` only point to it. Early on I had three instruction files drifting apart. The `ai:sync-check` script checks the configured skill and command symlink paths and parity for selected built-in skill copies. It does not detect duplicated instruction text in general.
## The 0049 mistake
My best guess (interpretation, not recorded anywhere): parallel sessions listed the folder, saw 0048 as the last number and created 0049. The same happened on a smaller scale with 0050, 0051, 0052 and 0055, which have two files each. The ADR README already noted another numbering slip: `005-agent-swarm-handoff.md` should have four digits and was kept to preserve links.
Takeaways:
- **A sequential number is a shared resource.** With several writers it needs an owner: a script that reserves it, or names based on date and slug.
- **Collisions don't break anything immediately.** That's why they slip through.
- **Renaming is expensive.** Links and commit references point to the old name.
## Checklist: do your ADRs work for agents?
- [ ] Each ADR has Status, Context, Decision and Consequences.
- [ ] One instruction file; the others only point to it.
- [ ] Automated validation checks the symlinks and built-in copies declared by the project.
- [ ] Numbering has an owner.
- [ ] The ADR index marks accepted versus proposed.
- [ ] Rules agents must not break live in Consequences, not in a chat.
## Conclusion
With several agents in one repo, project memory has to live in the repo. Short ADRs with a fixed format and a single instruction source are the logbook every shift reads. The six `0049-` files are a reminder that even the logbook needs rules for who writes.
Monday's post moves up a layer: how I put a native SwiftUI app on top of the CLI without reimplementing anything.
If your team runs several coding agents and decisions keep getting lost between sessions, organizing that memory is work I do at [LEMON.DEV](https://lemon.dev.br).
## References
- [Michael Nygard, Documenting Architecture Decisions](https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions)
- [adr.github.io, templates and tools](https://adr.github.io/)
- [AGENTS.md, open convention](https://agents.md/)
## Related reading
- [Versioning AI decisions](https://lemon.dev.br/en/blog/versionamento-reprodutibilidade-decisões-ia)
- [Guardrails and approvals in a coding agent](https://lemon.dev.br/en/blog/guardrails-aprovacoes-agente-codigo)
Free and paid products to turn ideas into a foundation you can actually ship.
13 products availableContinue exploring similar topics
I reached for an HTTP provider on tasks an installed CLI could handle. lemon-code's CLI-first rule fits in four lines of precedence.
For HTTP-provider routes, lemon-code records score factors. This teaching example shows how to read the sum and distinguish it from the JEV layer.
I had four AI coding CLIs installed and none of them knew what the others had done. lemon-code started as the layer that ties context, routing and approvals together on my machine.
A practical checklist to validate security, cost, evals, and observability before you ship your AI app to production.
Production-tested templates trusted by developers. Save weeks of setup on your next project.