How AIClaw Keeps Agent Plans Out of Chat History with Runtime Plan State AIClaw's Runtime Plan State feature keeps agent plans out of chat history by treating them as runtime state owned by the executor. The system validates, persists, and streams the plan separately from the assistant message, preventing the final answer from being buried under noisy TODO updates. This design enforces a plan lifecycle and injects only a compact summary into each model call to conserve context budget. Most agent products eventually hit the same UX problem: complex tasks need planning, but users do not want the final answer buried under noisy TODO updates. AIClaw handles that with an existing core feature called Runtime Plan State . Instead of storing planning as ordinary assistant text, AIClaw treats the plan as runtime state owned by the executor. The model can propose or revise a plan, but the harness validates it, persists it, streams it live, and links the final snapshot to the assistant message after execution finishes. This post is not announcing a brand-new feature. It is a deeper look at how AIClaw already implements planning in a way that stays useful during execution without polluting the conversation itself. If an agent writes plans directly into chat, several issues show up quickly: AIClaw's approach is to separate these concerns: The repository README describes this directly: AIClaw uses Plan State instead of chat-visible TODO blocks, and streaming chat plus execution logs show the plan separately from the assistant answer. At a high level, AIClaw's execution loop does this: The plan has a small lifecycle instead of being treated like free-form prose: php pending - running - completed - failed - blocked pending - skipped That lifecycle matters because the harness can enforce behavior the model should not be trusted to enforce by itself. In internal/agent/plan.go https://dev.to/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan.go , the internal plan control tool supports actions such as set , update , revise , and read . But the important part is not the tool surface. The important part is ownership: PlanManager normalizes and validates stateThat split keeps the model flexible without giving it full control over task state. For example, AIClaw enforces that only one plan item can be running at a time. The tests in internal/agent/plan test.go https://dev.to/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan test.go explicitly verify that if multiple items are proposed as running , the plan is normalized back to a single running item.One subtle but important implementation detail is that AIClaw does not inject the full plan history into every model call. The PromptBlock path in internal/agent/plan.go https://dev.to/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan.go builds a compact