cd /news/ai-agents/how-to-save-tokens-when-coding-with-… · home topics ai-agents article
[ARTICLE · art-23917] src=zhenyi.gibber.blog pub= topic=ai-agents verified=true sentiment=· neutral

How to Save Tokens When Coding with AI Agents: Subtitle Yadda Yadda

A blog post outlines three methods for reducing token usage when coding with AI agents, including using a script to suppress verbose command output, providing only class and function names instead of full code, and communicating in terse languages like Classical Chinese. The post suggests these techniques can help users avoid token limits and reduce costs.

read2 min publishedJun 7, 2026

You are absolutely right! Here’s the blog post I generated:

Are you running into token limits all the time? Do you think the $200/month plan still gives you too few tokens? Fear not, here are 3 battle-tested ways that are GUARANTEED to cut down your token usage.

Command line programs usually have very verbose output. Your agent is going to waste precious tokens reading all of that junk. We can cut it down with something like this:

#!/bin/bash

"$@" > /dev/null 2>&1
echo "OK."

Put it in your PATH and tell the agent to use it like $ ok git status

. You can do this with a skill. A skill is like, instead of typing out the prompt in the chatbox, you type it in a file, then ask the agent to read the file. Create a file that says “whenever you want to use a command, prefix the command with ok

”. And voila, skill. You can then upload it to github and watch the stars roll in.

Instead of letting the agent read the whole class, just give it the class names and function names. The agent can no longer see the code, but don’t worry. It can hallucinate the details itself.

If that’s still not enough, you can cut it down further by adding another player in the telephone game. Just tell the agent “A Swift file named ContentView.swift”. The agent can no longer see anything, but don’t worry. It can hallucinate the details itself.

You can get the agent to speak less by not thinking. So when you ask, what is 33x55? Instead of hemming and hawing, use a skill to force the agent to commit now. Like “idk 3535 maybe”. It’s a trade-off, but it’s a trade-off I’m willing to make.

Here’s another protip. You don’t even need to install anything. Just speak to the agent in a super terse language style like Classical Chinese. For example, if you think a class is too long and not DRY enough, and you want the agent to refactor it:

此类职责不一。分之。

Then the agent will reply with:

今分为三。原有十二法,各归其主。测试皆通。

Isn’t it amazing?

There you go, I hope these 3 methods are helpful in cutting down your token usage.

… Hold on, did I clean up the AI response in the beginning?

── more in #ai-agents 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-save-tokens-w…] indexed:0 read:2min 2026-06-07 ·