brainclaw 1.9.0 → 1.10.0

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 (149) hide show
  1. package/README.md +631 -499
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/cli.js +18 -1
  4. package/dist/commands/code-map.js +129 -0
  5. package/dist/commands/codev.js +7 -0
  6. package/dist/commands/harvest.js +1 -1
  7. package/dist/commands/hooks.js +73 -73
  8. package/dist/commands/init.js +1 -1
  9. package/dist/commands/install-hooks.js +78 -78
  10. package/dist/commands/mcp-read-handlers.js +57 -14
  11. package/dist/commands/mcp.js +200 -13
  12. package/dist/commands/run-profile.js +3 -2
  13. package/dist/commands/switch.js +125 -93
  14. package/dist/commands/version.js +1 -1
  15. package/dist/core/agent-capability.js +19 -4
  16. package/dist/core/agent-files.js +131 -119
  17. package/dist/core/code-map/backend.js +123 -0
  18. package/dist/core/code-map/core.js +81 -0
  19. package/dist/core/code-map/drafts.js +2 -0
  20. package/dist/core/code-map/extractor.js +29 -0
  21. package/dist/core/code-map/finalizer.js +191 -0
  22. package/dist/core/code-map/freshness.js +108 -0
  23. package/dist/core/code-map/ids.js +0 -0
  24. package/dist/core/code-map/importable.js +35 -0
  25. package/dist/core/code-map/indexes.js +197 -0
  26. package/dist/core/code-map/lang/java/imports.scm +17 -0
  27. package/dist/core/code-map/lang/java/index.js +254 -0
  28. package/dist/core/code-map/lang/java/tags.scm +48 -0
  29. package/dist/core/code-map/lang/php/imports.scm +21 -0
  30. package/dist/core/code-map/lang/php/index.js +251 -0
  31. package/dist/core/code-map/lang/php/tags.scm +44 -0
  32. package/dist/core/code-map/lang/provider.js +9 -0
  33. package/dist/core/code-map/lang/providers.js +24 -0
  34. package/dist/core/code-map/lang/python/imports.scm +90 -0
  35. package/dist/core/code-map/lang/python/index.js +364 -0
  36. package/dist/core/code-map/lang/python/tags.scm +81 -0
  37. package/dist/core/code-map/lang/query-runtime.js +374 -0
  38. package/dist/core/code-map/lang/registry.js +125 -0
  39. package/dist/core/code-map/lang/typescript/imports.scm +90 -0
  40. package/dist/core/code-map/lang/typescript/index.js +306 -0
  41. package/dist/core/code-map/lang/typescript/tags.js.scm +106 -0
  42. package/dist/core/code-map/lang/typescript/tags.scm +151 -0
  43. package/dist/core/code-map/lock.js +210 -0
  44. package/dist/core/code-map/materialized.js +51 -0
  45. package/dist/core/code-map/memory-reader.js +59 -0
  46. package/dist/core/code-map/paths.js +53 -0
  47. package/dist/core/code-map/query.js +568 -0
  48. package/dist/core/code-map/refresh.js +0 -0
  49. package/dist/core/code-map/resolve.js +177 -0
  50. package/dist/core/code-map/store.js +206 -0
  51. package/dist/core/code-map/types.js +288 -0
  52. package/dist/core/code-map/vocabulary.js +57 -0
  53. package/dist/core/code-map/wasm-loader.js +294 -0
  54. package/dist/core/code-map/work-section.js +206 -0
  55. package/dist/core/codev-prompts.js +38 -38
  56. package/dist/core/codev-rounds.js +4 -0
  57. package/dist/core/default-profiles/doctor.yaml +11 -11
  58. package/dist/core/default-profiles/janitor.yaml +11 -11
  59. package/dist/core/default-profiles/onboarder.yaml +11 -11
  60. package/dist/core/default-profiles/reviewer.yaml +13 -13
  61. package/dist/core/dispatcher.js +1 -1
  62. package/dist/core/entity-operations.js +29 -3
  63. package/dist/core/execution-adapters.js +11 -10
  64. package/dist/core/execution-profile.js +58 -0
  65. package/dist/core/execution.js +1 -1
  66. package/dist/core/facade-schema.js +9 -0
  67. package/dist/core/instruction-templates.js +2 -0
  68. package/dist/core/loops/verbs.js +0 -1
  69. package/dist/core/mcp-command-resolution.js +3 -1
  70. package/dist/core/messaging.js +2 -2
  71. package/dist/core/protocol-skills.js +164 -164
  72. package/dist/core/runtime-signals.js +1 -1
  73. package/dist/core/search.js +19 -2
  74. package/dist/core/security-guard.js +207 -207
  75. package/dist/core/spawn-check.js +16 -2
  76. package/dist/core/staleness.js +1 -1
  77. package/dist/core/store-resolution.js +67 -11
  78. package/dist/core/worktree.js +18 -18
  79. package/dist/facts.js +9 -5
  80. package/dist/facts.json +8 -4
  81. package/dist/vendor/web-tree-sitter/tree-sitter.js +3980 -0
  82. package/dist/vendor/web-tree-sitter/tree-sitter.wasm +0 -0
  83. package/dist/wasm/tree-sitter-java.wasm +0 -0
  84. package/dist/wasm/tree-sitter-javascript.wasm +0 -0
  85. package/dist/wasm/tree-sitter-php.wasm +0 -0
  86. package/dist/wasm/tree-sitter-python.wasm +0 -0
  87. package/dist/wasm/tree-sitter-tsx.wasm +0 -0
  88. package/dist/wasm/tree-sitter-typescript.wasm +0 -0
  89. package/dist/wasm/tree-sitter.wasm +0 -0
  90. package/docs/PROTOCOL.md +1 -1
  91. package/docs/adapters/openclaw.md +43 -43
  92. package/docs/architecture/project-refs.md +328 -328
  93. package/docs/cli.md +2131 -2093
  94. package/docs/code-map.md +198 -0
  95. package/docs/concepts/coordination.md +52 -52
  96. package/docs/concepts/coordinator-runbook.md +129 -129
  97. package/docs/concepts/dispatch-lifecycle.md +245 -245
  98. package/docs/concepts/event-log-store.md +928 -928
  99. package/docs/concepts/ideation-loop.md +317 -317
  100. package/docs/concepts/loop-engine.md +520 -511
  101. package/docs/concepts/mcp-governance.md +268 -268
  102. package/docs/concepts/memory.md +84 -84
  103. package/docs/concepts/multi-agent-workflows.md +167 -167
  104. package/docs/concepts/observer-protocol.md +361 -361
  105. package/docs/concepts/plans-and-claims.md +217 -217
  106. package/docs/concepts/project-md-convention.md +35 -35
  107. package/docs/concepts/runtime-notes.md +38 -38
  108. package/docs/concepts/troubleshooting.md +254 -254
  109. package/docs/concepts/workspace-bootstrapping.md +142 -142
  110. package/docs/context-format-changelog.md +35 -35
  111. package/docs/context-format.md +48 -48
  112. package/docs/index.md +65 -65
  113. package/docs/integrations/agents.md +158 -158
  114. package/docs/integrations/claude-code.md +23 -23
  115. package/docs/integrations/cline.md +77 -77
  116. package/docs/integrations/continue.md +55 -55
  117. package/docs/integrations/copilot.md +68 -68
  118. package/docs/integrations/cursor.md +23 -23
  119. package/docs/integrations/kilocode.md +72 -72
  120. package/docs/integrations/mcp.md +385 -378
  121. package/docs/integrations/mistral-vibe.md +122 -122
  122. package/docs/integrations/openclaw.md +92 -92
  123. package/docs/integrations/opencode.md +84 -84
  124. package/docs/integrations/overview.md +115 -115
  125. package/docs/integrations/roo.md +71 -71
  126. package/docs/integrations/windsurf.md +77 -77
  127. package/docs/mcp-schema-changelog.md +364 -356
  128. package/docs/playbooks/integration/index.md +121 -121
  129. package/docs/playbooks/orchestration.md +37 -0
  130. package/docs/playbooks/productivity/index.md +99 -99
  131. package/docs/playbooks/team/index.md +117 -117
  132. package/docs/product/agent-first-model.md +184 -184
  133. package/docs/product/entity-model-audit.md +462 -462
  134. package/docs/product/positioning.md +86 -86
  135. package/docs/quickstart-existing-project.md +107 -107
  136. package/docs/quickstart.md +183 -183
  137. package/docs/release-maintenance.md +79 -79
  138. package/docs/reputation.md +52 -52
  139. package/docs/review.md +45 -45
  140. package/docs/security.md +212 -212
  141. package/docs/server-operations.md +118 -118
  142. package/docs/storage.md +106 -106
  143. package/package.json +86 -66
  144. package/docs/concepts/event-log-store-critique-A.md +0 -333
  145. package/docs/concepts/event-log-store-critique-B.md +0 -353
  146. package/docs/concepts/event-log-store-phase0-measurements.md +0 -58
  147. package/docs/concepts/event-log-store-proposal-A.md +0 -365
  148. package/docs/concepts/event-log-store-proposal-B.md +0 -404
  149. package/docs/concepts/identity-model-proposal.md +0 -371
@@ -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
79
+
80
+ ### Per-agent manual setup
81
+
82
+ ```bash
83
83
  brainclaw enable-agent claude-code
84
84
  brainclaw enable-agent cursor
85
85
  brainclaw export --format claude-md --write
86
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.
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,87 +1,87 @@
1
- # Cline Integration
2
-
1
+ # Cline Integration
2
+
3
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
-
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
54
  ## SKILL.md discovery
55
55
 
56
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
- |-------|-------|
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
72
  | Tier | A |
73
73
  | MCP | yes |
74
74
  | Hooks | no |
75
75
  | Auto-approve | yes (`alwaysAllow` per server, `-y` per session) |
76
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
-
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
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.
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,60 +1,60 @@
1
- # Continue Integration
2
-
3
- brainclaw integrates with Continue through MCP tools and project-scoped rules, giving Continue access to shared memory, plans, claims, and coordination state.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Continue and writes `.continue/rules/brainclaw.md` automatically. Or manually:
8
-
1
+ # Continue Integration
2
+
3
+ brainclaw integrates with Continue through MCP tools and project-scoped rules, giving Continue access to shared memory, plans, claims, and coordination state.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Continue and writes `.continue/rules/brainclaw.md` automatically. Or manually:
8
+
9
9
  ```bash
10
10
  brainclaw export --format continue --write
11
11
  ```
12
-
13
- ## MCP configuration
14
-
15
- Continue reads MCP server definitions from `.continue/config.json`. Add brainclaw:
16
-
17
- ```json
18
- {
19
- "mcpServers": [
20
- {
21
- "name": "brainclaw",
22
- "command": "npx",
23
- "args": ["-y", "brainclaw@latest", "mcp"]
24
- }
25
- ]
26
- }
27
- ```
28
-
29
- Per-server YAML configs are also supported in `.continue/mcpServers/*.yaml`.
30
-
31
- ## Permissions
32
-
33
- Continue uses a separate permissions file at `~/.continue/permissions.yaml`. Tool-level control uses `--allow`, `--ask`, and `--exclude` flags on the CLI.
34
-
12
+
13
+ ## MCP configuration
14
+
15
+ Continue reads MCP server definitions from `.continue/config.json`. Add brainclaw:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": [
20
+ {
21
+ "name": "brainclaw",
22
+ "command": "npx",
23
+ "args": ["-y", "brainclaw@latest", "mcp"]
24
+ }
25
+ ]
26
+ }
27
+ ```
28
+
29
+ Per-server YAML configs are also supported in `.continue/mcpServers/*.yaml`.
30
+
31
+ ## Permissions
32
+
33
+ Continue uses a separate permissions file at `~/.continue/permissions.yaml`. Tool-level control uses `--allow`, `--ask`, and `--exclude` flags on the CLI.
34
+
35
35
  `brainclaw setup-machine` writes `~/.continue/permissions.yaml` when Continue is selected. Configure it manually only if you need stricter local policy than Brainclaw's generated defaults.
36
-
37
- ## SKILL.md discovery
38
-
39
- Continue discovers skills from `config.yaml` slashCommands. It does not auto-discover `.agents/skills/` — use explicit config if you need brainclaw skills.
40
-
41
- ## Headless invocation
42
-
43
- ```bash
44
- cn --auto /path/to/project
45
- ```
46
-
47
- Set `CONTINUE_API_KEY` for API-backed headless runs.
48
-
49
- ## Invoke template
50
-
51
- ```bash
52
- cn /path/to/project
53
- ```
54
-
55
- ## Caveats
56
-
57
- - **No hooks**: Continue delegates hook-like behavior to VS Code extensions. No native pre-prompt injection.
36
+
37
+ ## SKILL.md discovery
38
+
39
+ Continue discovers skills from `config.yaml` slashCommands. It does not auto-discover `.agents/skills/` — use explicit config if you need brainclaw skills.
40
+
41
+ ## Headless invocation
42
+
43
+ ```bash
44
+ cn --auto /path/to/project
45
+ ```
46
+
47
+ Set `CONTINUE_API_KEY` for API-backed headless runs.
48
+
49
+ ## Invoke template
50
+
51
+ ```bash
52
+ cn /path/to/project
53
+ ```
54
+
55
+ ## Caveats
56
+
57
+ - **No hooks**: Continue delegates hook-like behavior to VS Code extensions. No native pre-prompt injection.
58
58
  - **Permissions are machine-local**: Brainclaw can write `~/.continue/permissions.yaml`, but it is not committed with the project.
59
- - **No native subagents**: Continue does not expose subagent orchestration.
60
- - **Windows**: Works via VS Code extension; CLI (`cn`) requires Node.js on PATH.
59
+ - **No native subagents**: Continue does not expose subagent orchestration.
60
+ - **Windows**: Works via VS Code extension; CLI (`cn`) requires Node.js on PATH.