brainclaw 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +592 -505
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/cli.js +138 -13
  4. package/dist/commands/add-step.js +1 -1
  5. package/dist/commands/bootstrap.js +2 -26
  6. package/dist/commands/check-security-mcp.js +50 -33
  7. package/dist/commands/check-security.js +86 -43
  8. package/dist/commands/claim.js +22 -21
  9. package/dist/commands/confirm.js +26 -0
  10. package/dist/commands/context-diff.js +1 -1
  11. package/dist/commands/dispatch-watch.js +142 -0
  12. package/dist/commands/doctor.js +113 -2
  13. package/dist/commands/estimation-report.js +115 -16
  14. package/dist/commands/harvest.js +286 -23
  15. package/dist/commands/hooks.js +73 -73
  16. package/dist/commands/init.js +124 -22
  17. package/dist/commands/install-hooks.js +78 -78
  18. package/dist/commands/loops-handlers.js +4 -0
  19. package/dist/commands/mcp-read-handlers.js +253 -41
  20. package/dist/commands/mcp.js +664 -102
  21. package/dist/commands/memory.js +21 -17
  22. package/dist/commands/migrate.js +81 -17
  23. package/dist/commands/prune.js +78 -4
  24. package/dist/commands/reflect.js +26 -20
  25. package/dist/commands/register-agent.js +57 -1
  26. package/dist/commands/repair.js +20 -0
  27. package/dist/commands/session-end.js +15 -6
  28. package/dist/commands/session-start.js +18 -1
  29. package/dist/commands/setup-security.js +39 -18
  30. package/dist/commands/setup.js +26 -27
  31. package/dist/commands/stale.js +16 -2
  32. package/dist/commands/switch.js +26 -5
  33. package/dist/commands/uninstall.js +126 -34
  34. package/dist/commands/update-step.js +6 -0
  35. package/dist/commands/version.js +1 -1
  36. package/dist/commands/worktree.js +60 -0
  37. package/dist/core/actions.js +12 -3
  38. package/dist/core/agent-capability.js +30 -17
  39. package/dist/core/agent-files.js +963 -666
  40. package/dist/core/agent-integrations.js +0 -3
  41. package/dist/core/agent-inventory.js +67 -0
  42. package/dist/core/agent-registry.js +163 -29
  43. package/dist/core/agentrun-reconciler.js +33 -2
  44. package/dist/core/agentruns.js +7 -1
  45. package/dist/core/ai-agent-detection.js +31 -44
  46. package/dist/core/archival.js +15 -9
  47. package/dist/core/assignment-reconciler.js +56 -0
  48. package/dist/core/assignment-sweeper.js +127 -4
  49. package/dist/core/assignments.js +69 -11
  50. package/dist/core/bootstrap.js +233 -67
  51. package/dist/core/brainclaw-version.js +22 -0
  52. package/dist/core/candidates.js +21 -1
  53. package/dist/core/claims.js +313 -150
  54. package/dist/core/codev-prompts.js +38 -38
  55. package/dist/core/config.js +6 -1
  56. package/dist/core/context-diff.js +148 -20
  57. package/dist/core/context.js +129 -8
  58. package/dist/core/coordination.js +22 -3
  59. package/dist/core/default-profiles/doctor.yaml +11 -11
  60. package/dist/core/default-profiles/janitor.yaml +11 -11
  61. package/dist/core/default-profiles/onboarder.yaml +11 -11
  62. package/dist/core/default-profiles/reviewer.yaml +13 -13
  63. package/dist/core/dispatch-status.js +79 -5
  64. package/dist/core/dispatcher.js +65 -12
  65. package/dist/core/entity-operations.js +74 -27
  66. package/dist/core/entity-registry.js +31 -5
  67. package/dist/core/event-log.js +138 -21
  68. package/dist/core/events/checkpoint.js +258 -0
  69. package/dist/core/events/genesis.js +220 -0
  70. package/dist/core/events/journal.js +507 -0
  71. package/dist/core/events/materialize.js +126 -0
  72. package/dist/core/events/registry-post-image.js +110 -0
  73. package/dist/core/events/verify.js +109 -0
  74. package/dist/core/execution-adapters.js +23 -0
  75. package/dist/core/execution.js +1 -1
  76. package/dist/core/facade-schema.js +38 -0
  77. package/dist/core/gc-semantic.js +130 -5
  78. package/dist/core/handoff-snapshot.js +68 -0
  79. package/dist/core/ids.js +19 -8
  80. package/dist/core/instruction-templates.js +34 -115
  81. package/dist/core/io.js +39 -3
  82. package/dist/core/json-store.js +10 -1
  83. package/dist/core/lock.js +153 -28
  84. package/dist/core/loops/bootstrap-acquire.js +25 -1
  85. package/dist/core/loops/facade-schema.js +2 -0
  86. package/dist/core/loops/hooks/survey-signals-baseline.js +36 -0
  87. package/dist/core/loops/index.js +1 -0
  88. package/dist/core/loops/presets/bootstrap.js +7 -0
  89. package/dist/core/loops/store.js +17 -0
  90. package/dist/core/loops/verbs.js +24 -2
  91. package/dist/core/markdown.js +8 -76
  92. package/dist/core/mcp-command-resolution.js +245 -0
  93. package/dist/core/memory-compactor.js +5 -3
  94. package/dist/core/memory-lifecycle.js +282 -0
  95. package/dist/core/merge-risk.js +150 -0
  96. package/dist/core/messaging.js +10 -3
  97. package/dist/core/migration.js +11 -1
  98. package/dist/core/observer-mode.js +26 -0
  99. package/dist/core/operations/memory-mutation.js +90 -65
  100. package/dist/core/operations/plan.js +27 -1
  101. package/dist/core/protocol-skills.js +210 -0
  102. package/dist/core/reflection-safety.js +6 -7
  103. package/dist/core/reputation.js +84 -2
  104. package/dist/core/runtime-signals.js +72 -10
  105. package/dist/core/runtime.js +84 -1
  106. package/dist/core/schema.js +114 -0
  107. package/dist/core/search.js +19 -2
  108. package/dist/core/security-detectors.js +125 -0
  109. package/dist/core/security-extract.js +189 -0
  110. package/dist/core/security-guard.js +217 -139
  111. package/dist/core/security-packages.js +121 -0
  112. package/dist/core/security-scoring.js +76 -9
  113. package/dist/core/security.js +34 -2
  114. package/dist/core/sequence.js +11 -2
  115. package/dist/core/setup-flow.js +141 -13
  116. package/dist/core/spawn-check.js +16 -2
  117. package/dist/core/staleness.js +73 -2
  118. package/dist/core/state.js +250 -54
  119. package/dist/core/store-resolution.js +45 -12
  120. package/dist/core/worktree.js +90 -26
  121. package/dist/facts.js +8 -8
  122. package/dist/facts.json +7 -7
  123. package/docs/PROTOCOL.md +223 -0
  124. package/docs/adapters/openclaw.md +43 -43
  125. package/docs/architecture/project-refs.md +328 -328
  126. package/docs/cli.md +2097 -2096
  127. package/docs/concepts/coordination.md +52 -52
  128. package/docs/concepts/coordinator-runbook.md +129 -0
  129. package/docs/concepts/dispatch-lifecycle.md +245 -245
  130. package/docs/concepts/event-log-store.md +928 -0
  131. package/docs/concepts/ideation-loop.md +317 -317
  132. package/docs/concepts/loop-engine.md +520 -511
  133. package/docs/concepts/mcp-governance.md +268 -268
  134. package/docs/concepts/memory.md +89 -88
  135. package/docs/concepts/multi-agent-workflows.md +167 -167
  136. package/docs/concepts/observer-protocol.md +361 -0
  137. package/docs/concepts/parallel-merge-protocol.md +71 -0
  138. package/docs/concepts/plans-and-claims.md +217 -174
  139. package/docs/concepts/project-md-convention.md +35 -35
  140. package/docs/concepts/runtime-notes.md +38 -38
  141. package/docs/concepts/skills.md +78 -0
  142. package/docs/concepts/troubleshooting.md +254 -254
  143. package/docs/concepts/workspace-bootstrapping.md +142 -81
  144. package/docs/context-format-changelog.md +35 -35
  145. package/docs/context-format.md +48 -48
  146. package/docs/index.md +65 -65
  147. package/docs/integrations/agents.md +162 -162
  148. package/docs/integrations/claude-code.md +23 -23
  149. package/docs/integrations/cline.md +87 -88
  150. package/docs/integrations/codex.md +2 -2
  151. package/docs/integrations/continue.md +60 -60
  152. package/docs/integrations/copilot.md +82 -80
  153. package/docs/integrations/cursor.md +23 -23
  154. package/docs/integrations/kilocode.md +72 -72
  155. package/docs/integrations/mcp.md +377 -377
  156. package/docs/integrations/mistral-vibe.md +122 -122
  157. package/docs/integrations/openclaw.md +99 -98
  158. package/docs/integrations/opencode.md +84 -84
  159. package/docs/integrations/overview.md +122 -122
  160. package/docs/integrations/roo.md +74 -74
  161. package/docs/integrations/windsurf.md +83 -83
  162. package/docs/mcp-schema-changelog.md +360 -329
  163. package/docs/playbooks/integration/index.md +121 -121
  164. package/docs/playbooks/orchestration.md +37 -0
  165. package/docs/playbooks/productivity/index.md +99 -99
  166. package/docs/playbooks/team/index.md +117 -117
  167. package/docs/product/agent-first-model.md +184 -184
  168. package/docs/product/entity-model-audit.md +462 -462
  169. package/docs/product/positioning.md +86 -86
  170. package/docs/quickstart-existing-project.md +107 -107
  171. package/docs/quickstart.md +148 -147
  172. package/docs/release-maintenance.md +79 -79
  173. package/docs/reputation.md +52 -52
  174. package/docs/review.md +45 -45
  175. package/docs/security.md +212 -53
  176. package/docs/server-operations.md +118 -118
  177. package/docs/storage.md +110 -108
  178. package/package.json +86 -69
@@ -1,67 +1,67 @@
1
- # Agent Integration
2
-
3
- ## The problem brainclaw solves for agents
4
-
5
- Coding agents are stateless. Each session starts from zero. They don't know:
6
-
7
- - what other agents have been working on
8
- - what files are being actively edited by someone else
9
- - what decisions were made last week and why
10
- - what traps to avoid in a specific part of the codebase
11
-
12
- Brainclaw gives every agent access to this shared context through a combination of surfaces adapted to what each agent can handle.
13
-
14
- ## Multiple points of contact
15
-
16
- No single mechanism is enough. Agents don't always obey a single instruction file. They sometimes skip MCP calls. They forget between prompts.
17
-
18
- That's why brainclaw uses every available surface:
19
-
20
- 1. **Instruction files** set the frame — "this project uses brainclaw, here's how"
21
- 2. **Hooks** inject context automatically — the agent sees plans and claims without asking
22
- 3. **MCP tools** provide on-demand access — the agent calls brainclaw when it needs more detail
23
- 4. **Auto-approve** removes friction — no popup confirmation for each tool call
24
- 5. **Skills/commands** give the developer a manual override — force a context refresh when needed
25
-
26
- The more surfaces are active, the more reliably the agent uses brainclaw.
27
-
28
- ## What the instruction file contains
29
-
30
- The instruction file (CLAUDE.md, .cursor/rules/, AGENTS.md, etc.) is the agent's first contact with brainclaw. Its content depends on the agent's capabilities:
31
-
32
- ### For agents with MCP and hooks (Claude Code)
33
-
34
- Short and focused:
35
- - Why brainclaw matters for this project
36
- - The session protocol (hooks handle the rest)
37
- - Active constraints and instructions
38
- - Version check reminder
39
-
40
- ### For agents with MCP but no hooks (Cursor, Codex, Cline, Copilot, Windsurf, Continue, Kilocode, OpenCode, Roo, Mistral Vibe, Gemini CLI, etc.)
41
-
42
- More directive:
43
- - Same core sections as above, with stronger language ("REQUIRED", "MUST")
44
- - The top 5 most critical traps (the agent won't see them otherwise)
45
- - Explicit step-by-step protocol with all MCP calls listed
46
- - For Tier B/C agents that lack hooks, an opt-in `.live.md` companion (regenerated on session-end and handoff) carries plans, claims, traps, candidates, and handoffs as a parity backstop — write with `brainclaw export --include-live --write`
47
-
48
- ### For agents without MCP (autonomous agents only)
49
-
50
- Full static context via SKILL.md:
51
- - All of the above
52
- - Active plans with status and assignees
53
- - All shared traps
54
- - Recent architectural decisions
55
-
56
- ### For autonomous agents (OpenClaw, NanoClaw, NemoClaw, PicoClaw, ZeroClaw)
57
-
58
- Skill-based integration via `skills/<agent>/SKILL.md`:
59
- - Compact brainclaw usage instructions adapted to the agent's workflow
60
- - Uses `--profile compact` by default (short sessions, constrained resources)
61
- - Supports task-based and scheduled workflow models
62
-
63
- ## Setting up agent integration
64
-
1
+ # Agent Integration
2
+
3
+ ## The problem brainclaw solves for agents
4
+
5
+ Coding agents are stateless. Each session starts from zero. They don't know:
6
+
7
+ - what other agents have been working on
8
+ - what files are being actively edited by someone else
9
+ - what decisions were made last week and why
10
+ - what traps to avoid in a specific part of the codebase
11
+
12
+ Brainclaw gives every agent access to this shared context through a combination of surfaces adapted to what each agent can handle.
13
+
14
+ ## Multiple points of contact
15
+
16
+ No single mechanism is enough. Agents don't always obey a single instruction file. They sometimes skip MCP calls. They forget between prompts.
17
+
18
+ That's why brainclaw uses every available surface:
19
+
20
+ 1. **Instruction files** set the frame — "this project uses brainclaw, here's how"
21
+ 2. **Hooks** inject context automatically — the agent sees plans and claims without asking
22
+ 3. **MCP tools** provide on-demand access — the agent calls brainclaw when it needs more detail
23
+ 4. **Auto-approve** removes friction — no popup confirmation for each tool call
24
+ 5. **Skills/commands** give the developer a manual override — force a context refresh when needed
25
+
26
+ The more surfaces are active, the more reliably the agent uses brainclaw.
27
+
28
+ ## What the instruction file contains
29
+
30
+ The instruction file (CLAUDE.md, .cursor/rules/, AGENTS.md, etc.) is the agent's first contact with brainclaw. Its content depends on the agent's capabilities:
31
+
32
+ ### For agents with MCP and hooks (Claude Code)
33
+
34
+ Short and focused:
35
+ - Why brainclaw matters for this project
36
+ - The session protocol (hooks handle the rest)
37
+ - Active constraints and instructions
38
+ - Version check reminder
39
+
40
+ ### For agents with MCP but no hooks (Cursor, Codex, Cline, Copilot, Windsurf, Continue, Kilocode, OpenCode, Roo, Mistral Vibe, Gemini CLI, etc.)
41
+
42
+ More directive:
43
+ - Same core sections as above, with stronger language ("REQUIRED", "MUST")
44
+ - The top 5 most critical traps (the agent won't see them otherwise)
45
+ - Explicit step-by-step protocol with all MCP calls listed
46
+ - For Tier B/C agents that lack hooks, an opt-in `.live.md` companion (regenerated on session-end and handoff) carries plans, claims, traps, candidates, and handoffs as a parity backstop — write with `brainclaw export --include-live --write`
47
+
48
+ ### For agents without MCP (autonomous agents only)
49
+
50
+ Full static context via SKILL.md:
51
+ - All of the above
52
+ - Active plans with status and assignees
53
+ - All shared traps
54
+ - Recent architectural decisions
55
+
56
+ ### For autonomous agents (OpenClaw, NanoClaw, NemoClaw, PicoClaw, ZeroClaw)
57
+
58
+ Skill-based integration via `skills/<agent>/SKILL.md`:
59
+ - Compact brainclaw usage instructions adapted to the agent's workflow
60
+ - Uses `--profile compact` by default (short sessions, constrained resources)
61
+ - Supports task-based and scheduled workflow models
62
+
63
+ ## Setting up agent integration
64
+
65
65
  ### Automatic (recommended)
66
66
 
67
67
  ```bash
@@ -76,101 +76,101 @@ Or ask your coding agent to do it:
76
76
  ```
77
77
 
78
78
  The agent can use `bclaw_setup` to walk through the process interactively.
79
-
80
- ### Per-agent manual setup
81
-
82
- ```bash
83
- brainclaw enable-agent claude-code
84
- brainclaw enable-agent cursor
85
- brainclaw export --format claude-md --write
86
- brainclaw export --detect --write # auto-detect and write all formats
87
- ```
88
-
89
- ### Regenerating after changes
90
-
91
- When brainclaw memory changes (new constraints, resolved traps, updated plans), regenerate instruction files:
92
-
93
- ```bash
94
- brainclaw export --all # all known agent formats at once (17 targets today)
95
- brainclaw export --detect --write # only the detected agent
96
- ```
97
-
98
- For agents without MCP (autonomous agents), this is especially important — the instruction file or SKILL.md is their only source of project context.
99
-
100
- ## Generated files are local
101
-
102
- Agent config files generated by brainclaw are **not committed to Git**. Each developer regenerates them locally from the shared `.brainclaw/` store.
103
-
104
- This ensures:
105
- - No machine-specific traps leak into the shared repo
106
- - Each developer's agent sees instructions tailored to their setup
107
- - Instructions stay in sync with current memory, not a stale committed version
108
-
109
- brainclaw adds all generated files to `.gitignore` automatically during init.
110
-
111
- Exception: use `--shared` if you intentionally want the main instruction file (e.g., CLAUDE.md) versioned for the whole team.
112
-
113
- ## Multi-project workspaces
114
-
115
- When a workspace contains multiple brainclaw-initialized child projects, agents need to target the correct project store. There are three mechanisms (from most to least ergonomic):
116
-
117
- ### 1. `brainclaw switch` (persistent)
118
-
119
- An operator or agent sets the active project once, and all subsequent commands resolve against it:
120
-
121
- ```bash
122
- brainclaw switch apps/lodestar # set active project
123
- brainclaw plan list # targets lodestar
124
- bclaw_context(kind="memory") # MCP also targets lodestar
125
- brainclaw switch --clear # back to workspace root
126
- ```
127
-
128
- ### 2. `BRAINCLAW_PROJECT` environment variable
129
-
130
- Set in the shell or agent configuration. Useful for CI/CD or when the agent can control its environment:
131
-
132
- ```bash
133
- export BRAINCLAW_PROJECT=lodestar
134
- ```
135
-
136
- ### 3. `--cwd` flag (one-off override)
137
-
138
- For a single command without changing the active project:
139
-
140
- ```bash
141
- brainclaw --cwd apps/lodestar plan list
142
- ```
143
-
144
- **Priority**: `--cwd` > `BRAINCLAW_PROJECT` > active project > shell cwd.
145
-
146
- **Discovery**: use `brainclaw switch --list` to see all available projects in the workspace.
147
-
148
- ## Session lifecycle
149
-
150
- ### Starting work
151
-
152
- ```
153
- bclaw_work(intent="execute", scope="src/auth/") → start session, load context, claim scope in one call
154
- bclaw_context(kind="execution") → check local tooling and brainclaw updates
155
- ```
156
-
157
- ### During work
158
-
159
- ```
160
- bclaw_write_note("Found a race condition in AuthService") → record observations
161
- bclaw_create(entity="plan", data={ text: "Fix race condition", estimated_effort: 30 }) → track work
162
- ```
163
-
164
- ### Finishing work
165
-
166
- ```
167
- bclaw_session_end(auto_release: true) → release claims, update plans
168
- ```
169
-
170
- ### Plans and estimation
171
-
172
- Always estimate duration in minutes when creating a plan or step. When completing, report actual effort. This builds a calibration history that helps improve future estimates — agents are typically poor at estimation, and this feedback loop helps.
173
-
174
- ## Version awareness
175
-
176
- Agents should call `bclaw_context(kind="execution")` at session start (or `bclaw_work` which loads it implicitly). If a newer brainclaw version is available, it tells the agent, who can then inform the developer and suggest updating. Updates may include new features, new MCP tools, and improved coordination.
79
+
80
+ ### Per-agent manual setup
81
+
82
+ ```bash
83
+ brainclaw enable-agent claude-code
84
+ brainclaw enable-agent cursor
85
+ brainclaw export --format claude-md --write
86
+ brainclaw export --detect --write # auto-detect and write the current agent format
87
+ ```
88
+
89
+ ### Regenerating after changes
90
+
91
+ When brainclaw memory changes (new constraints, resolved traps, updated plans), regenerate instruction files:
92
+
93
+ ```bash
94
+ brainclaw export --all # all known agent formats at once (17 targets today)
95
+ brainclaw export --detect --write # only the detected agent
96
+ ```
97
+
98
+ For agents without MCP (autonomous agents), this is especially important — the instruction file or SKILL.md is their only source of project context.
99
+
100
+ ## Generated files are local
101
+
102
+ Agent config files generated by brainclaw are **not committed to Git**. Each developer regenerates them locally from the shared `.brainclaw/` store.
103
+
104
+ This ensures:
105
+ - No machine-specific traps leak into the shared repo
106
+ - Each developer's agent sees instructions tailored to their setup
107
+ - Instructions stay in sync with current memory, not a stale committed version
108
+
109
+ brainclaw adds all generated files to `.gitignore` automatically during init.
110
+
111
+ Exception: use `--shared` if you intentionally want the main instruction file (e.g., CLAUDE.md) versioned for the whole team.
112
+
113
+ ## Multi-project workspaces
114
+
115
+ When a workspace contains multiple brainclaw-initialized child projects, agents need to target the correct project store. There are three mechanisms (from most to least ergonomic):
116
+
117
+ ### 1. `brainclaw switch` (persistent)
118
+
119
+ An operator or agent sets the active project once, and all subsequent commands resolve against it:
120
+
121
+ ```bash
122
+ brainclaw switch apps/lodestar # set active project
123
+ brainclaw plan list # targets lodestar
124
+ bclaw_context(kind="memory") # MCP also targets lodestar
125
+ brainclaw switch --clear # back to workspace root
126
+ ```
127
+
128
+ ### 2. `BRAINCLAW_PROJECT` environment variable
129
+
130
+ Set in the shell or agent configuration. Useful for CI/CD or when the agent can control its environment:
131
+
132
+ ```bash
133
+ export BRAINCLAW_PROJECT=lodestar
134
+ ```
135
+
136
+ ### 3. `--cwd` flag (one-off override)
137
+
138
+ For a single command without changing the active project:
139
+
140
+ ```bash
141
+ brainclaw --cwd apps/lodestar plan list
142
+ ```
143
+
144
+ **Priority**: `--cwd` > `BRAINCLAW_PROJECT` > active project > shell cwd.
145
+
146
+ **Discovery**: use `brainclaw switch --list` to see all available projects in the workspace.
147
+
148
+ ## Session lifecycle
149
+
150
+ ### Starting work
151
+
152
+ ```
153
+ bclaw_work(intent="execute", scope="src/auth/") → start session, load context, claim scope in one call
154
+ bclaw_context(kind="execution") → check local tooling and brainclaw updates
155
+ ```
156
+
157
+ ### During work
158
+
159
+ ```
160
+ bclaw_write_note("Found a race condition in AuthService") → record observations
161
+ bclaw_create(entity="plan", data={ text: "Fix race condition", estimated_effort: 30 }) → track work
162
+ ```
163
+
164
+ ### Finishing work
165
+
166
+ ```
167
+ bclaw_session_end(auto_release: true) → release claims, update plans
168
+ ```
169
+
170
+ ### Plans and estimation
171
+
172
+ Always estimate duration in minutes when creating a plan or step. When completing, report actual effort. This builds a calibration history that helps improve future estimates — agents are typically poor at estimation, and this feedback loop helps.
173
+
174
+ ## Version awareness
175
+
176
+ Agents should call `bclaw_context(kind="execution")` at session start (or `bclaw_work` which loads it implicitly). If a newer brainclaw version is available, it tells the agent, who can then inform the developer and suggest updating. Updates may include new features, new MCP tools, and improved coordination.
@@ -1,23 +1,23 @@
1
- # Claude Code Integration
2
-
3
- brainclaw is a good fit for Claude Code because Claude Code can work with files, instructions, MCP, and hook-like workflow mechanisms.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Claude Code (`CLAUDE_CODE_VERSION`) and writes `CLAUDE.md` automatically. Or manually:
8
-
9
- ```bash
10
- brainclaw export --format claude-md --write
11
- ```
12
-
13
- ## Recommended approach
14
-
15
- - use MCP as the default runtime path for dynamic retrieval and writes
16
- - keep `CLAUDE.md` lightweight and behavioral: it should tell Claude Code when to call Brainclaw, not carry all mutable workspace state
17
- - use `.brainclaw/project.md` as a readable fallback (it is a derived view, regenerated best-effort — run `brainclaw rebuild` if stale)
18
- - use hooks or workflow checks when a stronger reminder is needed
19
-
20
- ## Key idea
21
-
22
- Claude Code should not carry all workspace state in static instructions.
23
- brainclaw provides the living workspace layer through MCP plus local workflow guidance.
1
+ # Claude Code Integration
2
+
3
+ brainclaw is a good fit for Claude Code because Claude Code can work with files, instructions, MCP, and hook-like workflow mechanisms.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Claude Code (`CLAUDE_CODE_VERSION`) and writes `CLAUDE.md` automatically. Or manually:
8
+
9
+ ```bash
10
+ brainclaw export --format claude-md --write
11
+ ```
12
+
13
+ ## Recommended approach
14
+
15
+ - use MCP as the default runtime path for dynamic retrieval and writes
16
+ - keep `CLAUDE.md` lightweight and behavioral: it should tell Claude Code when to call Brainclaw, not carry all mutable workspace state
17
+ - use `.brainclaw/project.md` as a readable fallback (it is a derived view, regenerated best-effort — run `brainclaw rebuild` if stale)
18
+ - use hooks or workflow checks when a stronger reminder is needed
19
+
20
+ ## Key idea
21
+
22
+ Claude Code should not carry all workspace state in static instructions.
23
+ brainclaw provides the living workspace layer through MCP plus local workflow guidance.
@@ -1,88 +1,87 @@
1
- # Cline Integration
2
-
3
- brainclaw integrates with Cline through MCP tools, instruction rules, and lifecycle hooks. Cline is a Tier A agent full MCP access, hooks, auto-approve support, skills, and CLI spawn capability for parallel lanes.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Cline (the VS Code extension and/or the `cline` CLI) and writes:
8
-
9
- - `.clinerules/brainclaw.md` — Cline-specific instruction rules (auto-discovered by Cline)
10
- - `.cline/mcp.json` — project-level MCP config registering brainclaw
11
-
12
- Manual regeneration:
13
-
14
- ```bash
15
- brainclaw export --format cline --write
16
- brainclaw export --format cline --write --include-live
17
- ```
18
-
19
- ## MCP configuration
20
-
21
- Cline reads MCP servers from `.cline/mcp.json` at the project root:
22
-
23
- ```json
24
- {
25
- "mcpServers": {
26
- "brainclaw": {
27
- "command": "npx",
28
- "args": ["-y", "brainclaw@latest", "mcp"]
29
- }
30
- }
31
- }
32
- ```
33
-
34
- Cline supports per-server `alwaysAllow` for auto-approving specific tools:
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "brainclaw": {
40
- "command": "npx",
41
- "args": ["-y", "brainclaw@latest", "mcp"],
42
- "alwaysAllow": ["bclaw_context", "bclaw_work", "bclaw_find", "bclaw_get"]
43
- }
44
- }
45
- }
46
- ```
47
-
48
- ## Instruction files
49
-
50
- - `.clinerules/brainclaw.md` — Cline-specific rules (auto-discovered, project-scoped)
51
- - `.clinerules/live.md` — optional local live companion with current plans, claims, traps, candidates, and handoffs. Write it with `brainclaw export --format cline --write --include-live`; it remains gitignored.
52
- - Static content stays behavioural and lightweight. By default, live state flows through MCP; the live companion is an optional parity/backstop file.
53
-
54
- ## SKILL.md discovery
55
-
56
- Cline auto-discovers skills from `.clinerules/`, `.claude/skills/`, and `.agents/skills/`. brainclaw writes a single `.agents/skills/brainclaw/SKILL.md` that Cline picks up automatically.
57
-
58
- ## Headless invocation
59
-
60
- Cline is CLI-spawnable for parallel lanes and dispatched workflows. The canonical invoke template is:
61
-
62
- ```bash
63
- cline -y "{prompt}"
64
- ```
65
-
66
- The `-y` flag (YOLO mode) disables interactive approval prompts so the spawned worker runs autonomously.
67
-
68
- ## Capability profile
69
-
70
- | Field | Value |
71
- |-------|-------|
72
- | Tier | A |
73
- | MCP | yes |
74
- | Hooks | yes |
75
- | Auto-approve | yes (`alwaysAllow` per server, `-y` per session) |
76
- | Skills | yes |
77
- | CLI spawnable | yes |
78
- | Max concurrent tasks | 3 |
79
- | Workflow model | interactive |
80
- | MCP config scope | project |
81
- | Prompt delivery | `inline_arg` (preferred, max 8000 chars), `inbox_structured` (fallback) |
82
-
83
- ## Caveats
84
-
85
- - **Hook support varies by platform**: Cline hooks are reliable on macOS/Linux but the Windows path is less exercised. brainclaw generates hooks that gracefully degrade when the runtime doesn't honour them — the templateTier stays A regardless.
86
- - **Cline / Roo / Kilocode family**: Cline shares its config-pattern lineage with Roo Code and Kilocode. The directory names differ (`.clinerules/` vs `.roo/rules/` vs `.kilo/rules/`) but the auto-discovery model is the same.
87
- - **Project-scoped MCP**: unlike machine-scoped agents (Cursor, Windsurf), Cline's MCP config lives in the repo. Each repo gets its own brainclaw registration.
88
- - **Long prompts**: inline arg supports up to 8000 chars before falling back to inbox-structured delivery. Briefs longer than that should arrive via inbox.
1
+ # Cline Integration
2
+
3
+ brainclaw integrates with Cline through MCP tools, instruction rules, auto-approval, and CLI spawn capability for parallel lanes. Cline does not currently expose a Brainclaw-managed lifecycle hook surface.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Cline (the VS Code extension and/or the `cline` CLI) and writes:
8
+
9
+ - `.clinerules/brainclaw.md` — Cline-specific instruction rules (auto-discovered by Cline)
10
+ - `.cline/mcp.json` — project-level MCP config registering brainclaw
11
+
12
+ Manual regeneration:
13
+
14
+ ```bash
15
+ brainclaw export --format cline --write
16
+ brainclaw export --format cline --write --include-live
17
+ ```
18
+
19
+ ## MCP configuration
20
+
21
+ Cline reads MCP servers from `.cline/mcp.json` at the project root:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "brainclaw": {
27
+ "command": "npx",
28
+ "args": ["-y", "brainclaw@latest", "mcp"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Cline supports per-server `alwaysAllow` for auto-approving specific tools:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "brainclaw": {
40
+ "command": "npx",
41
+ "args": ["-y", "brainclaw@latest", "mcp"],
42
+ "alwaysAllow": ["bclaw_context", "bclaw_work", "bclaw_find", "bclaw_get"]
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Instruction files
49
+
50
+ - `.clinerules/brainclaw.md` — Cline-specific rules (auto-discovered, project-scoped)
51
+ - `.clinerules/live.md` — optional local live companion with current plans, claims, traps, candidates, and handoffs. Write it with `brainclaw export --format cline --write --include-live`; it remains gitignored.
52
+ - Static content stays behavioural and lightweight. By default, live state flows through MCP; the live companion is an optional parity/backstop file.
53
+
54
+ ## SKILL.md discovery
55
+
56
+ Cline may discover skills from agent-specific directories depending on the installed extension/version. Brainclaw's current Cline writer configures MCP and `.clinerules/brainclaw.md`; it does not write a Cline-specific SKILL.md.
57
+
58
+ ## Headless invocation
59
+
60
+ Cline is CLI-spawnable for parallel lanes and dispatched workflows. The canonical invoke template is:
61
+
62
+ ```bash
63
+ cline -y "{prompt}"
64
+ ```
65
+
66
+ The `-y` flag (YOLO mode) disables interactive approval prompts so the spawned worker runs autonomously.
67
+
68
+ ## Capability profile
69
+
70
+ | Field | Value |
71
+ |-------|-------|
72
+ | Tier | A |
73
+ | MCP | yes |
74
+ | Hooks | no |
75
+ | Auto-approve | yes (`alwaysAllow` per server, `-y` per session) |
76
+ | Skills | no Brainclaw-specific writer |
77
+ | CLI spawnable | yes |
78
+ | Max concurrent tasks | 3 |
79
+ | Workflow model | interactive |
80
+ | MCP config scope | project |
81
+ | Prompt delivery | `inline_arg` (preferred, max 8000 chars), `inbox_structured` (fallback) |
82
+
83
+ ## Caveats
84
+
85
+ - **Cline / Roo / Kilocode family**: Cline shares its config-pattern lineage with Roo Code and Kilocode. The directory names differ (`.clinerules/` vs `.roo/rules/` vs `.kilo/rules/`) but the auto-discovery model is the same.
86
+ - **Project-scoped MCP**: unlike machine-scoped agents (Cursor, Windsurf), Cline's MCP config lives in the repo. Each repo gets its own brainclaw registration.
87
+ - **Long prompts**: inline arg supports up to 8000 chars before falling back to inbox-structured delivery. Briefs longer than that should arrive via inbox.
@@ -1,6 +1,6 @@
1
1
  # Codex Integration
2
2
 
3
- brainclaw integrates with OpenAI's Codex CLI through MCP tools and shared instruction files. Codex is a Tier A agent — full MCP access, lifecycle hooks, skills support, and headless CLI spawn capability.
3
+ brainclaw integrates with OpenAI's Codex CLI through MCP tools and shared instruction files. Codex has MCP access, universal skills support, and headless CLI spawn capability, but no native lifecycle hook surface.
4
4
 
5
5
  ## Auto-setup
6
6
 
@@ -61,7 +61,7 @@ Since pln#476 (1.0.13+), spawned Codex workers are marked `delivered_and_started
61
61
  |-------|-------|
62
62
  | Tier | A |
63
63
  | MCP | yes |
64
- | Hooks | yes |
64
+ | Hooks | no |
65
65
  | Auto-approve | manual (per-tool approval) |
66
66
  | Skills | yes |
67
67
  | CLI spawnable | yes |