context-management

context-management is a skill for Claude Code, Codex from jonathan-vella/apex-accelerator. It costs 101 tokens per session (1,287 once invoked), scanned A, original, MIT.

A context-management guide for shortening large files or conversations so an AI agent can keep working within its input limit, and for reviewing context-use logs afterward.

In plain words
What is it for?
Use it to choose full, summarized, or minimal versions of large artifacts, or audit agent logs for repeated content and poor hand-offs.
Why use it?
It reduces wasted context and helps agents avoid losing important information when handling large artifacts or long workflows.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to choose full, summarized, or minimal versions of large artifacts, or audit agent logs for repeated content and poor hand-offs.

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

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-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/jonathan-vella/apex-accelerator/context-management.svg)](https://agentmods.dev/skills/jonathan-vella/apex-accelerator/context-management)
Your own site
<a href="https://agentmods.dev/skills/jonathan-vella/apex-accelerator/context-management"><img src="https://agentmods.dev/badge/skills/jonathan-vella/apex-accelerator/context-management.svg" alt="Measured on agentmods" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,287 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00101 $0.01287
Opus 5 $0.00051 $0.00643
Sonnet 5 $0.00020 $0.00257
Haiku 4.5 $0.00010 $0.00129

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

Security

Grade A, and why

context-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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/parse-chat-logs.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.github/skills/context-management/SKILL.md · 134 lines

How it starts

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

Context Management Skill

Unified context-window management with two distinct lifecycles:

  • Runtime Compression — what an agent does before loading a large artifact to stay under the model context limit (during workflow execution).
  • Diagnostic Audit — what the 11-Context Optimizer agent does after the fact to find waste in agent definitions, instructions, and skill loads.

The two modes do not depend on each other — pick the section that matches your need.


Mode A: Runtime Compression

Replaces the legacy context-shredding skill.

When to Use Runtime Compression

  • Before loading a predecessor artifact file (01 through 07)
  • When conversation length suggests >60% of model context is used
  • When an agent needs to load multiple large artifacts

Compression Tiers

Tier Context Usage Strategy
full < 60% Load entire artifact — no compression
summarized 60-80% Load key H2 sections only
minimal > 80% Load decision summaries only (< 500 chars)

Hard Token Checkpoints

Percentages are advisory; absolute input-token counts override them. GPT-5.6-Terra and Luna hard-checkpoints at ≥300K input; Claude Opus 5 at ≥160K. When hit, emit a compaction message and switch every further read to the minimal tier. Full per-model table, checkpoint procedure (4 steps), and background context (nordic-foods saturation event) in references/hard-checkpoints.md.

Rules

  1. Estimate context usage — count approximate conversation tokens
  2. Select tier based on the thresholds above
  3. Apply compression template from references/compression-templates.md
  4. If loading multiple artifacts, compress the older / less-critical ones first

Steps

1. Estimate current context usage (rough: 1 token ≈ 4 chars)
2. Check model limit (Claude family: 200K, GPT-5 family: 400K)
3. Calculate usage percentage and check hard-checkpoint table
4. Select tier:
   < 60%  → full (no compression needed)
   60-80% → summarized (key sections only)
   > 80%  → minimal (decision summaries only)
5. Load artifact/skill using the appropriate variant

Read the full file on GitHub · 134 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. 4d ago First seen · 134 lines · 101 tokens per session scan A be649ba39e41

Subscribe to this mod's changes

context-management is a skill published in the GitHub repository jonathan-vella/apex-accelerator (50 stars, last pushed today), licensed MIT. It adds 101 tokens to every session and 1,287 once invoked, about $0.0005 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.