agentsclimarketplace

Context window management

Skill charlieviettq/awesome-agent-skill/.cursor/skills/ai-agent-systems/context-window-management

Curated skill pack for LLM agents in engineer and science workflow (Cursor & Claude ready).

Install
npx -y skills add charlieviettq/awesome-agent-skill --skill context-window-management

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Manage LLM context budgets—prioritization, summarization, compaction, and what to load vs reference. Use for long sessions, large repos, or multi-doc tasks. Triggers: "context window", "too long", "summarize context", "token budget".

SKILL.md

2.4 KB, as published. Nobody here has run it

Context window management

Lifecycle

PhaseAction
BootstrapLoad spec, constraints, key paths only—not whole repo
During taskAppend deltas; replace full file reads with summaries after use
Before compactionWrite Session state block (objective, done, open, paths)
Session endDrop tool noise; keep decisions and verification evidence

Strategy order

  1. Do not load — use search/read targeted files only.
  2. Reference — pointers (paths, line ranges) instead of full paste.
  3. Summarize — compress completed work; keep decisions and open items.
  4. Drop — remove obsolete tool output and duplicated content.

What to keep in active context

  • Current objective and acceptance criteria
  • Constraints (env, versions, "do not touch")
  • Recent errors and fixes
  • Open questions

What to offload

  • Full file contents already summarized
  • Long command outputs (keep exit code + last N lines)
  • Exploratory branches that did not ship

Compaction pattern

## Session state (compacted)
Objective: ...
Done: ...
Open: ...
Key paths: ...
Do not repeat: [list already-established facts]

Multi-file work

  • Load one module at a time when possible.
  • Prefer ripgrep/semantic search over dumping trees.
  • For RAG: retrieve only top-k relevant chunks.

Anti-patterns

  • Pasting entire repos or logs into chat.
  • Re-explaining architecture every turn without delta.
  • Keeping failed attempts at full length after resolution.

Session setup (context engineering)

Before long tasks, establish a minimal working set:

  1. Objective block — one paragraph: goal, non-goals, done-when
  2. Constraint block — versions, env, files off-limits
  3. Reference map — paths to spec, ADR, or ticket; load on demand
  4. Tool policy — which tools/skills apply; avoid loading unused skill bodies

Refresh the objective block after major pivots; do not re-paste full history.

Pairing

Use with rag-systems for external knowledge; clarify-underspecified when scope grows mid-session; interview-me before loading large specs.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.