brain:export skill
Generates or refreshes the auto-generated section of a CLAUDE.local.md file using data from a brain SQLite database.
- GitHub stars
- 631
- Files
- 1
- Last commit
- Nov 11, 2026
- License
- Apache-2.0
- Allowed tools
- —
What does the brain:export skill do?
brain:export generates or refreshes the auto-generated section of a CLAUDE.local.md file using data from a brain SQLite database.
Summary generated from the skill's SKILL.md.
About the brain:export skill
Updating your project context files by pulling data from a brain SQLite database is what this skill enables. Developers use it to refresh the auto-generated portion of a CLAUDE.local.md file, ensuring that the AI agent has the most recent information regarding project identity, key people, systems, and recent decisions. It is designed to be used after a brain-update session, a brain-init setup, or a brain-rescan to keep local documentation in sync with the stored database.
The tool operates by reading an existing CLAUDE.local.md file and rewriting only the content located between specific sentinel markers. This approach protects any manual behavior rules or notes written outside those boundaries. It produces a structured markdown section containing project status, the last session details, and up to eight entities for both people and systems. The generated content is subject to a 1,200 token budget to maintain efficiency.
What an agent can do with it
- 1Refresh project contextUpdate the CLAUDE.local.md file with the latest decisions and system information from the brain database.
- 2Migrate feedback to rulesConvert existing feedback memory files into permanent behavior rules within your local documentation.
- 3Sync project identityIncorporate identity information from a local text file into the auto-generated project section.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the brain:export skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the brain:export skill in Claude Code
~/.claude/skills/brain-export/SKILL.md
$ npx degit coco-research/coco/systems/brain/skills/brain-export ~/.claude/skills/brain-exportInstall the brain:export skill in Claude Code (project)
.claude/skills/brain-export/SKILL.md
$ npx degit coco-research/coco/systems/brain/skills/brain-export .claude/skills/brain-exportInstall the brain:export skill in Codex
~/.agents/skills/brain-export/SKILL.md
$ npx degit coco-research/coco/systems/brain/skills/brain-export ~/.agents/skills/brain-exportInstall the brain:export skill in Gemini CLI
~/.gemini/skills/brain-export/SKILL.md
$ npx degit coco-research/coco/systems/brain/skills/brain-export ~/.gemini/skills/brain-exportInstall the brain:export skill in Claude.ai
npx degit coco-research/coco/systems/brain/skills/brain-export brain-export && zip -r brain-export.zip brain-export # claude.ai → Customize → Skills → + → Create skill → Upload a skill → brain-export.zip
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A skill needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablecoco-research/coco/systems/brain/skills/brain-export is public and reachablegithub.com/coco-research/coco/tree/HEAD/systems/brain/skills ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-11github.com/coco-research/coco/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/coco-research/coco/blob/HEAD/systems/brain/skills ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/coco-research/coco/blob/HEAD/systems/brain/skills ↗Pass
- SKILL.md follows the Agent Skills formatname "brain:export" is not 1-64 lowercase letters, digits and single hyphensgithub.com/coco-research/coco/blob/HEAD/systems/brain/skills ↗Finding
SKILL.md
View on GitHub/brain-export — CLAUDE.local.md Auto-Generator
Generates or refreshes the <!-- AUTO-GENERATED: brain-export --> section in the project's CLAUDE.local.md file from the brain SQLite DB. Protects all manually written content above and below the sentinels.
Quick Reference
BRAIN="python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py"
# Basic export (writes CLAUDE.local.md next to project_brain.db)
$BRAIN export <project-slug>
# Export with explicit output path
$BRAIN export <project-slug> --output /path/to/CLAUDE.local.md
# Export with explicit DB path
$BRAIN --db /path/to/project_brain.db export <project-slug>
Procedure
Step 1 — Verify brain DB exists
BRAIN="python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py"
$BRAIN info
If the DB is missing, tell the user to run /brain-init first.
Step 2 — Run the export
$BRAIN export <project-slug>
The exporter will:
- Read any existing
CLAUDE.local.mdat the output path - Preserve everything above
<!-- AUTO-GENERATED: brain-export --> - Preserve everything below
<!-- END AUTO-GENERATED --> - If no sentinels found, append the auto section at the bottom (safe first run)
- Regenerate the auto section from brain DB
- Write atomically (tmp file + rename)
Step 3 — Show the user what was generated
Parse the JSON output and display:
brain:export complete
─────────────────────────────────────────
Output: /path/to/CLAUDE.local.md
Project slug: <slug>
Auto section: ~NNN tokens (within 1,200 token budget: YES/NO)
Total file: ~NNN tokens
─────────────────────────────────────────
Sections generated:
- Project Identity (if ~/.mempalace/identity.txt exists)
- Last Session (most recent event + decision)
- Key People (up to 8 person entities)
- Key Systems (up to 8 system/module entities)
- Recent Decisions (last 4 decisions)
- Project Status (entity/decision/event counts + last sync date)
Step 4 — First-run: offer to migrate feedback memories
If this is the first export AND the project memory directory contains files with type: feedback frontmatter, offer to migrate them into behavior rules:
Found N feedback memory files that could become behavior rules in CLAUDE.local.md:
- feedback_html_docs_with_tailwind.md → "Documents as Tailwind HTML not Markdown"
Add these as a ## Behavior Rules section below the auto-generated block? [y/N]
To migrate programmatically:
from brain.exporter import migrate_feedback_memories
from pathlib import Path
memory_dir = Path("~/.claude/projects/<project-slug-hash>/memory").expanduser()
rules = migrate_feedback_memories(memory_dir)
for rule in rules:
print(rule)
Then append the rules as a ## Behavior Rules section below <!-- END AUTO-GENERATED --> in CLAUDE.local.md.
Auto-Section Format
<!-- AUTO-GENERATED: brain-export -->
<!-- Generated: 2026-04-09T12:00:00Z | Brain DB: 42 entities | MemPalace: 7 drawers -->
## Project Identity
<contents of ~/.mempalace/identity.txt if it exists>
## Last Session
- Most recent event title (YYYY-MM-DD)
- Most recent decision text (YYYY-MM-DD)
## Key People
| Name | Role | Email |
|------|------|-------|
| Alice Smith | Product Manager | alice@example.com |
## Key Systems
- **SystemA** — Description from metadata
- **ModuleB**
## Recent Decisions
- [2026-04-08] Decision text (truncated to 120 chars)
## Project Status
- Entities: 42 | Decisions: 12 | Events: 8
- Last brain sync: 2026-04-09
- Query: `/coco brain` or `/brain context {slug}` for full context
<!-- END AUTO-GENERATED -->
Sentinel Contract
| Sentinel | Position | Meaning |
|---|---|---|
<!-- AUTO-GENERATED: brain-export --> |
Start of auto block | Everything below is managed by exporter |
<!-- END AUTO-GENERATED --> |
End of auto block | Everything below is protected manual content |
Never manually edit between the sentinels — changes will be overwritten on next export. Safe to edit anything above START or below END at any time.
Token Budget
The auto section is capped at 1,200 tokens (~4,800 characters). If the generated content exceeds this, the body is truncated. The header comment and sentinels are always preserved intact.
When to Run
- After every
/brain-updatesession flush (brain DB has new data) - After
/brain-init(first time setup) - After
/brain-rescan(bulk entity import) - When starting work on a project for the first time in a new session (ensure context is fresh)
Trigger Phrases
- "export brain to CLAUDE.local.md"
- "refresh project context file"
- "generate CLAUDE.local"
- "update auto-generated section"
- "brain export "
Files in this skill
1brain:export skill questions
How do I install the brain:export skill in Claude Code?
Run npx degit coco-research/coco/systems/brain/skills/brain-export ~/.claude/skills/brain-export. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the brain:export skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What happens to my manual notes in CLAUDE.local.md when I run the export?
The exporter preserves all manually written content located above the start sentinel and below the end sentinel.
What should I do if the brain database is missing?
You should run the /brain-init command first.
Is there a limit to how much information is exported?
Yes, the auto section is capped at 1,200 tokens, which is approximately 4,800 characters.
Can I manually edit the auto-generated section?
No, you should never manually edit between the sentinels because changes will be overwritten during the next export.