You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Investigate issue #520: rename *Manager types to domain-role names
* feat(brain): add memory, hooks, maxTurns to kild-brain agent; deprecate --initial-prompt
- Add `memory: user`, `maxTurns: 200`, and agent-scoped `hooks:` to
kild-brain frontmatter (PreToolUse bash guard + Stop fleet snapshot)
- Create `.claude/hooks/brain-bash-guard.sh` to enforce "no source code
access" constraint at the hook level
- Replace ~40 lines of manual memory management with auto-memory note
- Fix router skill to use create-then-inject instead of --initial-prompt
- Deprecate --initial-prompt in CLI help text with runtime warnings
- Update CLAUDE.md with deprecation notes and inject-based brain setup
* fix: address review findings on brain hooks and deprecation warnings
- Guard: switch from fragile grep+sed JSON parsing to jq, fail closed
on parse failure, add ERR trap, block subshell invocations (bash -c,
sh -c), remove overly broad src/ pattern, document advisory nature
- Deprecation: eliminate contradictory double-warning for fleet sessions
by branching into fleet-specific vs general paths (not both)
- Deprecation: use color::warning/color::hint consistently in open.rs
(was bare eprintln, now matches create.rs)
- Deprecation: remove redundant initial_prompt_for_warning clone in
create.rs, clone at use site instead
- Logging: add structured error!() events for inbox fallback failures
in both create.rs and open.rs
- Stop hook: log stderr to file instead of /dev/null, ensure dir exists
- SKILL.md: add session-active check after sleep 5 before injecting,
warn user if session not ready instead of silently losing the message
command: "mkdir -p ~/.kild/brain && kild list --json > ~/.kild/brain/state.json 2>> ~/.kild/brain/stop-hook.log || echo \"$(date): kild list failed on Stop hook\" >> ~/.kild/brain/stop-hook.log"
22
+
timeout: 10
10
23
---
11
24
12
25
You are Honryū, the KILD fleet supervisor. You are the Tōryō's (human's) right hand — you do everything they would do from the CLI, but faster and in parallel. You coordinate a fleet of AI coding agents running in isolated git worktrees called kilds.
@@ -82,7 +95,7 @@ Communication uses two channels that work together. You don't need to think abou
82
95
83
96
### Sending instructions to workers
84
97
85
-
**Always use `kild inject` — never use `--initial-prompt`.**
98
+
**Always use `kild inject`.** The `--initial-prompt` flag is deprecated.
86
99
87
100
```bash
88
101
# Create a worker (no task yet — just boot the agent)
For non-Claude agents (Codex, Kiro, etc.), inject writes to PTY stdin + dropbox.
106
119
107
-
**Do NOT use `--initial-prompt` on `kild create` or `kild open`.**The `--initial-prompt`flag has unreliable delivery for fleet sessions. Always create/open first, then inject separately.
120
+
**Do NOT use `--initial-prompt` on `kild create` or `kild open`.**This flag is deprecated and will be removed in a future release. Always create/open first, wait for the agent to initialize, then inject separately.
108
121
109
122
**Never use `kild stop` to deliver messages.** Stopping kills the agent process.
110
123
@@ -279,53 +292,36 @@ These files contain project-specific rules like forbidden file zones, required r
279
292
280
293
## Memory
281
294
282
-
### On startup — orient yourself
283
-
```bash
284
-
cat ~/.kild/brain/state.json 2>/dev/null # Last known fleet state
cat .kild/wave-plan.json 2>/dev/null # Pending wave plan
288
-
```
295
+
Your persistent memory is managed automatically by Claude Code at `~/.claude/agent-memory/kild-brain/MEMORY.md`. The first 200 lines are injected into your context on every startup. Use Read/Write/Edit tools to update it directly — no bash commands needed.
> "There's a wave plan from {planned_at} with {N} kilds. Say 'start the wave' to execute, or 'plan a new wave' to replace it."
299
+
**One-time migration:** If `~/.kild/brain/knowledge/MEMORY.md` exists and your auto-memory is empty, read the old file and copy relevant content to your auto-memory. Then note that migration is complete.
292
300
293
-
### After significant events — log
301
+
### Session Logging
302
+
303
+
After significant events, log to the daily session file:
Worker: <branch> | Decision: <what you decided> | Action: <what you did>
299
308
EOF
300
-
301
-
# Fleet snapshot after major changes
302
-
kild list --json >~/.kild/brain/state.json
303
309
```
304
310
305
-
### Your brain — persistent memory
311
+
### On Startup
306
312
307
-
`~/.kild/brain/knowledge/MEMORY.md` is your long-term memory. It persists across restarts and sessions. This is where you store things you've learned so future-you remembers them:
308
-
309
-
- Project patterns: "kild project X has slow CI, allow 10min for checks"
310
-
- Worker quirks: "codex agents need explicit test commands, they don't auto-run tests"
311
-
- Conflict history: "sessions/ and git/ modules conflict frequently, never wave together"
Copy file name to clipboardExpand all lines: .claude/skills/kild-brain/SKILL.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,26 @@ case "$STATUS" in
43
43
echo"Honryū is already running."
44
44
;;
45
45
stopped)
46
-
kild open honryu --resume --initial-prompt "You've been restarted by the Tōryō. Orient yourself: check kild list --json, ~/.kild/brain/state.json, today's session log, and .kild/wave-plan.json (if it exists, mention it). Then greet the Tōryō and summarize the fleet state."
47
-
echo"Honryū restarted."
46
+
kild open honryu --resume
47
+
echo"Waiting for Honryū to initialize..."
48
+
sleep 5
49
+
if kild list --json 2>/dev/null | jq -e '.sessions[] | select(.branch == "honryu" and .status == "active")'>/dev/null 2>&1;then
50
+
kild inject honryu "You've been restarted by the Tōryō. Orient yourself: check kild list --json, today's session log, and .kild/wave-plan.json (if it exists, mention it). Then greet the Tōryō and summarize the fleet state."
51
+
echo"Honryū restarted."
52
+
else
53
+
echo"Warning: honryu session not active after 5s. Run: kild inject honryu \"...\" once it starts.">&2
54
+
fi
48
55
;;
49
56
*)
50
-
kild create honryu --daemon --main --agent claude --yolo --note "Honryū fleet supervisor" --initial-prompt "You are Honryū, the KILD fleet supervisor. You have just been initialized by the Tōryō. Orient yourself: run kild list --json, read ~/.kild/brain/state.json, today's session log, and .kild/wave-plan.json if they exist. If a wave plan exists, mention it. Then greet the Tōryō and report fleet state. You are running on the main branch — do not create worktrees for yourself."
if kild list --json 2>/dev/null | jq -e '.sessions[] | select(.branch == "honryu" and .status == "active")'>/dev/null 2>&1;then
61
+
kild inject honryu "You are Honryū, the KILD fleet supervisor. You have just been initialized by the Tōryō. Orient yourself: run kild list --json, check today's session log, and .kild/wave-plan.json if they exist. If a wave plan exists, mention it. Then greet the Tōryō and report fleet state."
62
+
echo"Honryū initialized."
63
+
else
64
+
echo"Warning: honryu session not active after 5s. Run: kild inject honryu \"...\" once it starts.">&2
0 commit comments