Claude Code
Hooks · MCP · /learn · /borrowStart a new session in the project to load the hooks. The agent gets the bunshin_recall and bunshin_load tools.
Bunshin / Documentation
Bunshin watches your agents’ sessions (Claude Code, Codex, Pi, robots), learns from them, and gives every later session what was learned, where it applies.
Open your invitation and sign in with the invited email address, or create a workspace of your own. Your administrator assigns your role, team and clearance: they decide what your agent may read.
Sign in to BunshinIn your workspace, open Agent keys and create a key for this machine. Each key follows your account’s current permissions and can be revoked on its own.
You need Node.js 20 or later and a signed-in Codex, Claude Code or Pi. For one project:
npm install -g @bunshin-cc/bunshin
cd ~/code/payments
bunshin setup --harness claude-code # or codex | piPaste the key at the hidden prompt. Bunshin reads your permissions, saves the key privately outside the project and configures the hooks. Model calls use your agent’s own login.
To connect every project under one folder (each its own repository), run setup in the folder with --hooks user. The hooks go in your user settings, so sessions anywhere under the folder use this workspace; sessions elsewhere are untouched.
cd ~/learn
bunshin setup --harness claude-code --hooks user
bunshin sources # which folders take part
bunshin sources exclude narr-review # leave one out (new folders still join)
bunshin sources only shop blog # just theseUse one workspace per company: connect ~/dev to your company’s workspace and ~/learn to your own. Each keeps its own copy of its skills and links them only into its own projects.
Start a new session in the project to load the hooks. The agent gets the bunshin_recall and bunshin_load tools.
Run codex in the project, accept its project trust prompt, then run /hooks and trust the Bunshin hooks. New or changed hooks wait for your approval.
Use Node.js 22.19 or later. Start Pi or run /reload, review the extension, and check /bunshin status.
bunshin status
bunshin sync --jsonStatus shows the workspace, this project’s source and whether it takes part, the library and the hooks. Teach your agent a reusable fact, end the session, and the lesson appears in Sessions and Library; a fresh session gets it when it applies.
Mostly nothing: hooks sync at session start, serve the one lesson both recall voters agree on at each prompt, push the rules attached to files before they are edited, and reflect at session end.
bunshin learn "what to remember" | capture something now (applied locally, submitted) |
bunshin recall "the task, abstractly" | search this project’s scopes |
bunshin recall "…" --across | borrow from anywhere in the workspace |
bunshin load <id> [--anchor <heading>] | read one document; a borrowed one is recorded as evidence |
bunshin sync | upload and download now |
bunshin status | store, source, library, outbox, hooks |
/learn [what] | Claude Code: capture what this session learned now |
/borrow <what> | Claude Code, Codex, Pi: bring in a lesson learned in another project or group when you know it will help here |
/bunshin | Claude Code (with the mod), Pi: what Bunshin did in this session |
Open Scopes in the workspace. Sources appear on their own; admins create groups and drag projects (or groups) onto them, then Save. Removing a group moves its projects and lessons up to where it sat.
/borrow.Groups decide relevance only: who may read a lesson is still its clearance.
bunshin review | lessons your machine proposed (apply, submit, skip, apply-all) |
bunshin review approve <id> | owners: merge a proposal now (or reject) |
bunshin questions | open questions for your team |
bunshin questions answer <id> "<choice>" | answer one |
The workspace’s Review page shows every proposal with its diff, where it was learned and where it applies. On a session’s page you can tell reflection what it missed; it re-reflects with your steering.
bunshin import skills <dir> | bring a skill repository (with history) into the library |
bunshin skill list | show | log | lint | push | the deployed skills; push proposes local edits now |
bunshin library version | log | status | library versions, history, what is deployed where |
bunshin library checkout lib@N --to <dir> | reproduce any version |
bunshin index --upload | this repo’s SPEC.md, TESTING.md, SKILL.md into the library |
Without a model key on the server, a machine answers the nightly’s queue (reflection, merges, new documents, generalization) with its own agent login. Create a runner key in Runners:
bunshin runner install --key <runner key> # this computer, every hour
bunshin runner --once # answer what is queued now
bunshin runner statusbunshin setup --robot --robot-id robot-06 --arm so101 --gripper parallel \
--mount wristcam-v4 --cameras scene,wrist --domain cooking --site lab --cell c1A robot is its own source: group robots in Scopes and their lessons are shared the same way.
Every command and option, with troubleshooting, is in the command reference. In a terminal: bunshin --help.