---
title: How I Cut My Coding-Agent Token Bill by 90%
description: Coding-agent tokens add up fast when the harness ships 33k of overhead before your prompt. Here's the context hygiene that cut my bill without hurting output.
canonical: https://lukeocodes.dev/coding-agent-tokens
type: article
locale: en_GB
published: 2026-09-04T00:00:00.000Z
modified: 2026-09-04T00:00:00.000Z
authors:
  - Luke Oliff
section: Developer Experience
tags:
  - Developer Experience
  - AI
  - tokens
  - claude code
  - cost
  - agents
  - context
feed: https://lukeocodes.dev/rss.xml
search: https://lukeocodes.dev/search.json?q={query}
schema:
  - "@context": https://schema.org
    "@graph":
      - "@type": WebSite
        "@id": https://lukeocodes.dev/#website
        url: https://lukeocodes.dev
        name: Luke Oliff
        alternateName: lukeocodes
        inLanguage: en
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
        description: Personal blog and writing by Luke Oliff — developer relations, voice AI, developer experience.
        potentialAction:
          - "@type": SearchAction
            target:
              "@type": EntryPoint
              urlTemplate: https://lukeocodes.dev/blog/search?q={search_term_string}
            query-input: required name=search_term_string
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
  - "@context": https://schema.org
    "@graph":
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
      - "@type": BlogPosting
        "@id": https://lukeocodes.dev/coding-agent-tokens#article
        headline: How I Cut My Coding-Agent Token Bill by 90%
        alternativeHeadline: How I Cut My Coding-Agent Token Bill by 90%
        description: Coding-agent tokens add up fast when the harness ships 33k of overhead before your prompt. Here's the context hygiene that cut my bill without hurting output.
        datePublished: 2026-09-04T00:00:00.000Z
        dateModified: 2026-09-04T00:00:00.000Z
        url: https://lukeocodes.dev/coding-agent-tokens
        mainEntityOfPage: https://lukeocodes.dev/coding-agent-tokens
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: Developer Experience, AI, tokens, claude code, cost, agents, context
        articleSection: Developer Experience
        about:
          - "@type": SoftwareApplication
            name: Claude Code
          - "@type": Thing
            name: Developer Experience
        abstract: Most coding-agent tokens go on harness overhead and stale context, not on your actual task. Scoping context, clearing often, routing mechanical work to cheaper models, and picking a lean harness cut my bill by around 90% with no drop in quality.
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/og.png?h=How+I+Cut+My+Coding-Agent+Token+Bill+by+90%25&d=Coding-agent+tokens+add+up+fast+when+the+harness+ships+33k+of+overhead+before+your+prompt.+Here%27s+the+context+hygiene+that+cut+my+bill+without+hurting+output.&e=Writing
        wordCount: 536
        timeRequired: PT3M
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
      - "@type": BreadcrumbList
        itemListElement:
          - "@type": ListItem
            position: 1
            name: Home
            item: https://lukeocodes.dev
          - "@type": ListItem
            position: 2
            name: Writing
            item: https://lukeocodes.dev/blog
          - "@type": ListItem
            position: 3
            name: How I Cut My Coding-Agent Token Bill by 90%
            item: https://lukeocodes.dev/coding-agent-tokens
      - "@type": FAQPage
        "@id": https://lukeocodes.dev/coding-agent-tokens#faq
        mainEntity:
          - "@type": Question
            name: Where do coding-agent tokens actually go?
            acceptedAnswer:
              "@type": Answer
              text: "Mostly on context you didn't think about: system-prompt and tool-definition overhead, re-read files, and stale conversation history carried turn to turn. A public analysis in 2026 showed one popular harness sending about 33,000 tokens before it even reads your prompt, versus roughly 7,000 for a leaner one."
          - "@type": Question
            name: Does trimming context hurt output quality?
            acceptedAnswer:
              "@type": Answer
              text: Done right it improves it. Models degrade with long, noisy context, so a tight, relevant window often gives better answers and costs less. The trick is scoping to the files and facts the task needs, not dumping the whole repo in and hoping.
          - "@type": Question
            name: What single change helped most?
            acceptedAnswer:
              "@type": Answer
              text: Clearing context between unrelated tasks. A fresh session for each distinct problem stops you paying to re-send a growing transcript on every turn. After that, routing mechanical edits to a cheaper model was the next biggest win.
---

[Luke Oliff.](/)

- [Blog](/blog)
- [CV](/cv)
- [Uses](/uses)
- [User manual](/user-manual)
- [Living with ADHD](/living-and-working-with-adhd)
- [RSS](/rss.xml)

[Luke Oliff · Writing](/blog)

# How I Cut My Coding-Agent Token Bill by 90%

Sep 2026 · [Developer Experience](/blog/category/developer-experience) · 3 min read · [Luke Oliff](/authors/luke)

**TL;DR:** Most coding-agent tokens go on harness overhead and stale context, not on your actual task. Scoping context, clearing often, routing mechanical work to cheaper models, and picking a lean harness cut my bill by around 90% with no drop in quality.

Most of your coding-agent tokens are not spent on your problem. They're spent on overhead, stale history, and files the agent re-reads because nobody told it not to. Once I understood that, cutting my bill by around 90% turned out to be mostly hygiene, not sacrifice.

This one's practical. No axe to grind, just what worked.

## See where the tokens go first

You can't cut what you can't see. When I actually logged the traffic, the split was ugly: a large chunk of every request was scaffolding, not task. That matches what others found in 2026, when a widely-shared [analysis showed one popular agent harness](https://news.ycombinator.com/item?id=48883275) sending roughly 33,000 tokens of overhead before reading the prompt, against about 7,000 for a leaner alternative. Spotify's engineering team reported a tooling change that [cut their coding-agent token usage by about 90%](https://news.ycombinator.com/item?id=49571465), which is the number that made me go looking in the first place.

If your harness lets you inspect requests, do it before you optimise anything. The waste is usually not where you think.

## Scope the context, then clear it

The biggest lever is the dumbest one. Start a fresh session per unrelated task. Every turn you keep, you re-send the whole growing transcript, and you pay for it again. A twenty-turn session isn't twenty small requests, it's twenty increasingly large ones.

Then scope what you load. Point the agent at the three files the change touches, not the repo. Models get *worse* with long noisy context, so a tight window is cheaper and usually smarter. Long context is a cost multiplier disguised as thoroughness.

## Route work to the cheapest model that can do it

Not every step needs your most expensive model. Renaming a symbol, writing a test stub, reformatting a block: that's mechanical, and a cheap fast model does it fine. Save the frontier model for the reasoning-heavy parts. If your tooling supports subagents, push the mechanical steps down to a cheaper tier and keep the expensive one for architecture.

Routing through a gateway helps here too, because you can set a hard price ceiling and fall back to a cheaper host when the expensive one isn't earning its rate.

## Use caching on purpose

Prompt caching is real money if you use it deliberately. Keep the stable part of your context (the system setup, the files that aren't changing) in a cacheable prefix so it bills at the cache-read rate instead of fresh input on every turn. Just know the cache can expire faster than you expect, so a long idle gap between messages can quietly cost you a full re-read.

## Pick a lean harness

The last one is a choice you make once. Harness overhead is a fixed tax on every single request, so a tool that sends 7k of scaffolding instead of 33k saves you on turn one and every turn after. I stopped treating the default as the only option and started weighing the harness by what it sends on my behalf, not just how it feels to use.

Stack these and the 90% isn't dramatic, it's just what happens when you stop paying to re-send context the model didn't need. The task was always the cheap part.

[← Newer: The Case for a .gitignore Allowlist](/gitignore-allowlist)

[All posts](/blog) →

## Search this site

`GET https://lukeocodes.dev/search.json?q=<words>` returns matching posts as JSON, each with its page URL and its markdown URL. Add `&limit=<1-50>` for more than 10. How it works: [/blog/search](https://lukeocodes.dev/blog/search.md).

```sh
curl "https://lukeocodes.dev/search.json?q=developer+relations"
```

---

© 2026 Luke Oliff. Posts live at the root of this site.

- [GitHub](https://github.com/lukeocodes)
- [LinkedIn](https://www.linkedin.com/in/lukeocodes)
- [X](https://x.com/lukeocodes)
- [Bluesky](https://bsky.app/profile/lukeocodes.dev)
- [Email](mailto:luke@lukeoliff.com)
- [RSS](/rss.xml)

## Cookies

This site sets one analytics cookie, from Google Analytics, and only in a browser that accepts the cookie banner. A client that does not run scripts sets no cookies, so there is nothing to accept or decline here.

[Cookie policy](/cookies)
