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.
npx skills add charlieviettq/awesome-agent-skill --skill context-window-managementgit clone --depth 1 https://github.com/charlieviettq/awesome-agent-skillWrote 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.
[](https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/context-window-management)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
- Do not load — use search/read targeted files only.
- Reference — pointers (paths, line ranges) instead of full paste.
- Summarize — compress completed work; keep decisions and open items.
- 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:
- Objective block — one paragraph: goal, non-goals, done-when
- Constraint block — versions, env, files off-limits
- Reference map — paths to spec, ADR, or ticket; load on demand
- 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.
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.
- 7d ago First seen · 75 lines · 40 tokens per session scan A d773957bbaae
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.
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.
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.
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.
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.
continuous-learning-construction
Automatically extract patterns, best practices, and reusable knowledge from construction automation sessions to improve future performance.
agent-memory-mcp
A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).