# You may be spending more tokens on context gathering than writing code

_Published September 9, 2026_

**By [Sergio Bergmann](https://mesmer.co/resources/author/sergio)**

**Section:** Playbook

**Series:** [Agentic OS](https://mesmer.co/resources/series/agentic-os) — part 2 of 7, published weekly

---

We've helped many eng orgs cut their token spend without reducing usage our output. Inefficient context gathering is a HUGE sink. Here are the most common issues we find and the fixes we're applying.

* Problem 1 - A single big instruction file: Your context should be loaded by scope. This means having a short file at the root (the common heuristic is a root file of roughly 100 lines), and one per ecosystem. Rules scoped to paths, which load only when you touch those paths. Deeper material pulled in on demand.

  Here's ours as an example: root `CLAUDE.md` at 256 lines, plus 219 for frontend and 246 for backend, then 22 path-scoped rules that auto-load only on matching files, and 53 skills that load only on invocation. An agent editing one backend service reads a fraction of the total.

* Problem 2 - Loading long form context: You should set-up a context firewall around anything that reads a large artifact. CI logs, a whole-PR diff, a broad grep, etc. should instead run in a subagent that returns a compact conclusion. The big read happens once, in a window you throw away, and you work with the valuable, compacted pieces.

* Problem 3 - Paying to wait: If you're seeing messages from your agents checking into your PRs periodically, you're wasting a lot of tokens in each turn. Specially if you're using more expensive models. Our PR watcher polls with a zero-token shell script and only spends model tokens when a signal actually fires.

* Problem 4 - Inaccurate context files: Take maintenance of context files seriously. Every session that reads an incorrect instruction will pay to discover the mistake and then improvise.

* Problem 5 - One size fits all ceremonies: Planning depth, review depth, verification depth should all proportional to what the change can break.

To identify where most work is needed, compare your token expenditure per repository. If two repos in which you're doing similar amounts of work differ drastically, the worse one off may be running into some of the above.

---

## Agentic OS — part 2 of 7

1. [Golden standard for agent readiness: treat agents as new hires](https://mesmer.co/resources/agent-readiness-first-feature-test)
2. You may be spending more tokens on context gathering than writing code — this part

**Previous:** [Golden standard for agent readiness: treat agents as new hires](https://mesmer.co/resources/agent-readiness-first-feature-test)

---

Canonical: https://mesmer.co/resources/context-gathering-token-spend
