Share a decision across two agents¶
In this tutorial, an agent in Claude Code records a scoped business decision, Hivemind consolidates it, and a fresh agent in Codex resumes it correctly: it applies the exception where it applies, keeps the default elsewhere, and reports what is still undecided. Why Hivemind explains the reasoning behind this handoff.
Before you start¶
You need the readiness checkpoint to pass, and:
- an isolated tutorial space, for example
travel-policy-demo, created with the standard Memory Bank rules by a trusted provisioner; - two dedicated agent identities with Read + write on that space, one used
by Claude Code and one used by Codex (see
Connect Claude Code and
Connect Codex). Neither daily client needs
manageor administrator rights; - the project instruction block installed in both clients, so each agent reads
space_rules,mid_read_allandshort_readbefore it works; - chat and embedding providers configured on the instance, because consolidation calls the chat model;
- an instance with authentication on whose storage passed Core's startup
write witness. Otherwise memory bank writes,
mid_consolidateincluded, are refused withauth17_commit_unqualified(see Install in production).
Nothing here needs Project Mesh, a plugin, LONG document ingestion or an
automatic capture feature. long is part of the stack; this exercise does not
require a long_push.
All amounts, people and trips are fictional. The agent prepares a recommendation; it never books or spends.
The scenario¶
| Item | Value |
|---|---|
| Base rule | The normal hotel budget is EUR 150 per night. |
| Decision TRIP-001 | Up to EUR 180 per night for the two-night Lyon trip, because the event hotel is required. Applies to TRIP-001 only. |
| Approval | The office manager approved it in conversation with Agent A. |
| Open question | Whether breakfast is included in the exception. |
Agent A is the Claude Code identity. Agent B is the Codex identity. Keep the
space name consistent; the instructions below use travel-policy-demo.
Step 1 — Agent A records the decision¶
Open Claude Code in the project whose instructions name the space. Confirm the startup reads happened (the agent reports the rules and an empty or near-empty bank). Then give the decision in your own words, for example:
Record our travel policy and today's decision. The normal hotel budget is EUR 150 per night. For TRIP-001, the two-night Lyon trip, I approve up to EUR 180 per night because the event hotel is required; that exception is for TRIP-001 only. Breakfast is not decided yet. Write this to Hivemind.
Expected behaviour: Agent A writes several atomic notes with short_note
under its own identity, such as:
| Category | Content (illustrative) |
|---|---|
decision |
Base rule: normal hotel budget is EUR 150 per night. |
decision |
TRIP-001 (Lyon, two nights): hotel up to EUR 180 per night approved by the office manager because the event hotel is required. Scope: TRIP-001 only. |
question |
Is breakfast included in the TRIP-001 exception? Undecided. |
The human supplies and approves the decision; the agent authors the notes. Do not ask the agent to pretend to be someone else, and do not try to write the note yourself: a person has no note-writing right in Hivemind.
Checkpoint: decision captured. Ask Agent A to call short_read on the
space. Each note must show the agent identity you created for Claude Code, and
the rule, the exception, its scope, its rationale, the approval attribution and
the open question must remain distinguishable.
Step 2 — Consolidate once and confirm completion¶
Ask Agent A to consolidate its notes:
Consolidate your notes for travel-policy-demo.
Expected behaviour: Agent A calls mid_consolidate once for the space and
returns the acknowledgement. The answer contains a job_id and a state such as
queued or running. That is an acknowledgement, not a result. The agent must
not poll or re-submit.
When you want to know whether it finished, ask once:
Check the status of consolidation job
.
Agent A calls bank_consolidation_status with that id. Continue only when the
top-level status is succeeded. queued or running means wait and ask again
later. failed or not_found means stop and diagnose (see
what to do on failure); do not start a loop of retries.
Checkpoint: consolidation complete. The job reports succeeded, and
mid_read_all on the space now shows the decision in the bank. With the
standard rules, activeContext.md carries the TRIP-001 exception under its
active decisions and the breakfast question under pending decisions. The
processed notes have left short_read.
What you have verified so far is storage: the decision exists in the handbook with its scope and attribution. Whether another agent behaves correctly with it is the next, separate check.
Step 3 — Agent B resumes in a fresh session¶
Open a new Codex session in a project whose instructions name the same space, using the Codex identity. Do not paste Tuesday's conversation, and do not mention the amounts. Confirm the startup reads happened: Codex should summarise the rules and the bank, including the TRIP-001 decision.
Checkpoint: fresh-session resumption. The context came through Hivemind
(mid_read_all), not through a prompt you typed. If you want evidence, ask
Codex to list the tool calls it made before answering, or inspect the space's
Memory tab in the Portal: no new note was written by Codex yet.
Now ask the three questions.
3a — The applicable case¶
The event hotel for TRIP-001 costs EUR 170 per night. Can you recommend it?
Expected: Codex recommends it and cites the recorded exception (up to EUR 180 for TRIP-001, approved by the office manager), naming the bank file it read.
Checkpoint: applicable case. The recommendation applies EUR 180 to TRIP-001 only and names the shared source.
3b — Outside scope¶
We also have a one-night trip to Nantes next month. A hotel there costs EUR 165 per night. Is that fine?
Expected: Codex applies the EUR 150 default, or asks for an explicit exception for that trip. It must not extend the TRIP-001 exception to Nantes.
Checkpoint: outside scope. EUR 150 remains the rule for the other trip, or an explicit approval is requested.
3c — Uncertainty¶
Is breakfast included for TRIP-001?
Expected: Codex reports that the question is recorded as undecided and asks who should decide. It does not invent an answer.
Checkpoint: uncertainty. Breakfast is reported as unresolved.
Step 4 — The reverse witness¶
Repeat the exercise with the roles swapped: Codex records a new, different decision (for example a train-class rule and one exception), consolidates, and a fresh Claude Code session resumes it.
Recording a witness¶
When you run this tutorial as evidence, record:
- the product release or source revision and the client versions
(
claude --version,codex --version); - the deployment (local installation, test server or production-like), the chat and embedding profiles used, and the two agent identities;
- the
job_idand final status of the consolidation; - for each checkpoint, what you observed and the elapsed time.
Checkpoints at a glance:
| Checkpoint | Required observable evidence |
|---|---|
| Ready | Two authenticated identities, expected space access, chat and embedding providers configured, the embedded long runtime configured (a fresh space stays unbound until its first long_push); /health alone is insufficient. |
| Decision captured | Rule, exception, scope, rationale, approval attribution and open question remain distinguishable in short_read. |
| Consolidation complete | A succeeded job and the decision visible in mid_read_all; queued or running is not success. |
| Fresh-session resumption | Agent B obtained the context through Hivemind, without a manual copy into its prompt. |
| Applicable case | Agent B cites the shared source and applies EUR 180 only to TRIP-001. |
| Outside scope | Agent B keeps EUR 150 for another trip, or asks for an explicit exception. |
| Uncertainty | Agent B reports breakfast as unresolved. |
If something fails¶
| Symptom | What it means | Next step |
|---|---|---|
short_note is refused |
The identity has no Read + write grant on the space, or the space does not exist. | Check system_whoami and the space access granted to that agent in the Portal. |
The job stays queued for a long time |
Another job holds the space lane, the provider is slow, or the hivemind-worker service is not running. |
Wait, then ask once more. Do not submit a second job. If it never starts, see A consolidation was admitted but nothing completes. |
The job reports failed |
Usually a chat provider problem, for example no chat profile or a refused request. | Read the job's error, fix the provider configuration, then consolidate again. The notes are still there. |
The job reports not_found |
The instance does not know this job ID. | Check the ID from the acknowledgement. The notes stay in short_read until a job processes them; consolidate again only once you know no job is running. |
| Agent B does not read the bank first | Its instructions are missing or not loaded. | Reinstall the instruction block for the Codex project and start a new session. |
| Agent B generalises the exception or invents breakfast | A client behaviour failure, not a storage failure. | Record it as a failed checkpoint; check the bank text, then adjust the instructions. Do not edit the bank by hand to fix the agent. |
Never reset the space or delete notes to "clean up" a failed run. Create a new isolated space instead.