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 agentmods add skills/aragaobruno/toolbelt/context-compactornpx skills add aragaobruno/toolbelt --skill context-compactorgit clone --depth 1 https://github.com/aragaobruno/toolbeltWrote 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/aragaobruno/toolbelt/context-compactor)<a href="https://agentmods.dev/skills/aragaobruno/toolbelt/context-compactor"><img src="https://agentmods.dev/badge/skills/aragaobruno/toolbelt/context-compactor.svg" alt="Measured on agentmods" 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 | $0.00034 | $0.00432 |
| Opus 5 | $0.00017 | $0.00216 |
| Sonnet 5 | $0.00007 | $0.00086 |
| Haiku 4.5 | $0.00003 | $0.00043 |
Grade A, and why
context-compactor 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.
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.
What it actually says
📦 context-compactor
Overview
Feeding raw source files into an LLM context window is expensive and introduces noise. The context-compactor recursively scans a codebase, parses files (supporting Python, JavaScript, and TypeScript), and extracts only the structural elements—classes, methods, function signatures, and docstrings—while omitting the actual body implementations.
This results in a lightweight, token-efficient structural map of your codebase that agents can use to understand the architecture without reading thousands of lines of code.
Quick Start
To scan the current directory and generate a codebase map:
uv run skills/context/context-compactor/scripts/compactor.py C:\Users\araga\.gemini\antigravity\scratch\toolbelt --output map.txt
Utility Scripts
compactor.py (CLI)
A Python utility that recursively processes directories and extracts structural code elements.
- Arguments:
<directory_path>(Required)--output(Required): The file path where the output will be saved.--exclude(Optional): Glob patterns to exclude (e.g.,*.test.js,node_modules).
- Example:
uv run compactor.py C:\Users\araga\.gemini\antigravity\scratch\toolbelt --output codebase_summary.txt --exclude "node_modules,*.spec.js"
Output Format Example
For a Python file, the compactor will extract:
File: auth.py
----------------------------------------
class Authenticator:
"""Manages user sessions and OAuth flows."""
def __init__(self, client_id: str):
...
def get_token(self, code: str) -> str:
"""Exchanges authorization code for an access token."""
...
What ships with it
2 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.
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.
- 4d ago First seen · 49 lines · 34 tokens per session scan A 6df8a0c71e55
context-compactor is a skill published in the GitHub repository aragaobruno/toolbelt (2 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 432 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-08-31.
Other skills, from other repositories
build-personal-brain
Create, resume, validate, connect, or maintain a private cross-project memory for AI assistants. Use when a person asks to build a personal memory from local work folders and past assistant conversations, continue an interrupted memory audit, connect an existing memory to another local assistant, verify that the…
why
Explain the provenance, authority, expiry, degradation state, and token accounting of CIGAR context already presented in this session.
checkpoint
Create an inspectable CIGAR checkpoint before compaction, interruption, or a meaningful task boundary.
handoff
Prepare a clean cross-session handoff so the next agent can pick up where you left off. Writes a focused continue.md in the active slice dir and ensures STATE.md + summary artifacts are current. Use when asked to "hand off", "prepare handoff", "pause work", "bookmark this", "I'll come back to this later", before…
user-general-facts
Capture and organize general facts about the user by topic.
10-learn
Capture durable project learnings. Use when the user wants to remember, record, or formalize a decision, convention, lesson, pitfall, reusable workflow, or review finding. Not for preferences or temporary notes.