> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qredence.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Refinement (`packages/coding-agent/src/core/refinement/`)

> Self-improving harness (/refine) reviews trajectory and applies evidence-backed updates to supplemental harness state (packages/coding-agent/src/core/refinement/). Never rewrites the immutable...

Self-improving harness (`/refine`) reviews trajectory and applies evidence-backed updates to supplemental harness state (`packages/coding-agent/src/core/refinement/`). Never rewrites the immutable base system prompt. Snapshot mechanism supports rollback. Compaction (`packages/coding-agent/src/core/compaction/`) trims context (`compact`, `calculateContextTokens`, `prepareBranchEntries`) to stay within model context window.

Related: [Compaction](/fleet-prime-agent/packages--coding-agent--session-runtime), [Skills](/fleet-prime-agent/packages--coding-agent--skills)
