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 khalilbenaz/claude-skills-collection --skill context-managergit clone --depth 1 https://github.com/khalilbenaz/claude-skills-collectionWrote 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/khalilbenaz/claude-skills-collection/context-manager)<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/context-manager"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/context-manager/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/khalilbenaz/claude-skills-collection/context-manager"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/context-manager.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00084 | $0.02408 |
| Opus 5 | $0.00042 | $0.01204 |
| Sonnet 5 | $0.00017 | $0.00482 |
| Haiku 4.5 | $0.00008 | $0.00241 |
Grade A, and why
context-manager 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 11d 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 — 271 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Context Manager
Quand utiliser ce skill
- L'agent retourne
context_length_exceededou une erreur 413/400 équivalente - Les coûts de tokens dépassent le budget prévu
- Tu conçois un agent avec sessions multi-tours longues ou documents volumineux
- Tu dois implémenter une mémoire persistante entre sessions
Fenêtres de contexte de référence (2026)
| Modèle | Fenêtre | Prompt cache natif |
|---|---|---|
| Claude 3.7 Sonnet | 200 k tokens | Oui (Anthropic API) |
| GPT-4o | 128 k tokens | Oui (OpenAI API) |
| Gemini 2.0 Flash | 1 M tokens | Oui (Google AI) |
| Llama 3.3 70B | 128 k tokens | Non (self-hosted) |
Workflow en 10 étapes
1. Cartographier le budget par couche
Avant tout code, décompose la fenêtre en couches fixes et dynamiques :
Fenêtre totale = 200 000 tokens
├── System prompt (fixe) ~ 2 000 (1 %)
├── Descriptions d'outils (fixe) ~ 3 000 (1.5 %)
├── Mémoire long terme ~ 5 000 (2.5 %)
├── Contexte RAG injecté ~ 20 000 (10 %)
├── Historique conversation ~ 40 000 (20 %)
├── Réponse réservée ~ 10 000 (5 %)
└── Marge sécurité (10 %) ~ 20 000
Définis deux seuils : alerte 80 % (log warning), action 90 % (compression obligatoire).
2. Compter les tokens précisément
# OpenAI / tiktoken
import tiktoken
enc = tiktoken.encoding_for_model("gpt-4o")
n_tokens = len(enc.encode(text))
# Anthropic SDK
import anthropic
client = anthropic.Anthropic()
response = client.messages.count_tokens(
model="claude-sonnet-4-5",
system=system_prompt,
messages=messages,
)
print(response.input_tokens) # total exact avant envoi
Appelle le comptage avant chaque appel API, pas après. C'est le seul moyen de gérer proactivement.
3. Choisir la stratégie de contexte
| Situation | Stratégie recommandée |
|---|---|
| Conversation courte, budget abondant | Verbatim — rien à faire |
| Historique long mais requêtes récentes dominantes | Sliding window |
| Documents volumineux, requête ponctuelle | RAG dynamique |
| Sessions très longues (agent autonome multi-jours) | Résumé progressif + LTM externe |
| Coût critique (prod haute volumétrie) | Prompt caching + compression agressive |
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.
- 11d ago First seen · 271 lines · 84 tokens per session scan A 0909f37d48e7
context-manager is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 17d ago), licensed MIT. It adds 84 tokens to every session and 2,408 once invoked, about $0.0004 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-08-30.
Other skills, from other repositories
long-context
Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques. Use when processing long documents (32k-128k+ tokens), extending pre-trained models beyond original context limits, or implementing efficient positional encodings. Covers rotary embeddings, attention biases…
edgartools
Python library for accessing, analyzing, and extracting data from SEC EDGAR filings. Use when working with SEC filings, financial statements (income statement, balance sheet, cash flow), XBRL financial data, insider trading (Form 4), institutional holdings (13F), company financials, annual/quarterly reports (10-K…
Vizra ADK Memory System
Implement persistent memory, session context, and vector memory (RAG) for AI agents.
rag-patterns
RAG: embeddings, chunking, hybrid search (BM25+vector), reranking, CRAG, multi-hop. Triggers: RAG, embedding, pgvector, Qdrant, Pinecone, Weaviate, reranker, semantic search.
evaluate
Evaluates RAG retrieval and LLM-as-judge metrics (faithfulness, relevancy, context precision). Triggers: measure RAG quality, knowledge gap, RAG eval, golden dataset.
explain
Explains code/architecture with Mermaid diagrams and sequence flows. Triggers: what does X do, how does Y work, explain code, sequence diagram.