Skip to content

# Context compaction reloads system prompt and project instructions, wasting ~20k tokens #2472

Description

@865x44

Problem

After the session triggers context compaction, the system prompt and project-level instructions (e.g., AGENTS.md, skills, environment context) appear to be reloaded from scratch. This costs a significant number of tokens (~20k in observed cases) even though the information itself has not changed.

Steps to reproduce

  1. Start a Kimi Code CLI session in a project with a large AGENTS.md / skill set.
  2. Work until context compaction is triggered.
  3. Observe that the system prompt and project instructions are re-injected/reloaded instead of being preserved.

Expected behavior

Context compaction should prune transient conversation history while keeping immutable or unchanged context (system prompt, project instructions, skills) pinned, so it does not need to be re-sent and re-billed.

Actual behavior

The system prompt and project instructions are reloaded after compaction, causing unnecessary token usage.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions