context-window-management

context-window-management is a skill for Claude Code from charlieviettq/awesome-agent-skill. It costs 40 tokens per session (544 once invoked), scanned A, original, MIT.

A set of practices for managing how much information an AI assistant keeps in its working context during a long or document-heavy task.

In plain words
What is it for?
Use it to prioritize relevant material, summarize completed work, track session state, and reduce unnecessary context.
Why use it?
It helps prevent important instructions from being lost when a session, repository, or collection of documents becomes large.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to prioritize relevant material, summarize completed work, track session state, and reduce unnecessary context.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/charlieviettq/awesome-agent-skill/context-window-management
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add charlieviettq/awesome-agent-skill --skill context-window-management
Clone the repo
git clone --depth 1 https://github.com/charlieviettq/awesome-agent-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-window-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/context-window-management/github.svg)](https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/context-window-management)
Your own site
<a href="https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/context-window-management"><img src="https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/context-window-management/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-window-management

Your own site · 80×15
<a href="https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/context-window-management"><img src="https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/context-window-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 544 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.00544
Opus 5 $0.00020 $0.00272
Sonnet 5 $0.00008 $0.00109
Haiku 4.5 $0.00004 $0.00054

Measured 7d ago against content hash d773957bbaae, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

context-window-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/context-window-management/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context window management

Lifecycle

Phase Action
Bootstrap Load spec, constraints, key paths only—not whole repo
During task Append deltas; replace full file reads with summaries after use
Before compaction Write Session state block (objective, done, open, paths)
Session end Drop 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.

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 75 lines · 40 tokens per session scan A d773957bbaae

Subscribe to this mod's changes

context-window-management is a skill published in the GitHub repository charlieviettq/awesome-agent-skill (25 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 544 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

learn-from-fix

Capture Elixir/Ecto/LiveView lessons and Hex API rules. Use after corrections or when asked to document learning, record a lesson, prevent a fixed mistake, or remember package guidance with --library.

oliver-kriska/claude-elixir-phoenix · 46 tokens

recall

Recall prior work from past sessions — how a bug was fixed, what was decided, where a pattern lives. Use when asked 'have we done this before' or 'how did I fix X' in Elixir/Phoenix work. ccrider MCP when available, else git + solution docs.

oliver-kriska/claude-elixir-phoenix · 64 tokens

assigns-audit

Inspect LiveView socket assigns for memory bloat — missing temporaryassigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporaryassigns.

oliver-kriska/claude-elixir-phoenix · 47 tokens

compound-docs

Searchable Elixir/Phoenix/Ecto solution documentation system with YAML frontmatter. Builds institutional knowledge from solved problems. Use when consulting past solutions before investigating new issues.

oliver-kriska/claude-elixir-phoenix · 38 tokens

continuous-learning-construction

Automatically extract patterns, best practices, and reusable knowledge from construction automation sessions to improve future performance.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 24 tokens

agent-memory-mcp

A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

lingxling/awesome-skills-cn · 26 tokens