Blog Tools

Why Your Coding Agent Forgets Things, and How to Give Two Agents One Brain

The copy-paste problem

If you use more than one coding agent, you have been the handoff. Claude Code gets halfway through a task, you want Codex to take the next part, and the second you switch, Codex has no idea what happened. So you copy context. You explain what changed, what you tried, and where you stopped. Or you ask one agent to write a giant prompt for the other and pay for the same context twice. This video shows the setup that ended that: a shared second brain that both agents read and update.

Watch the video (6:35): Why Your Coding Agent Forgets Things, and How to Give Two Agents One Brain

Obsidian as the hub

The hub is an Obsidian vault, chosen for one reason. Underneath the app, a vault is a folder of Markdown files. Plain text. Claude Code and Codex can both read and write it, and you can open the same notes yourself, fix a wrong line, or delete something stale. The project memory lives there instead of inside one agent’s chat history, so switching agents does not move it.

What the project remembers

The core note is a checkpoint, a structured handoff: what we are working on, what is finished, what is left, what we already decided, and what the next agent must know before it touches anything. Each agent learns to use it through its own instruction file. Claude Code reads CLAUDE.md and Codex reads AGENTS.md, and both get the same short rules. Read the latest checkpoint and the decisions before starting. Update the notes when something important changes. Leave a checkpoint before stopping.

The demo

The video walks a checkout rebuild. Claude moves the Stripe payment code to the new setup, updates the tests, and writes a checkpoint: Stripe done, PayPal still on the old path, and one decision, do not change the public checkout API. Close Claude, open Codex, and say “pick up the checkout work where we left off.” Codex reads the checkpoint and continues. Later Codex leaves its own checkpoint, and Claude comes back with “continue.” Codex never saw the Claude conversation. The project remembered.

What not to save

The trap is telling agents to save everything, which turns the vault into a junk drawer. Keep durable context only: decisions, current state, things already tried, constraints, and lessons you do not want to learn twice. Skip chat logs, debugging noise, and never store secrets. Useful memory beats more memory.

What the setup actually does

The kit is instructions, not software. There is no daemon, no database, no plugin. The agent adds one bounded block to CLAUDE.md and AGENTS.md, writes a private .shared-brain.local.json in the project root that maps the project to your vault (ignored by Git before it exists, so a public repo never learns where your notes live), and creates a Shared Brain/ folder in the vault with an index, the working agreement, a project note, and one checkpoint per task. It backs up every file it touches with before-and-after hashes, and rerunning it with the same answers changes nothing, which is how you check a connection is still intact. The private mapping is why every teammate’s checkout can point at their own vault.

Try it

The setup prompt and a ready-made skill for Claude Code and Codex live in Labstack on GitHub. Paste the install prompt from the README into your coding agent with a project open. It checks for Obsidian and your existing vaults, asks what you want to remember and which tools you use, shows you exactly where it will write, and only then sets up both agents against the same notes. Route by route, with the handoff test and troubleshooting, it is all in the Second Brain Guide.

Sources: the Labstack second-brain README, Anthropic’s Claude Code memory docs on CLAUDE.md, and OpenAI’s AGENTS.md guide for Codex.

Common questions

Does Codex read my Claude Code conversation?
No. Neither agent can see the other's chat. They share project state instead: a checkpoint note in the vault that records what is finished, what is left, and the decisions already made.
Why Obsidian and not a database or a cloud memory feature?
An Obsidian vault is a folder of plain Markdown files. Both agents can read and write files, and you can open, edit, or delete any note yourself. Nothing is hidden inside one vendor's memory.
Where do the agents learn to use the vault?
From their project instruction files. Claude Code reads CLAUDE.md and Codex reads AGENTS.md. Both get the same short rules: read the checkpoint before starting, update notes when something important changes, and leave a checkpoint before stopping.
Where do I get the setup prompt?
It is published in the Labstack repository on GitHub, in the second-brain folder, together with a skill for Claude Code and Codex.

Watch on YouTube

New posts, in your inbox