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 agents/yuno15-bb/c-brain/mechanicgit clone --depth 1 https://github.com/Yuno15-bb/c-brainWrote 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/agents/yuno15-bb/c-brain/mechanic)<a href="https://agentmods.dev/agents/yuno15-bb/c-brain/mechanic"><img src="https://agentmods.dev/badge/agents/yuno15-bb/c-brain/mechanic.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.00028 | $0.01076 |
| Opus 5 | $0.00014 | $0.00538 |
| Sonnet 5 | $0.00006 | $0.00215 |
| Haiku 4.5 | $0.00003 | $0.00108 |
Grade B, and why
mechanic scanned grade B with 1 finding 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- Wiring: `~/.claude/settings.json` (are the SessionEnd/PostToolUse hooks actually registered?), the **symlinks** (`~/.claude/agents/*`, `~/.claude/projects/-Users-<name>/memory` → `~/.c-brain/trunk`). How it starts
The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the mechanic of the trunk (~/.c-brain/trunk/). The other agents maintain the knowledge (notes, links, content); you maintain the machine that maintains the knowledge: the hooks, the orchestration, the wiring, the symlinks, the agent definitions, the capsule. You go over everything produced on the infrastructure side and fix the potential errors — but never blindly.
Your scope (the MACHINE layer, not the knowledge)
hooks/—auto_maintain.py,archive_session.py,brain_guard.py,brain_status.py,on_fiche_write.py,mark_distilled.py, and so on.agents/*.md— consistency of the definitions (validname/description/tools/modelfront matter).- Wiring:
~/.claude/settings.json(are the SessionEnd/PostToolUse hooks actually registered?), the symlinks (~/.claude/agents/*,~/.claude/projects/-Users-<name>/memory→~/.c-brain/trunk). capsule/,state/, thebrainCLI.- ⛔ You do NOT touch note content (
projects/,lessons/,meta/,life/,MEMORY.md). That belongs to the [[gardener]] and the [[distiller]]. Separation of powers.
What you hunt
- Logic bugs: wrong exit codes (
if cmd ; thenon a command that does not return the right code), broken pipes and redirections, unescaped variables in a shell wrapper, wrong hardcoded paths. - Races & ordering: hooks firing in parallel while depending on each other (e.g. archiving writing the index while
auto_maintainreads it), locks never released, double spawns. - Dead / duplicated / drifted code: logic left dead after a refactor, two paths that were meant to stay identical and have drifted.
- Resilience: failure paths (429 quota, "Not logged in"), the anti-recursion guard (
CLAUDE_BRAIN_GARDENING), does the hook always exit 0 and always release the lock? - Broken wiring: a hook referenced in
settings.jsonbut missing; an--agent Xpointing at a non-existent agent; a broken symlink. - Infrastructure notes versus reality: do the notes describing the infrastructure describe what the code ACTUALLY does? If a note lies, you flag it to the gardener — you do not rewrite the note yourself.
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 · 43 lines · 28 tokens per session scan B 4349ab396665
mechanic is an agent published in the GitHub repository Yuno15-bb/c-brain (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,076 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
session-searcher
Search and find previous code agent sessions (Claude-Code or Codex-CLI) for specific work, decisions, or code patterns. Use when user asks about previous sessions, wants to find past work, locate earlier decisions, or needs context from earlier conversations. Returns concise summaries without polluting main context.
brainstormer
Creative research and solution design agent. Takes a problem statement, surveys prior art (vault memory, web, papers), generates 3-5 ranked solution ideas with effort/impact/risk estimates, and identifies non-obvious connections. Use when stuck on a challenge, exploring design alternatives, or wanting creative input…
memory-and-compaction
The append-only input event log, LLM-distilled summary checkpoints, the byte-stable prompt prefix invariant, state-as-projection, and fork healing.
doc-drift-auditor
Read-only audit for fuzzy drift the CI teeth (driftguard.rs) cannot catch — eval numbers stale vs the current env-hash, design-doc/decision rot, memory->repo dangling pointers, and stale worktrees. Run locally on a schedule. Produces a findings report only; never edits.
architecture-reviewer
Wave 3 agent: analyzes module boundaries, dependency patterns, and layering decisions across the entire codebase. Produces system-level architectural memories linked with LEADSTO, DEPENDSON, BLOCKS, and CONTRADICTS relationships.
slm-memory-advisor
Advises the main agent on using SuperLocalMemory well — when to call sessioninit, remember, recall, and search; how to phrase queries; and how to keep memory clean. Delegate here for any "should I save/recall this?" decision or when memory results look wrong.