mcpField
C
context-window-management

context-window-management

github.com/archieindianAgent workflows7465 installsUpdated 26w ago
Repository

About context-window-management

context-window-management is an Agent skill for reducing irrelevant context in long sessions. It offers summarization, externalizing reference material, and clean restarts, while recording the chosen strategy and task state.

Key features

  1. 01Summarize completed work
  2. 02Move reference material to files
  3. 03Restart with a handoff document
  4. 04Record strategy and task state

Use cases

  1. 01Address slower or less coherent long sessions
  2. 02Remove context from completed tasks
  3. 03Keep large documents outside the context

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/archieindian/openclaw-superpowers --skill context-window-management

After installing, type/context-window-managementin Claude Code to confirm it loaded.

Bundled filesSTATE_SCHEMA.yaml

Details

From the project README

Context Window Management

State file: ~/.openclaw/skill-state/context-window-management/state.yaml

Warning Signs

  • Session running for many hours
  • Responses getting slower or less coherent
  • Carrying context about completed tasks no longer relevant
  • Large code blocks in context not being actively used
  • Check last_compacted_at in state — if compacted recently this session, prefer a lighter strategy

Reduction Strategies

Summarize Completed Work

Replace detailed context about finished tasks with short summaries. After: write state strategy_used: summarize, current_task, last_compacted_at.

Externalize Reference Material

Move large docs/schemas to files. Reference them by filename rather than including in context. After: write state strategy_used: externalize, current_task, last_compacted_at.

Clean Session Restart

Write comprehensive handoff document, start fresh session, load only what's needed. After: write state strategy_used: clean_restart, handoff_path, current_task, last_compacted_at.

What to Keep in Context

  • Current task objective
  • Current step being executed
  • Relevant code being modified (just the parts in scope)
  • Recent error messages if debugging

What to Offload

  • Completed task details (summarize to memory)
  • Full file contents of files not currently being edited
  • Conversation history from different topics hours ago
  • Reference docs that can be re-read on demand

Comments

Markdown supported