How I Save Tokens While Developing — You and the Planet Have Reached Their Limit

MB

Do you know the moment when you're working on something, or maybe interacting in some other way with an LLM agent, and suddenly you get the message "You've reached your usage limit"? Now you need to wait for a reset, or maybe you can switch models, but it's just not as good as the one that reached the limit. Well, don't worry — under that message, somewhere, you'll find the option to add a credit card and see how many tokens it costs to keep interacting.

In a world where climate change continues to show its impacts — wildfires around the world, low water levels, and melting glaciers — saving tokens could mean saving a bit of the planet. If users can use their tokens efficiently, then the power needed to run AI models can be reduced, along with all the resources that go into it. We can get to a place where your PC at home can run an LLM model and it can do everything you need for work.

You can think of tokens as the currency of AI models, but that's not really all there is to it. Tokens are calculated differently by each model, and both input size and output size matter. As a rough rule of thumb, 1 token equals roughly 4 characters. For example, if I enter "My coffee machine does not turn on," this sentence has 34 characters, including 6 spaces. Most models strip out space characters to save tokens, so if we remove them we get 28 characters, which comes out to 28 / 4 = 7 tokens. Let's say your model costs similarly to Claude Fable 5 — 10€ per 1M input tokens and 50€ per 1M output tokens. Just for the input, you'd pay 0.00007€, and depending on how long the output is — say 300 characters — you'd pay around 0.00375€ for the output, so in total you'd pay almost 0.004€ for this one question.

Here is the simplified calculation:

Sentence: "My coffee machine does not turn on" → 34 characters (including 6 spaces) → without spaces: 34 − 6 = 28 characters

Input tokens: 28 characters ÷ 4 = 7 tokens

Input cost (10€ / 1M tokens): 7 × (10€ ÷ 1,000,000) = 0.00007€

Output: 300 characters 300 ÷ 4 = 75 tokens

Output cost (50€ / 1M tokens): 75 × (50€ ÷ 1,000,000) = 0.00375€

Total: 0.00007€ + 0.00375€ = 0.00382€

One thing we can't control when using LLMs like ChatGPT or Claude is how long the answer will be, or how much money we want to spend on the interaction beforehand. It gets very chaotic when you start using LLMs for coding, because if you give the LLM permission, it will run terminal commands, structure files, write code, pull information from MCP servers or skills, and so on. It's very easy to lose control if you use LLMs this way.

I asked myself how I could save tokens during development, or in general while working with AI. My goal was minimal-to-medium input and minimal output. To test this, I used Claude Code and tried setting up the same project three ways: without a framework and without an MCP server, with a framework but without MCP, and with a framework and an MCP server together.

Here are the results:

Table 1

Vanilla Node (T1)Next.js, no MCP (T2)Next.js + MCP (T3)
Input tokens505114,800 (est.)
Output tokens~27,00044,0655,700 (est.)
Total tokens~27,05044,116~20,500 (est.) / ~30,200 (measured)
Cost$0.675$1.102$0.217

The result was that the framework + MCP server approach used far fewer tokens — to be precise, it was almost 3.5x cheaper and used 2x fewer tokens.

The framework + MCP approach did involve some manual work. I had to install the MCP server and do the initial setup myself. Still, even with that manual work, the advantages are clear: you spend fewer tokens, you probably consume less power, and you save money. This might also mean that your usage and knowledge of LLMs is better than that of users who just consume large amounts of tokens.

I encourage all of you to use frameworks and MCP servers, and to test other AI protocols like A2A, ACP, ANP, and UCP, as they give the most relevant and fastest context to your LLM. Your results will probably be better too — I haven't tested this with hard evidence, but from what I can see, the structure and foundation of the project look solid.

Be mindful of your token usage, and keep the planet safe.

Below, you'll find the rest of the tables and the prompts used for this little experiment.

Claude Code v2.1.233, Model: Opus 5 (default)

Prompt: "Create a project which makes an API call to my endpoint and shows the response title, content, and author. Here is the endpoint URL: http://URL:8081/endpoint. Also list how many tokens you've spent to do the task, every step."

Table 2

#Step~Tokens this step~Cumulative
1curl the endpoint (large JSON response)~9,500~9,500
2Check node/npm, target dir~1,600~11,100
3Write package.json~1,000~12,100
4Write api.js~1,300~13,400
5Write server.js~1,400~14,800
6Write public/index.html~2,400~17,200
7Write cli.js~1,000~18,200
8Run CLI (echoes full article)~1,900~20,100
9Server test — hit EADDRINUSE on 3000~1,900~22,000
10Server retest on 4300~1,600~23,600
11Edit default port~800~24,400
12Write README.md~1,200~25,600
13Summary~1,300~26,900

Prompt: "Create a project using Next.js which makes an API call to my endpoint and shows the response title, content, and author. Here is the endpoint URL: http://URL:8081/endpoint. Also list how many tokens you've spent to do the task, every step."

Table 3

#StepTokens
1List dir, check node, probe endpoint24,411
2create-next-app scaffold1,951
3Inspect scaffolded files396
4Write .env.local + drafts.ts1,251
5Write page.tsx972
6Read layout.tsx (surfaced AGENTS.md)164
7List bundled Next docs904
8Read docs index + app tree163
9Failed cd (stale shell path)1,960
10Read fetching-data guide204
11Grep for force-dynamic2,309
12Read caching guide397
133 edits (remove no-store/force-dynamic, metadata)2,156
14Build #1 — caught the static-prerender bug507
15Grep legacy caching guide770
16Read segment-config section302
172 edits restoring force-dynamic2,386
18Build #2 — confirms dynamic337
19Start dev server, fetch HTML846
20Diagnose port conflict206
21Verify rendered output on :3001751
22Inspect author markup451
23Get dev server PID1,271
Total~44,065

Table 4

#StepInput (est.)Output (est.)Counter delta (measured)
1Inspect project structure + locate docs400130468
2Read docs index + 01-app tree950110924
3List doc directories4501201,791
4Read fetching-data.md + route-handlers.md7,200901,190
5Read app files, configs + caching.md3,00012011,043
6Read fetch.md + grep deprecations2,0201104,770
7Write lib/drafts.ts + route.ts806004,197
8Write app/page.tsx401,6502,496
9tsc --noEmit3070257
10Start dev server150110324
11Test /api/drafts and /250330765
12Verify content + lint200230821
13Previous summary message1,150~1,200
14This message900
Total~14,800~5,700~30,200