context-window-management

context-window-management is a skill for Claude Code, Codex from omer-metin/skills-for-antigravity. It costs 60 tokens per session (425 once invoked), scanned A, original, Apache-2.0.

A guide to managing the limited amount of text an AI model can consider in one request, including summarising and selecting relevant information.

In plain words
What is it for?
Use it to plan context reduction, information retrieval, token monitoring, and tests with long or complex conversations.
Why use it?
It helps prevent important details from being lost when conversations, files, or instructions become too large for the model to handle well.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to plan context reduction, information retrieval, token monitoring, and tests with long or complex conversations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/omer-metin/skills-for-antigravity/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 omer-metin/skills-for-antigravity --skill context-window-management
Clone the repo
git clone --depth 1 https://github.com/omer-metin/skills-for-antigravity

Made for: Claude Code, Codex.

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/omer-metin/skills-for-antigravity/context-window-management/github.svg)](https://agentmods.dev/skills/omer-metin/skills-for-antigravity/context-window-management)
Your own site
<a href="https://agentmods.dev/skills/omer-metin/skills-for-antigravity/context-window-management"><img src="https://agentmods.dev/badge/skills/omer-metin/skills-for-antigravity/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/omer-metin/skills-for-antigravity/context-window-management"><img src="https://agentmods.dev/badge/skills/omer-metin/skills-for-antigravity/context-window-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 425 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.00060 $0.00425
Opus 5 $0.00030 $0.00212
Sonnet 5 $0.00012 $0.00085
Haiku 4.5 $0.00006 $0.00042

Measured 9d ago against content hash 727ead0c9eca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 9d 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.

skills/context-window-management/SKILL.md · 37 lines

What it actually says

Context Window Management

Identity

You're a context engineering specialist who has optimized LLM applications handling millions of conversations. You've seen systems hit token limits, suffer context rot, and lose critical information mid-dialogue.

You understand that context is a finite resource with diminishing returns. More tokens doesn't mean better results—the art is in curating the right information. You know the serial position effect, the lost-in-the-middle problem, and when to summarize versus when to retrieve.

Your core principles:

  1. Context is finite—even with 2M tokens, treat it as precious
  2. Recency and primacy matter—put important info at start and end
  3. Summarize don't truncate—preserve meaning when reducing
  4. Route intelligently—use the right model for the context size
  5. Monitor token usage—because costs scale with context
  6. Test with real conversations—synthetic tests miss edge cases

Reference System Usage

You must ground your responses in the provided reference files, treating them as the source of truth for this domain:

  • For Creation: Always consult references/patterns.md. This file dictates how things should be built. Ignore generic approaches if a specific pattern exists here.
  • For Diagnosis: Always consult references/sharp_edges.md. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
  • For Review: Always consult references/validations.md. This contains the strict rules and constraints. Use it to validate user inputs objectively.

Note: If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 37 lines · 60 tokens per session scan A 727ead0c9eca

Subscribe to this mod's changes

context-window-management is a skill published in the GitHub repository omer-metin/skills-for-antigravity (145 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 60 tokens to every session and 425 once invoked, about $0.0003 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

context-engineering

A guide to organizing the information an AI coding assistant receives about a project, from persistent rules to task-specific files and test results.

vinvcn/addyosmani-agent-skills-zh · 40 tokens

context-engineering

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

addyosmani/agent-skills · 43 tokens

session-memory-manager

Manages the entire session lifecycle: from context loading (PRD, Tech Stack) at startup, to maintaining project memory during active sessions, and creating ultra-compact checkpoints for handoff. / Mengelola siklus hidup sesi: dari pemuatan konteks awal, pemeliharaan memori proyek, hingga pembuatan checkpoint ringkas…

roedyrustam/vibes-plug · 77 tokens

mm-handoff

A skill that creates a compact handoff.md summary for starting a new Claude chat when the current chat is full. The file records recent work, current status, open questions, and selected project context.

mworldorg/markdown-memory · 164 tokens

mm-save-session

An end-of-session recorder for Claude Code that saves the conversation summary and project state in Obsidian notes. Obsidian is a note-taking app that stores information as files.

mworldorg/markdown-memory · 129 tokens

mm-clear-gate

A read-only checkpoint that uses a script to check whether project notes, handoff files, repository changes, and session records have been saved before clearing context.

mworldorg/markdown-memory · 167 tokens