You know the feeling. You spend forty minutes with one agent working through the shape of a feature, getting the tradeoffs right, landing on a design you actually believe in. Then you switch to a different tool for the implementation, and it has no idea what you just decided.
So you paste. You summarize. You paste again. And somewhere in that translation, the thing you agreed on quietly turns into something slightly different.
This is context switching, and right now most of us are handling it with the clipboard.
There is a better version of this, and it does not require picking one agent and living with it forever. It requires giving your agents a shared place to write things down. We think that place should be a document, and we think that document should live somewhere both agents can reach.
Let us walk through what that actually looks like.
The setup: one workspace, two agents
The workflow below uses two different LLM coding agents. Claude Code does the writing. Codex does the reading. Neither one knows about the other. What they share is a HackMD folder and the HackMD CLI, which both agents can shell out to like any other command line tool.
That last part matters more than it sounds. You do not need an agent with a bespoke HackMD integration. You need an agent that can run a terminal command, which is nearly all of them.
Step one: give the work a home
We start in Claude Code with the simplest possible ask. Create a folder.

Notice what is not happening here. There is no API key being pasted into a prompt, no custom tool definition, no MCP config file. The agent is being told to use a CLI, and it figures out the rest.

It checks whether the CLI exists, discovers it is installed as hackmd-cli, reads the available commands, and gets on with it.

Folder created. The agent hands back an ID, which is a small detail with a large consequence: this folder is now addressable. Any other tool that can reach the HackMD API can find it.
Step two: create the document that will hold the context
A folder is a container. What we actually need is a note inside it.


Now there are two IDs in play. The folder and the note. This is the piece that makes the handoff work later, because the second agent does not need to guess where anything is. It needs a folder name and a note title, and the CLI does the lookup.
Step three: write real structure into it
An empty note is not context. This is where the first agent earns its keep.

We asked for a template the team could collaborate on, and got back something with actual bones to it.

Eighty-four lines, ten sections. A summary with owner and status metadata, a problem statement with goals and non-goals, a STRIDE-style threat model table, a proposed design with a Mermaid diagram stub, security requirements, alternatives considered, a rollout and testing plan, dependencies and risks, open questions, and a decisions log with a changelog.
Two things worth pausing on here.
First, the Mermaid stub. HackMD renders Mermaid natively, so when the team fills in that diagram it becomes a picture in the document rather than a block of code someone has to paste elsewhere to see.
Second, and more importantly for what comes next: this is a document, not a transcript. It has sections an agent can navigate. It has open questions that are explicitly marked as open. It has a decisions log that says what was settled and when. When another model reads this, it is not trying to reconstruct intent from a wall of conversation. The structure is doing part of the work.
Step four: switch agents entirely
Here is the interesting part. We close Claude Code and open Codex, running gpt-5.6-sol. Different vendor, different model, no shared memory, no shared session. It knows nothing about the last hour of work.

The prompt is plain English. Pull context from the security spec details note in the security team meeting folder. Codex checks the CLI, confirms it is looking at @hackmd/hackmd-cli version 2.5.0, and goes looking.

And it comes back with the spec. Passwordless authentication via Passkeys and WebAuthn. The library choice, the Redis-backed challenge window, the new credentials table. The relying party ID and what it means for subdomains. The fallback plan, the staged rollout percentages, the pen-test window. Then, critically, the unresolved parts: account recovery as the primary risk blocking general availability, sign-count regressions, UV enforcement, AAGUID privacy.
Then it says it will retain this as working context for the rest of the conversation.
That is the whole trick. A model that has never seen your work now has your work, at the fidelity you left it, including the parts you had not figured out yet.
Why the document layer beats the clipboard
You could argue this is just a fancier copy-paste. It is not, for a few reasons that compound.
The context is durable: Sessions end. Context windows fill up and get compacted. Your terminal history gets cleared. A note in HackMD is still there next week, and next quarter, at the exact revision you last touched it.
The context is versioned: HackMD keeps revision history, so when an agent changes something you can see what changed. This matters more as you let agents write more. “The spec says X” is a much better conversation when you can also ask “since when, and who put it there.”
The context is human-readable: This is the part that gets lost in a lot of agent memory tooling. A vector store or a JSON blob is a fine place for machines to keep state and a terrible place for a person to look. The spec above is a document your security lead can open, read, and argue with. No special client required.
The context flows both ways: The demo above shows Claude writing and Codex reading, but the CLI writes as easily as it reads. The second agent can append its findings, update the decisions log, or check off open questions, and the next tool that opens the note sees that too. The document is not a one-way export. It is the place the work lives.
Everyone is looking at the same thing: Your agents and your teammates read the same note. The engineer who joins the thread on Thursday is not getting a summary of a summary. They are getting the document.
Try it
If you want to run this yourself, you need three things:
- A HackMD account and an API token
- The CLI:
npm install -g @hackmd/hackmd-cli - Any agent that can run shell commands
Then tell your first agent to create a folder and write something into it. Tell your second agent to go read it.
