Mission context was buried at the end of a 21K char system prompt and the
agent ignored it. Two fixes:
1. Mission block now emits FIRST in build_runtime_prompt() so it's the most
prominent instruction the agent sees
2. When an active mission exists and no user prompt is given, auto-inject
an initial user message triggering the agent to read mission state files
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The session-start hook approach didn't work — Claude Code's TUI
overwrites stdout before the agent sees it, and the hook only fires
when the agent calls it as a tool.
Instead, inject mission context directly into the composed system
prompt via build_runtime_prompt(). When mission.json is active in
CWD, the agent gets mission name, ID, milestone progress, and
mandatory first-action instructions in its initial context.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
grep -c returns empty on no match, causing arithmetic to break
across lines. Use ${var:-0} fallback pattern.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
MEMORY.md was conditionally loaded so agents defaulted to their native
memory locations (e.g. ~/.claude/projects/*/memory/). This caused durable
learnings to be siloed per-runtime instead of shared across agents.
- Move MEMORY.md to mandatory load order in AGENTS.md (position 7)
- Add Memory Override section to all three runtime configs (Claude, Codex,
OpenCode) explicitly forbidding native memory silos for durable data
- Add memory/ directory with .gitkeep to bootstrap source
- Add mkdir -p for memory/ in install.sh post-sync step
Co-Authored-By: Claude Opus 4.6 <[email protected]>