Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Designs context windows, persistent agent memory, and code retrieval pipelines, measuring and trimming token budgets for AI coding agents.
36% 82%+45 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 8 of 22 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Decide what an agent should have in its context window, what it should keep in persistent memory, and what it should retrieve on demand, then measure and trim the window to fit. The goal is an agent that has the facts it needs for the current step and nothing that crowds them out.
Before designing or analyzing, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
--budget and which packing strategy applies).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
context_analyzer.py on the files or prompt you plan to load. Token counts are estimates (about 4 characters per token); use the provider's token-counting endpoint when you need exact numbers.context_budget_planner.py with the window size and each component's size. It flags components outside their band and, on overflow, lists what to evict first.memory_indexer.py for a quick lexical index; move to embeddings plus code-aware chunking when lexical search misses.context_pruner.py strips comments, docstrings, import blocks and duplicates from code; for Markdown and text it only removes duplicate blocks and extra blank lines, so headings and structure survive.python3 scripts/context_analyzer.py references/ --budget 128000
python3 scripts/context_budget_planner.py --window-size 200000 --system 4000 --history 60000 --tools 90000 --rag 40000 --reserve-output 8000
python3 scripts/context_pruner.py scripts/memory_indexer.py --aggressive
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.