Bunshin / Documentation

Your agents learn once, everywhere it applies.

Bunshin watches your agents’ sessions (Claude Code, Codex, Pi, robots), learns from them, and gives every later session what was learned, where it applies.

  • Workspace. One per company, or one for your own projects. Workspaces never share anything, on the server or on your machine.
  • Source. Where a session runs: a repository (named by its remote), a folder, or a robot. Sources appear by themselves.
  • Groups. Drawn by an admin over sources and other groups, for example Growth team = five repositories. Nothing is built in.
  • Scope. Each lesson applies to one project, a group (every project in it), or everywhere. Sessions get their own scopes’ lessons automatically; anything else when someone borrows it.
  • The nightly. Reflects on sessions, merges proposals, and generalizes: what a group’s projects learned separately is written once into the group.

01Join your workspace

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 Bunshin

02Create an agent key

In 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.

The full key is shown once. Keep it out of source control and chat transcripts.

03Install and connect

You need Node.js 20 or later and a signed-in Codex, Claude Code or Pi. For one project:

Terminal
npm install -g @bunshin-cc/bunshin
cd ~/code/payments
bunshin setup --harness claude-code     # or codex | pi

Paste 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.

04A folder of projects

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.

Terminal
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 these

Use 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.

Agent integrations

Claude Code

Hooks · MCP · /learn · /borrow

Start a new session in the project to load the hooks. The agent gets the bunshin_recall and bunshin_load tools.

Codex

Hooks · /borrow

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.

Pi

Extension · /borrow

Use Node.js 22.19 or later. Start Pi or run /reload, review the extension, and check /bunshin status.

05Check the loop

Terminal
bunshin status
bunshin sync --json

Status 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.

Every day

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 "…" --acrossborrow from anywhere in the workspace
bunshin load <id> [--anchor <heading>]read one document; a borrowed one is recorded as evidence
bunshin syncupload and download now
bunshin statusstore, source, library, outbox, hooks

Slash commands

/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
/bunshinClaude Code (with the mod), Pi: what Bunshin did in this session

Scopes

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.

  1. Reflection places each lesson at the narrowest scope it holds for: this project, one of its groups, or everywhere.
  2. Inside a group it is shared automatically with every project in it.
  3. Each night, generalization writes what a group’s projects learned separately once into the group and trims it from the originals. Borrows count as evidence. One-person workspaces apply it at once; companies review it in Review.
  4. Anyone can borrow across with /borrow.

Groups decide relevance only: who may read a lesson is still its clearance.

Review and questions

bunshin reviewlessons your machine proposed (apply, submit, skip, apply-all)
bunshin review approve <id>owners: merge a proposal now (or reject)
bunshin questionsopen 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.

The library

bunshin import skills <dir>bring a skill repository (with history) into the library
bunshin skill list | show | log | lint | pushthe deployed skills; push proposes local edits now
bunshin library version | log | statuslibrary versions, history, what is deployed where
bunshin library checkout lib@N --to <dir>reproduce any version
bunshin index --uploadthis repo’s SPEC.md, TESTING.md, SKILL.md into the library

Runners

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:

Terminal
bunshin runner install --key <runner key>   # this computer, every hour
bunshin runner --once                         # answer what is queued now
bunshin runner status

Robots

Terminal
bunshin setup --robot --robot-id robot-06 --arm so101 --gripper parallel \
  --mount wristcam-v4 --cameras scene,wrist --domain cooking --site lab --cell c1

A robot is its own source: group robots in Scopes and their lessons are shared the same way.

All commands

Every command and option, with troubleshooting, is in the command reference. In a terminal: bunshin --help.

Open workspace