brain_session
Open or close an agent's working session to load full context at conversation start and persist executive state, critique, and cross-agent sync at close.
Instructions
Open or close the agent's working session. Call phase='start' once at the beginning of every conversation, before any other brain tool; call phase='end' once when the user signals they are done. Not for single facts (brain_remember).
start returns the whole context block: the cron daily brief with a stale flag,
executive state (objective, missions, pending decisions; a note instead when the file
has none of those sections), the mental models when configured (one that was cut says
so), a keyword search per top mission, the staged-inbox count, and `recovery` when the
previous session never closed.
end drains the capture queue when one is configured, appends a close line to today's
session archive, replaces executive_state and session_critique with the bodies you
pass (the file each replaces is kept beside it as `.prev.md`), writes the cross-agent
sync file from your body or a stub built from this session's brain_remember calls,
reports which trait signals moved, and writes the clean-close marker. `warning` in
the reply means the executive_state you passed lacks the sections start reads: call
end again with them. A second end overwrites the first.Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"phase": "<phase>"
},
"name": "brain_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sync | No | end only: full markdown body of the cross-agent sync note. | |
| phase | Yes | 'start' or 'end'. | |
| critique | No | end only: full markdown body that replaces session_critique. Omitted: left unchanged. | |
| session_id | No | Caller's session id; omit to keep the one the server opened. | |
| executive_state | No | end only: full markdown body that replaces executive_state. Keep the `## Primary Objective`, `## Top Missions` and `## Pending Decisions` headings: start reads those. Omitted: left unchanged. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||