Remember what you ruled out across AI tools
Keep what you ruled out across Claude Code and Codex. Compare a repo decisions file with a shared Heartwood store, client identity, and supersedes.
By Heartwood MemoryPublished . Dates are Pacific time.
To remember what you ruled out across sessions and across Claude Code and Codex, keep ruled-out decisions in a shared store outside any single chat, record who wrote each decision and which source it came from, and retire old entries explicitly when a decision changes. A short decisions file in the repo works well when someone writes the line and keeps it current. Heartwood Memory helps when nobody keeps that file updated by hand, when you need to know which tool or principal wrote a decision, or when a team across separate machines needs hosted recall.
Why ruled-out options keep coming back
Every new chat starts from a blank slate. Goals, accepted trade-offs, approaches you already tested and rejected, and the reasons a rule exists all disappear once the session ends, unless something outside the context window carries them forward.
Add a second AI coding tool and the problem doubles. Claude Code and Codex each keep their own sessions and their own built-in memory. One session changes an API contract or rules out a caching strategy; a later session in the other tool has never seen that decision and keeps writing against the old shape or proposing the rejected option again.
Knowing why something was ruled out matters as much as the rule itself. Without the reason and the source, the next session treats a hard constraint like an arbitrary preference and works around it.
Start with the free option: a decisions file in the repo
Before adding any memory server, look honestly at the simplest fix: a short decisions file in the repo, one line per decision with a date, with each tool's instructions file (CLAUDE.md, AGENTS.md) telling the agent to read it at session start.
For many solo developers and disciplined teams, that file is the right choice:
- It costs nothing and adds zero moving parts.
- Changes go through normal Git diffs and pull request review.
- Any developer or agent can read the whole file in seconds while it stays short.
The file works when someone writes the line, updates it when a decision reverses, and merges it before the next session begins.
Where a flat repo file starts to fray is not a flaw in Markdown — it is how real sessions run:
- Nobody stops to maintain the file by hand. Heartwood does not capture decisions automatically either; the store holds only what you or an agent write to it, or what you import. The difference is workflow: when you enable the MCP
remembertool and tell your agents when to call it, an agent can record a ruled-out option straight into the shared store during the session without waiting for someone to hand-edit and commit a log file. You can also import existing Markdown decision notes into the same store withimport-markdown. - Changed decisions pile up instead of retiring cleanly. When you reverse a call in a flat file, an older line stays visible unless someone edits it out by hand — and deleting it erases the trail of why the team acted differently last week. From version 0.2.10, Heartwood's
remember(..., supersedes=old_id)writes the new decision, moves the old one toreview_state"superseded", and appends onerememberaudit row naming what was replaced, all in one transaction. Default recall stops returning the old decision, including after a restart, while history stays reachable when you ask for it. - You need to know which tool, principal, or session wrote the decision. A line in a shared Markdown file carries no enforced client identity or cryptographic check. In Heartwood, each MCP server binds its own tenant and principal from configuration (
HEARTWOOD_TENANTandHEARTWOOD_MCP_PRINCIPAL_ID), signs every write with that principal's Ed25519 key, re-checks the signature on every recall, and logs writes and recalls in a hash-chained audit trail. Passing a PR, ticket, or session link insource_urities the decision straight back to the session that made it.
| Need | Decisions file in the repo | Heartwood Memory |
|---|---|---|
| Cost and setup | Free; one Markdown file plus rules-file pointers | Free self-hosted core (BSL 1.1) locally; hosted Team or Professional plans for remote recall |
| How decisions get recorded | A developer writes and commits the dated line | Developer, import-markdown, or an agent calling MCP remember (nothing is captured automatically) |
| Reversing a ruled-out choice | Manual edit or delete in the file | remember(..., supersedes=old_id) retires the old record from default recall while keeping history |
| Knowing who wrote a decision | Git blame on the file, if committed promptly | Server-bound created_by principal, optional source_uri, Ed25519 signature re-checked at recall, hash-chained audit log |
| Sharing across tools on one machine | Every tool's rules file reads the same repo file | One local SQLite store shared over local stdio MCP by Claude Code and Codex |
| Sharing across a team on different laptops | Git pull and merge on every branch | Hosted HTTP recall gateway (POST /recall) with per-organization bearer auth on Team or Professional |
Share one local store between Claude Code and Codex
On one machine, Claude Code and Codex can share one Heartwood SQLite file through Heartwood's local MCP server. Each client gets its own identity in the same tenant (agent:claude-code and agent:codex), and both start fail-closed with the read-only tools recall, explain_recall, and health.
You need Python 3.11 or newer and uv. Always pass an absolute path in HEARTWOOD_DB_PATH — with no path set, the MCP server keeps memory in RAM and loses it when the server stops. If either client will write to the store, run heartwood init-identity once, save the generated 32-byte custody root and key ID in your secret store, and pass the same HEARTWOOD_KEY_CUSTODY_ROOT_B64 and HEARTWOOD_KEY_CUSTODY_KEY_ID to both servers — including a client that stays read-only. Never commit the root or hard-code it in a repo; load it from your secret store.
DB="${XDG_DATA_HOME:-$HOME/.local/share}/heartwood/heartwood.db"
mkdir -p "$(dirname "$DB")"
# Run `heartwood init-identity` once, keep the root in your secret store,
# and export both variables from your secret store before registering either client:
HEARTWOOD_KEY_CUSTODY_ROOT_B64="${HEARTWOOD_KEY_CUSTODY_ROOT_B64:-<32-byte-root-from-secret-store>}"
HEARTWOOD_KEY_CUSTODY_KEY_ID="${HEARTWOOD_KEY_CUSTODY_KEY_ID:-env-root-v1}"
claude mcp add --scope user --env HEARTWOOD_DB_PATH="$DB" \
--env HEARTWOOD_TENANT=tenant:ops --env HEARTWOOD_MCP_PRINCIPAL_ID=agent:claude-code \
--env HEARTWOOD_MCP_ALLOWED_TOOLS=recall,explain_recall,health \
--env HEARTWOOD_KEY_CUSTODY_ROOT_B64="$HEARTWOOD_KEY_CUSTODY_ROOT_B64" \
--env HEARTWOOD_KEY_CUSTODY_KEY_ID="$HEARTWOOD_KEY_CUSTODY_KEY_ID" \
--transport stdio heartwood -- uvx heartwood-memory
codex mcp add heartwood --env HEARTWOOD_DB_PATH="$DB" \
--env HEARTWOOD_TENANT=tenant:ops --env HEARTWOOD_MCP_PRINCIPAL_ID=agent:codex \
--env HEARTWOOD_MCP_ALLOWED_TOOLS=recall,explain_recall,health \
--env HEARTWOOD_KEY_CUSTODY_ROOT_B64="$HEARTWOOD_KEY_CUSTODY_ROOT_B64" \
--env HEARTWOOD_KEY_CUSTODY_KEY_ID="$HEARTWOOD_KEY_CUSTODY_KEY_ID" \
-- uvx heartwood-memoryBoth clients start read-only on the same file, using the same custody root and key ID so either client can read every memory written to the store. Because --env writes those values into your local client config (~/.claude.json and ~/.codex/config.toml), keep the root in your secret store and keep local client config files private and out of Git. Heartwood does not switch off Claude Code's or Codex's own built-in memory features; it sits beside them as a shared store. If you use ~/.codex/config.toml and want Heartwood to stay the sole durable store for Codex, the Codex quickstart documents setting disable_on_external_context = true and generate_memories = false under [memories]. Full setup details are in the Claude Code and Codex guide.
Enabling writes with client identity
To let either client record decisions directly during a session, opt in explicitly by naming remember in HEARTWOOD_MCP_ALLOWED_TOOLS (for example, recall,explain_recall,remember,health).
Two rules apply when you enable writes:
- The server binds identity, not the prompt. From version 0.2.10, the MCP server takes
tenant,principal_id,roles,attrs, andclearancestrictly from its environment configuration and rejects any tool call that tries to pass its owntenant,principal_id,created_by, oractor. A write from Claude Code is recorded underagent:claude-code; a write from Codex is recorded underagent:codex. - Every server on a shared store needs the same custody root and key ID. Run
heartwood init-identityonce, keep the 32-byte custody root (HEARTWOOD_KEY_CUSTODY_ROOT_B64) and its key ID (HEARTWOOD_KEY_CUSTODY_KEY_ID, defaultenv-root-v1) in your secret store, and pass the same pair to every Heartwood server that opens the store — including servers that only read. Without the root, a writer cannot keep writing after a restart and a reader sees none of the memories written with it. With the root but a different key ID, recall fails with an error. Decide before the first write: once any server with a root has opened the store, every server that opens it needs that root and key ID. See the MCP server guide for the full tool list and environment variables.
Record a ruled-out decision, recall it in the other tool, and retire it if it changes
Suppose a Claude Code session investigates a webhook design and rules out polling in favor of signed webhooks. With remember enabled, it writes the ruled-out choice, the reason, and a source_uri pointing to the session, PR, or ADR:
{
"content": "Ruled out polling the billing API every 60 seconds because rate limits drop burst syncs. Use signed webhooks with replay protection instead.",
"subject": "arch:billing-sync",
"source_uri": "session://2026-11-26/claude-code-billing-sync"
}Heartwood returns the new memory id, signs the record under agent:claude-code, and writes a row to the hash-chained audit log.
Later, a Codex session touches the billing sync worker and calls recall on the same store:
{
"cue": "billing API polling vs webhooks",
"subject": "arch:billing-sync",
"k": 5
}Each item in results comes back with its content, created_by (agent:claude-code), source_uri and source_ids, and provenance_valid — re-checked when served. Instead of guessing who wrote an unsigned bullet in a doc, you can see which tool wrote the decision, which session or link it came from, and whether its signature still verifies.
If the team later reverses that call, pass the old record's ID in supersedes when writing the new decision:
{
"content": "Revisited billing sync: allow a fallback reconciliation poll once per hour alongside signed webhooks.",
"subject": "arch:billing-sync",
"source_uri": "session://2026-11-26/codex-billing-reconcile",
"supersedes": "OLD_MEMORY_ID"
}Default recall stops returning the retired decision, including after a restart, while history stays reachable when you ask for superseded records. One permission detail matters across tools: a principal can retire its own memory, whereas retiring another principal's memory (such as agent:codex superseding a record written by agent:claude-code) requires the reviewer role in HEARTWOOD_MCP_ROLES (or approver for an approved memory).
For the full Python walkthrough of remember(..., supersedes=old_id), restart verification, and what the audit log records, read Make a correction stick in agent memory and the memory replacement guide. If you already keep Markdown decision notes in your repo and want to seed a store without retyping them, see the Markdown import guide.
Honest limits to know before you wire this in
Keep four boundaries clear when deciding between a repo file, local MCP, and hosted recall:
- Nothing is captured automatically. The store holds only what you or an agent explicitly write through
rememberor import withimport-markdown. If neither a human nor an agent writes the decision, Heartwood cannot recall it. - Heartwood does not detect replacements by itself. Heartwood doesn't guess which memory replaced which. You name it with
supersedes. Two plain writes withoutsupersedesboth stay current and recallable. - Recall does not enforce behavior. Putting a ruled-out option back into context helps an agent avoid repeating dead ends, and signed provenance shows who recorded it, but a model can still ignore recalled guidance. Use tests, pre-commit hooks, tool allowlists, and human review to enforce actions outside memory.
- Local MCP is single-machine. Heartwood's MCP server runs over local stdio on one machine; hosted MCP is not available. A developer switching between Claude Code and Codex on one laptop shares one SQLite file cleanly. When a team needs shared recall across separate developer machines, remote access runs through the authenticated HTTP recall gateway (
POST /recallwith a per-organization bearer token), available on Team and Professional plans.
Try it locally or run hosted recall for your team
Heartwood Memory's core is source-available under BSL 1.1 (not OSI open source). You can read the source, evaluate it, and self-host it for non-production use at any organization size at no charge, and qualifying small organizations (fewer than 100 people and under $1,000,000 in prior-year revenue as defined in the license) can run it in production at no charge too.
Start on your machine with the Claude Code and Codex guide or the 5-minute quickstart, see Make a correction stick in agent memory for the supersedes walkthrough, or check the FAQ on provenance and permissions. When your team needs an authenticated hosted recall gateway provisioned within 2 business days of the setup form, or a dedicated isolated tenant, see plans and pricing (Team at $349/month or $3,490/year, Professional at $6,000/year, and Enterprise quoted in writing from $24,000/year).
Questions
When is a plain decisions file in the repo better than Heartwood Memory?
When a solo developer or small team reliably writes dated decision lines into the file, edits out reversed calls by hand, and merges changes before the next agent session starts. A short decisions file in Git is free and has zero moving parts. Heartwood helps when nobody maintains that file by hand, when you want supersession without erasing history, or when you need signed provenance showing which client and source recorded a decision.
Can Claude Code and Codex share one local Heartwood store?
Yes, when both are configured with the same absolute file path for the store — and, if any server on the store uses a custody root, the same custody root and key ID (including on read-only servers). Each client gets its own server-bound principal in one tenant and starts read-only with recall, explain_recall, and health. Writes and erasure are added only when you name those tools in HEARTWOOD_MCP_ALLOWED_TOOLS. MCP runs over local stdio on one machine; hosted MCP isn't available.
Does Heartwood capture ruled-out decisions automatically?
No. Nothing is captured automatically: the store holds only what you or an agent write through remember or import with import-markdown. Heartwood also does not detect replacements on its own — when a decision changes, pass supersedes with the old memory ID so default recall stops returning the retired record while history stays reachable.
How do we share decisions across a team on different machines?
Local MCP runs over stdio on one machine and hosted MCP is not available. To share governed recall across developer machines or services, use the authenticated HTTP recall gateway (POST /recall with a per-organization bearer token), hosted by Edukas Solutions on the Team ($349/month or $3,490/year) and Professional ($6,000/year) plans, or self-hosted from the source-available core.