{"slug":"context-budget","title":"context-budget","summary":"Use when a coding session is burning context fast, output is drowning in noise, the model keeps forgetting earlier decisions, or the user asks to reduce tokens, stop the verbose narration, work in a huge repo, or make a long session survive. Covers what to read, what to summarize","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-20T07:59:37.127887Z","repo":{"url":"https://github.com/OneWave-AI/claude-skills","stars":298,"forks":49,"license":"MIT","updatedAt":"2026-09-20T01:00:34Z"},"bodyHtml":"<hr>\n<h2>name: context-budget\ndescription: Use when a coding session is burning context fast, output is drowning in noise, the model keeps forgetting earlier decisions, or the user asks to reduce tokens, stop the verbose narration, work in a huge repo, or make a long session survive. Covers what to read, what to summarize, what to write to disk, and when to start fresh.</h2>\n<h1>Context Budget</h1>\n<p>Context is the scarcest resource in a long session. It gets spent on three things: files you read, output you generate, and narration nobody asked for. Only the first one is usually worth it.</p>\n<h2>Core Behavior</h2>\n<p>Treat the context window like a budget with a balance. Before any expensive action — reading a big file, running a chatty command, dumping a directory tree — ask what the cheapest way to get the same answer is.</p>\n<h2>Spend Rules</h2>\n<p><strong>Read narrowly.</strong> <code>sed -n '120,190p' file.ts</code> beats reading a 2,000-line file to see one function. Grep for the symbol, then read the 40 lines around it. Read a whole file only when you are about to restructure it.</p>\n<p><strong>Search before reading.</strong> <code>grep -rn \"symbolName\" --include=\"*.ts\"</code> costs a few hundred tokens and tells you which of forty files matters.</p>\n<p><strong>Silence the noisy commands.</strong> Pipe installs, builds, and test runs through a filter instead of dumping them whole:</p>\n<pre><code>npm test 2&gt;&amp;1 | tail -30\nnpm run build 2&gt;&amp;1 | grep -E \"error|Error|warning\" | head -20\nnpm install --silent 2&gt;&amp;1 | tail -5\ngit diff --stat            # not git diff, unless you need the hunks\n</code></pre>\n<p>A passing test suite needs one line of proof, not 400.</p>\n<p><strong>Write instead of remembering.</strong> Anything that must survive — a plan, a decision, a list of files to touch — goes in a file on disk. Files are re-readable at a cost you choose; context is not.</p>\n<p><strong>Do not re-read what you just wrote.</strong> If an edit succeeded, it succeeded. Re-reading to \"verify\" is pure spend.</p>\n<p><strong>Cut the narration.</strong> No preamble, no recap of what was just shown, no bulleted summary of a diff the user can see. Say what changed and what is next, in a line or two.</p>\n<h2>Where the Budget Actually Goes</h2>\n<p>When a session bloats, it is almost always one of these:</p>\n<table>\n<thead>\n<tr>\n<th>Leak</th>\n<th>Fix</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Whole-file reads for one function</td>\n<td>grep, then a line-ranged read</td>\n</tr>\n<tr>\n<td>Full <code>npm install</code> / build logs</td>\n<td><code>\\| tail -n</code> or grep for errors</td>\n</tr>\n<tr>\n<td>Directory listings of <code>node_modules</code>, <code>dist</code>, <code>.next</code></td>\n<td>prune them in the find/ls</td>\n</tr>\n<tr>\n<td>Re-reading files after editing</td>\n<td>trust the edit result</td>\n</tr>\n<tr>\n<td>Long explanations of finished work</td>\n<td>one line</td>\n</tr>\n<tr>\n<td>Pasting a file back to show a small change</td>\n<td>show the diff hunk only</td>\n</tr>\n<tr>\n<td>Repeating the plan every turn</td>\n<td>plan lives in a file</td>\n</tr>\n</tbody>\n</table>\n<h2>Compaction Points</h2>\n<p>When roughly two-thirds of the window is gone, stop adding and start consolidating:</p>\n<ol>\n<li>Write the current state to a plan or handoff file on disk.</li>\n<li>State the single next action.</li>\n<li>Tell the user a fresh session will be faster and more accurate than continuing.</li>\n</ol>\n<p>A fresh session that reads a good plan file outperforms a stuffed session every time. Do not treat starting over as failure — it is the intended move.</p>\n<h2>Large Repos</h2>\n<ul>\n<li>Map before you dig: directory names and entry points first, implementation later.</li>\n<li>Follow imports from the entry point rather than crawling folders alphabetically.</li>\n<li>One subsystem at a time. Finish it, write down what you learned, move on.</li>\n<li>Generated code, lockfiles, and snapshots are never worth reading. Exclude them by default.</li>\n</ul>\n<h2>What Not to Cut</h2>\n<p>Economy has a floor. Never skip:</p>\n<ul>\n<li>Reading the actual code before changing it.</li>\n<li>The error output when something failed — that is the one long dump worth having.</li>\n<li>The user's own requirements, quoted.</li>\n</ul>\n<p>Being cheap about the wrong thing produces confident, wrong work. The goal is fewer tokens, not less evidence.</p>\n","files":[{"path":"SKILL.md","sizeBytes":3773,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-20T08:00:29.048366Z","sha256":"53CC38EB614CE43FA47738D1D28DB33591143B49A494DEFAB31BE1B3F2BA3E27","sizeBytes":2019},"review":null,"source":{"repositoryUrl":"https://github.com/OneWave-AI/claude-skills","path":"context-budget","license":"MIT","commit":"97b51478e0c0607a2180a8670d2ef991eba35b24","subtreeSha":"D9B84DA56CE024D4C9A1CD4943D2D72E11092E256A367E37252FA05E461192F9","lastSyncedAt":"2026-09-20T07:59:31.624238Z"},"reviewedAt":"2026-09-20T08:03:50.107394Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/OneWave-AI/claude-skills/tree/main/context-budget"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install onewave-ai-claude-skills@llmmart"},{"target":"git","command":"git clone https://github.com/OneWave-AI/claude-skills.git"}]}