Skip to content

[v2.0] Context rot protocol — CONTEXT.md compression and session archiving #6

Description

@FredAntB

Context

CONTEXT.md currently grows unbounded. A session log with 30+ entries
becomes noise rather than signal, and eventually contributes to context
rot rather than preventing it. GSD's context isolation approach maintains
first-hour quality into the third hour — our current implementation doesn't
reach that bar for large projects.

Goal

CONTEXT.md should actively compress older session history so the file
stays useful rather than becoming a liability.

Proposed work

  • Add compression rule to SKILL.md session management section:
    when session log exceeds 10 entries, summarise sessions 1-(N-5)
    into a single ## Archived summary paragraph and move them to
    CONTEXT_ARCHIVE.md
  • Add CONTEXT_ARCHIVE.md template to references/templates.md
  • Add a ## Token budget section to CONTEXT.md template — estimated
    token cost of current context so agents can self-regulate
  • Add SKILL.md rule: if CONTEXT.md exceeds 2,000 tokens, trigger
    compression before proceeding
  • Research GSD's context rotation mechanism for reference
  • Add Phase 2A assertions for compression rule presence in SKILL.md
  • Add Phase 2B test: session with 15-entry log → compression triggered

Success condition

A project with 20+ sessions maintains clean, usable context throughout
without the CONTEXT.md file becoming a token drain.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2.0Issues queued for the next version

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions