Skip to main content

Module prompt

Module prompt 

Source
Expand description

Anchored summary prompt template for compaction.

The compaction LLM is asked to produce a structured summary using the anchored summary format. When a previous compaction exists, the model is instructed to update it rather than regenerate from scratch.

Ported from OpenCode V1/V2:

  • packages/core/src/session/compaction.ts (V2 anchored summary template)
  • packages/opencode/src/agent/prompt/compaction.txt (V1 compaction agent prompt)

Functionsยง

build_prompt
Builds the full compaction prompt from messages to summarise and an optional previous summary for incremental updates.