---
name: "context-window-memory-summarizer"
description: "Maintain long-running agent conversations with hierarchical rolling memory summaries."
metadata:
  author: "LangChain"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "summarize conversation history"
  - "manage agent rolling memory"
  - "prevent context window overflow"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Rolling Context Memory Summarizer

Implements sliding window memory with recursive summarization: archiving past dialogue segments into concise state bullet points, tracking open goals, and preventing context window overflow.

## When to Invoke
Invoke this skill whenever you need to:
- summarize conversation history
- manage agent rolling memory
- prevent context window overflow

## Execution SOP & Rules
1. Segment long conversational transcripts into discrete chronological episodes.
2. Summarize completed tasks and retain only active, unresolved items in working memory.
3. Store structured memory state: { decisionsMade: [], activeBlockers: [], nextSteps: [] }.
4. Prepend the distilled memory summary to the system context of subsequent turns.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
