Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/brainos-hq/brain-os/wrapgit clone --depth 1 https://github.com/brainOS-HQ/brain-osWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/brainos-hq/brain-os/wrap)<a href="https://agentmods.dev/commands/brainos-hq/brain-os/wrap"><img src="https://agentmods.dev/badge/commands/brainos-hq/brain-os/wrap.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02236 |
| Opus 5 | $0.00000 | $0.01118 |
| Sonnet 5 | $0.00000 | $0.00447 |
| Haiku 4.5 | $0.00000 | $0.00224 |
Grade A, and why
wrap scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Brain OS : Session Wrap
Close the session cleanly. Update entity state. Capture decisions. Detect momentum shifts.
Not just "what changed" : "what does the system need to remember?"
REQUIRED FIRST READ
Before any tool call, read ~/.claude/brain-os/PROTOCOL.md. The wrap writes state back via MCP mutating tools; it must read current state via MCP tools first.
Step 0: Check for Compact Checkpoints
Before asking wrap questions, check for unconfirmed checkpoint files:
.brain/sessions/checkpoints/*-*.json
Look for any file where "confirmed": false and "status": "captured".
If found:
- Read the checkpoint(s).
- Show the user a human summary of what was captured:
Before context was compacted, I saved a checkpoint: - You were working on: [last_user_goals summary] - Files touched: [count] files in [project] - Open threads: [open_questions summary] - Last direction: [last_assistant_summary, one line] Does this look right? I'll fold the confirmed parts into today's wrap. - User confirms, edits, or discards.
- Confirmed content feeds into the normal wrap questions below (pre-filling suggestions).
- After wrap completes, mark the checkpoint file:
"status": "confirmed"or"status": "discarded".
Auto-wraps from a previous session
Also check for unconfirmed auto-wrap records written by wrap_auto:
.brain/sessions/autowrap-*.json
Each has "confirmed": false, the low-risk fields already applied (applied), and high-risk proposals staged under pending_review. For each one:
- Tell the user what was already auto-saved (the
appliedlist — next move, open questions, evidence). - For each
pending_reviewitem (status, mode, blocked, decisions), ask one short yes/no: "Last session I held this back for you to confirm: [item]. Apply it?" - Apply confirmed items via the normal tools (
entity_update;decision_checkthendecision_logfor decisions). Discard the rest. - Mark the record
"confirmed": true.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 209 lines · 0 tokens per session scan A 69516a4dd670
wrap is a command published in the GitHub repository brainOS-HQ/brain-os (6 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,236 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
tree-ring-update
Check for or install a verified Tree Ring Memory CLI update without changing installation scope.
tree-ring-certify
Generate Tree Ring harness or recall-quality evidence without confusing it with the full framework release suite.
tree-ring-dox-sync
Preview and synchronize DOX-style AGENTS.md guidance as source-linked Tree Ring memory.
tree-ring-recall
Recall durable Tree Ring Memory context before starting or resuming work.
lians-audit
Run a Lians compliance/audit operation - snapshot, chain verify, backtest, or erasure.
lians-recall
Recall current (non-stale) facts from Lians memory, optionally as-of a past date.