Install any skill in seconds. Free to start, no credit card required.
Get Started Free →End-of-session brain flush. Scans the full conversation, extracts all new entities, decisions, tasks, events, relationships, and updates, presents a summary, and writes to project_brain.db after confirmation. Use at end of every session or when you want to capture everything discussed.
.claude/skills/coco-research-brain-update/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 200% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 12% | 0% |
This is a forcing function. When invoked, Claude MUST thoroughly review the entire conversation and write everything learned to the brain DB. No shortcuts, no skipping.
Look for project_brain.db in the current working directory or parent dirs. If not found, error: "No brain DB found. Run /brain init first."
CRITICAL --- the user runs multiple terminal sessions in parallel. Another session may have already written to the brain since this conversation started. Before extracting, read the current DB state:
bashpython3 ~/.claude/skills/brain/scripts/brain/brain_cli.py context {slug}
For each project, note:
Conflict rules:
Show any conflicts detected:
CROSS-SESSION CONFLICTS
=======================
Task "Get sandbox access" --- brain says "done" (updated by another session),
this session would set "open". KEEPING "done".
Decision "Use Stakeholder role..." --- already in brain. SKIPPING.Go through every message from top to bottom. For EACH project in the brain DB, extract:
| Category | What to look for | |----------|-----------------| | New entities | Any person, team, role, system, module, or org mentioned for the first time | | New relationships | Connections discovered: X owns Y, A reports to B, team scoped to module | | New decisions | Anything decided, agreed, confirmed, resolved, or ruled out | | New events | Meetings, calls, emails read, milestones, deployments | | New tasks | Action items, to-dos, next steps, follow-ups, blockers identified | | Task updates | Existing tasks that changed status (started, completed, blocked, cancelled) | | Entity updates | New info about existing entities (role change, new metadata, correction) | | Thread updates | New items to link to existing threads, or new threads to create |
The user invoked /brain-update --- that IS the confirmation. Do NOT ask "Write all to brain?" or wait for approval. Just do it.
Use Python to write all items via the brain operations module:
pythonimport sys sys.path.insert(0, '$HOME/.claude/skills/brain/scripts') from brain.schema import get_db from brain.operations import *
Write in this order:
BRAIN UPDATED
=============
Entities: +3 (total: 47)
Relationships: +1 (total: 37)
Tasks: +2, ~3 updated (total: 8)
Decisions: +1 (total: 4)
Events: +1 (total: 3)
Threads: 1 updated (total: 1)
Synced to: MemPalace (N drawers), brain.json (N people)After all brain DB writes complete, run the memory bridge to sync new knowledge to the other memory stores:
pythonfrom brain.memory_bridge import full_sync full_sync(db_path, project_slug)
This:
The sync is automatic. No user confirmation needed for this step.
After brain DB writes complete and full_sync runs (Step 6b), incrementally update knowledge articles for entities whose evidence has changed in this session.
Collect changed entity IDs from the writes performed in Step 3 (entities upserted, decisions/events written). Pass these to the knowledge engine for targeted refresh:
pythonimport sys, os sys.path.insert(0, os.path.expanduser("~/.coco/knowledge")) from engine import KnowledgeEngine engine = KnowledgeEngine() # changed_entity_ids = list of brain DB entity IDs written in this session engine.incremental_update(project_slug, changed_entity_ids)
Or equivalently via CLI (re-harvests all entities but only regenerates stale ones):
bashpython3 ~/.coco/knowledge/cron.py --run --project {slug} --phases 2,3,5
Only articles whose source_hash changed are regenerated. Expected: 1–5 article regenerations per typical session. Estimated cost: ~$0.01.
Show result inline in the existing brain-update summary block:
BRAIN UPDATED
=============
Entities: +3 (total: 47)
Relationships: +1 (total: 37)
Tasks: +2, ~3 updated (total: 8)
Decisions: +1 (total: 4)
Events: +1 (total: 3)
Threads: 1 updated (total: 1)
Synced to: MemPalace (N drawers), brain.json (N people)
Knowledge: N articles refreshed (N new entities, N updated)Skip silently if:
~/.coco/knowledge/ does not exist (knowledge engine not installed)cron.py is unavailable or returns a non-zero exit codeupsert_entity which matches on (project_id, type, name) or (project_id, type, external_id).| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | fail→pass | 10,796 | 2,761 | -74% | 1 | 1 | 0% | 1,899 | 2,123 | +12% | 0 | 0 | — |
case-01 | fail→fail | 13,773 | 18,746 | +36% | 1 | 1 | 0% | 811 | 2,192 | +170% | 0 | 0 | — |
case-02 | fail→fail | 35,679 | 16,418 | -54% | 1 | 1 | 0% | 5,969 | 2,059 | -66% | 0 | 0 | — |
case-03 | fail→fail | 8,053 | 14,811 | +84% | 1 | 1 | 0% | 1,303 | 3,324 | +155% | 0 | 0 | — |
case-04 | fail→pass | 16,731 | 11,730 | -30% | 1 | 1 | 0% | 1,587 | 2,290 | +44% | 0 | 0 | — |
case-05 | fail→fail | 10,925 | 8,989 | -18% | 1 | 1 | 0% | 1,554 | 2,389 | +54% | 0 | 0 | — |
case-06 | fail→pass | 5,324 | 3,065 | -42% | 1 | 1 | 0% | 778 | 2,334 | +200% | 0 | 0 | — |
case-07 | fail→pass | 15,401 | 8,546 | -45% | 1 | 1 | 0% | 1,572 | 2,292 | +46% | 0 | 0 | — |
case-12 | fail→fail | 2,940 | 3,062 | +4% | 1 | 1 | 0% | 454 | 2,240 | +393% | 0 | 0 | — |
case-08 | pass→pass | 12,340 | 4,396 | -64% | 1 | 1 | 0% | 2,107 | 2,568 | +22% | 0 | 0 | — |
case-09 | pass→pass | 11,027 | 8,321 | -25% | 1 | 1 | 0% | 1,071 | 2,248 | +110% | 0 | 0 | — |
case-10 | fail→pass | 16,391 | 8,788 | -46% | 1 | 1 | 0% | 2,069 | 2,325 | +12% | 0 | 0 | — |
case-11 | fail→pass | 14,225 | 6,759 | -52% | 1 | 1 | 0% | 1,601 | 2,061 | +29% | 0 | 0 | — |
case-13 | fail→pass | 15,588 | 7,558 | -52% | 1 | 1 | 0% | 1,874 | 2,233 | +19% | 0 | 0 | — |
case-14 | fail→pass | 16,230 | 2,904 | -82% | 1 | 1 | 0% | 1,828 | 2,295 | +26% | 0 | 0 | — |
case-15 | fail→pass | 19,526 | 2,509 | -87% | 1 | 1 | 0% | 2,331 | 2,207 | -5% | 0 | 0 | — |
case-16 | fail→pass | 13,687 | 9,977 | -27% | 1 | 1 | 0% | 2,187 | 2,525 | +15% | 0 | 0 | — |
case-17 | fail→pass | 7,676 | 10,368 | +35% | 1 | 1 | 0% | 1,372 | 2,453 | +79% | 0 | 0 | — |
case-19 | fail→pass | 17,810 | 2,666 | -85% | 1 | 1 | 0% | 2,006 | 2,242 | +12% | 0 | 0 | — |
case-20 | pass→pass | 16,432 | 8,505 | -48% | 1 | 1 | 0% | 1,609 | 2,157 | +34% | 0 | 0 | — |
case-21 | fail→pass | 12,500 | 16,996 | +36% | 1 | 1 | 0% | 2,718 | 3,312 | +22% | 0 | 0 | — |
case-22 | fail→fail | 17,493 | 15,468 | -12% | 1 | 1 | 0% | 2,074 | 2,102 | +1% | 0 | 0 | — |
case-23 | pass→pass | 11,243 | 19,724 | +75% | 1 | 1 | 0% | 1,088 | 3,173 | +192% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 20 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +57 percentage points is the difference between those two pass rates over the 20 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.