/project-brain:project-brainfrom project-brain
Scaffolds and manages persistent project memory across sessions using a brain/ folder. Handles setup, resume, handoff, and multi-workstream coordination on explicit user request.
Ships in project-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A folder structure + collaboration protocol for persistent project context across AI sessions. Use it to scaffold a brain/ folder in the user's project, resume work from an existing one, or update entries when work happens.
| User signal | Workflow |
|---|---|
| "set up project brain" / "scaffold project" / "建项目脑" / "init project context" | Kick-off — see §1 |
User is in a directory containing brain/ AND explicitly says "load" / "resume" / "what's the status" / "继续这个项目" | Startup — see §2 |
| User says "switch windows" / "context's getting full" / "I'll head out" / "hand off" / "shift change" / "压缩了" / "切窗口" / "交接" / "换班" / "接班" / "交班" | Handoff — see §3 |
A handoff / window-switch request as above, but the project has no brain/ | Handoff first, brain later — see §3b |
| User says "update the project brain" / "let's record this" / "更新项目脑" | Update — see §4 |
| Multi-workstream project, user says "hand this to the X workstream" / "tell the X window" / "交给 X 线" | Cross-workstream request — see §5 |
Activation boundary (important): Do not activate just because a brain/ folder exists in the current directory. Casual conversation that happens to occur inside a project does not require this skill — only explicit user requests do. This is intentional: the methodology refuses to auto-monitor or auto-trigger; user judgment decides when to engage.
brain/ is written for the next window, not for the user (v2.9.1, METHODOLOGY §4.1): write STATUS / HANDOFF / MAP registrations / RUNBOOK appends when the work lands — don't ask, don't report; commit with a message that says what changed. Ask the user exactly one thing, and only when you can't tell: is this decided? DECISIONS / PROJECT follow the answer; what the user said plainly, write without asking.brain/topics/operations/RUNBOOK.md, numbered; handoffs cite the numbers.brain/ has multiple STATUS_<workstream>.md files, don't guess this window's workstream — use explicit signals only (the window is named for the workstream, e.g. web-6, or the user said so when opening it), otherwise ask.git diff --cached --stat before every commit (Trap 19); edit shared brain files in place, never rewrite them whole (Trap 20).When the user wants to scaffold:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/scaffold.sh" <user-project-root> (defaults to all four AI adapters: Claude, Cursor, Copilot, AGENTS.md). Add --lang zh if the project will be documented in Chinese — gives Chinese brain/ templates + Chinese CLAUDE.md (other adapters stay English regardless, since they're consumed by AI tools, not humans). The scaffold includes brain/topics/operations/RUNBOOK.md (v2.9), pre-registered in MAP §5 — fill its commands with the user on day one, or leave one line saying there's nothing to operate yet.brain/PROJECT.md on day one — fill the one-line definition + "what we explicitly DON'T do." Don't let this drift into the future.grep -rn "⚠️ TODO ⚠️" <user-project>/brain/ — go through with the user. Empty fields should be intentional.project-brain-pointer.md (type project) + one MEMORY.md index line saying state lives in brain/. If no memory directory is announced, skip.brain/)Single-workstream (only STATUS.md):
brain/MAP.mdbrain/STATUS.mdbrain/HANDOFF.md exists, read itMulti-workstream (multiple STATUS_<workstream>.md):
brain/MAP.md + brain/PROJECT.mdweb-6), or the user said which one when opening it. Otherwise ask: "I see this is a multi-workstream project with [list workstreams]. Which one does this window work on?"brain/STATUS_<workstream>.md + brain/HANDOFF_<workstream>.mdsentsent rows)brain/MAP.md, after checking nothing else is staged in it). Ad-hoc windows never claimUniversal discipline: if cwd switches to another project mid-session, re-read the new project's files; if the user switches workstreams in the same window, re-read the new workstream's files. Don't carry over memory.
Auto-memory pointer (v2.7): if Claude Code's memory index surfaced a project-brain pointer, it's a signpost only — still read the files above; never report state from it (Trap 17).
When the user says they're switching windows / context is getting full / heading out / 交接 / 换班:
brain/HANDOFF.md. Move what is still valid out before archiving — open waits into STATUS's ledgers, procedures and traps into brain/topics/operations/RUNBOOK.md (numbered), anything decided into DECISIONS (ask only if you can't tell it was decided). This shift's own new traps and procedures go into RUNBOOK the same way; the handoff cites the numbers. Write and commit.git mv brain/HANDOFF.md brain/handoffs/$(date +%Y-%m-%d-%H%M).md
(For multi-workstream: brain/HANDOFF_<current>.md → brain/handoffs/<current>/.... Concurrent windows: touch only your own workstream's files, and leave your roster row as is — the next window claims it.)brain/HANDOFF.md as a shift report — the template's six sections, empty ones deleted:
project-brain-pointer.md with the new HANDOFF timestamp (+ workstream) and replace its one line in MEMORY.md in place — never append. If no memory directory is announced, skip.brain/ yet (METHODOLOGY §1.4c)If the user asks for a handoff in a project that has no brain/:
brain/ here, and a handoff patched into a progress file goes stale shift by shift.HANDOFF.md, its state → STATUS.md, its "we decided" lines → DECISIONS (ask for the rejected alternatives), its runbook → topics/operations/RUNBOOK.md.HANDOFF.md at the project root in the six-section shape anyway. Never patch an existing "handoff" section in place. When brain/ arrives, the file moves in unchanged.Don't scaffold without a yes; a progress file is not a trigger — the user's handoff request is.
When the user says "update the project brain":
- STATUS overwrite: now at [X], next [Y]. Reason: you said "that's it"
- DECISIONS: about to append? Reason: that section felt like it landed — does this count as decided?
- MAP §5 register: new file at brain/topics/systems/[X].md. Reason: doc we just wrote
- HANDOFF: not needed — you didn't say switch windows
Never reverse this: don't ask the user "which files do you want to update?" That hands the wrong layer of judgment to the wrong person.
When this window's workstream needs something from another one — or the user says "hand this to the X workstream":
sent. Write and commit.sent row waits; the next window on that workstream finds it on wake (§2 step 4).${CLAUDE_PLUGIN_ROOT}/METHODOLOGY.mdscaffold.sh copies): ${CLAUDE_PLUGIN_ROOT}/templates/bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh" <user-project-root>What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ethan-ys/project-brain --plugin project-brainOther plugins' skills for the same job