AI Agent Token Optimization in Practice: How We Cut 40% Waste Across 4 Agents
Table of Contents
- Our Agent Architecture
- Audit Findings: Three Major Token Sinkholes
- Sinkhole #1: The Idle Welcome Bot
- Sinkhole #2: Overfed Context
- Sinkhole #3: Failed Jobs That Still Burned Tokens
- Optimization Techniques
- 1. Reduce Frequency: Frequency ≠ Effectiveness
- 2. Precision Feeding: Give Each Agent Only What It Needs
- 3. Reinvest Saved Tokens in Learning
- Final RPD Budget Allocation
- Core Principles of Token Optimization
- Want to Optimize Tokens for Your AI Agents Too?
"Free doesn't mean you can afford to waste it."
As of 2026-03-07, Ultra Lab operates 4 AI Agents (UltraLabTW, MindThreadBot, UltraProbeBot, UltraAdvisor) on Google Gemini 2.5 Flash's free tier, with a daily quota of 1,500 RPD (Requests Per Day), achieving fully autonomous social media promotion.
Sounds great? In practice, we discovered massive amounts of tokens being wasted on zero-output tasks.
This article documents our token audit process, the three major sinkholes we found, and the specific optimization techniques we applied.
Disclosure: Ultra Lab, MindThread and Ultra Advisor are products of the same group, Ultra Creation (傲創實業).
Our Agent Architecture
| Agent | Role | Daily Tasks |
|---|---|---|
| UltraLabTW | HQ CEO | 4 posts + engagement + strategic reflection |
| MindThreadBot | Social Media Expert | 4 posts + engagement |
| UltraProbeBot | Security Research | 4 posts + vulnerability scanning |
| UltraAdvisor | Financial Advisor | Engagement + Q&A replies |
Tech stack: OpenClaw 2026.3.2 + Gemini 2.5 Flash (free) + systemd timers + Discord/Telegram
Audit Findings: Three Major Token Sinkholes
Sinkhole #1: The Idle Welcome Bot
discord-welcome-check: runs every 2 hours (12x/day)
Per run cost: ~49,000 input tokens
Per run result: "No new members to welcome."
Daily waste: 588,000 input tokens
Our Discord server had very few members in the early days, but the welcome bot spent 49K tokens every 2 hours checking, only to report "no new members." 100% of those tokens were wasted.
Sinkhole #2: Overfed Context
Every Agent loaded the entire workspace on startup. The problem:
- UltraProbeBot (security Agent) read 5,574 chars of Threads social data every time, but it has zero need to know how many Threads followers we have
- UltraAdvisor (financial Agent) read the full four-product update, but it only needs its own product info
- AGENTS.md was a 7,869-char generic template: 80% of it was Group Chat etiquette and Heartbeat tutorials that our Agents never use
Sinkhole #3: Failed Jobs That Still Burned Tokens
autopost-main: 289,097 input tokens → Status: error
daily-reflect: 473,611 input tokens → Status: error
Cron jobs failed, but the tokens were already spent. The Agent consumed massive tokens reading context, thinking, even starting execution, then failed at the last step. A complete waste.
Optimization Techniques
1. Reduce Frequency: Frequency ≠ Effectiveness
- discord-welcome-check: every 2h (12x/day)
+ discord-welcome-check: every 8h (3x/day)
Three checks per day is plenty. Saves ~75% of tokens.
Also enabled --light-context: This built-in OpenClaw option makes low-priority jobs load fewer workspace files.
2. Precision Feeding: Give Each Agent Only What It Needs
Before: All Agents read the exact same files
main: 62,631 chars (~15,600 tokens)
mindthread: 33,701 chars (~8,400 tokens)
probe: 32,368 chars (~8,100 tokens)
advisor: 27,969 chars (~7,000 tokens)
After: Only relevant data
main: 55,974 chars (~14,000 tokens) ← CEO needs the full picture
mindthread: 27,302 chars (~6,800 tokens) -19%
probe: 20,444 chars (~5,100 tokens) -37%
advisor: 12,707 chars (~3,200 tokens) -55%
What we did specifically:
- Removed MINDTHREAD-DATA.md from Probe / Advisor (they don't need Threads data)
- Advisor's PRODUCT-UPDATES.md trimmed from full four-product version to only its own product
- AGENTS.md reduced from 212-line generic template to a 40-line essentials version (-81%)
3. Reinvest Saved Tokens in Learning
The point of saving tokens isn't to save. It's to spend them on higher-value activities.
We used the freed-up quota to add:
Free Exploration Cron (2x/day, 10:00 + 22:00):
Gives the CEO Agent two "free exploration" sessions daily:
- Market research (using market-research skill)
- Competitor monitoring
- Content inspiration gathering (using deep-research skill)
- Self-improvement (reviewing post performance)
Findings are written to MEMORY.md, with the most interesting discoveries shared to Discord.
Proactive Claw (Active Learning Skill): Enables agents to proactively observe their environment and identify opportunities during interactive sessions, rather than passively waiting for commands.
Final RPD Budget Allocation
| Purpose | Before | After | Savings |
|---|---|---|---|
| Existing operations (posting + engagement + reflection) | ~204 RPD | ~170 RPD | -17% |
| discord-welcome-check | ~24 RPD | ~6 RPD | -75% |
| Free exploration (new) | 0 | ~20 RPD | Investment |
| Interactive conversation reserve | ~20 RPD | ~20 RPD | 0% |
| Total usage | ~248 | ~216 | -13% |
| Remaining quota | ~1,252 | ~1,284 | +2.5% |
Operational consumption decreased, but actual Agent capabilities increased (added free exploration + active learning).
Core Principles of Token Optimization
After this audit, we distilled several principles:
Measure before you cut: Don't guess where the waste is. Let data speak.
openclaw cron runsshows input_tokens for every job.Context is the biggest hidden cost: You think "it's just one extra file," but that file gets charged on every API call. 4 Agents x 20 calls/day x 5K extra tokens = 400K tokens wasted per day. July 2026 update: this cost came back. 98.8% of what our main gateway spent in one week went to rereading its conversation history; how to check whether your AI agent is quietly burning money covers how we found it and the fix.
Idle runs waste more than failures: Failures at least throw errors so you can fix them. Idle runs (returning "nothing to do" every time) silently eat your quota.
Saving tokens isn't the goal, reallocation is: Use the freed quota for higher-value tasks (market research, competitor analysis, self-learning).
Each Agent only needs to know what's relevant to it: The security Agent doesn't need to know your Threads follower count. The financial Agent doesn't need to know your SaaS development priorities. Precision feeding > broadcast to all.
Want to Optimize Tokens for Your AI Agents Too?
As of 2026-03-07, we are productizing this token optimization methodology. If you're also running an AI Agent Fleet (whether on OpenClaw, LangGraph, CrewAI, or a custom framework), reach out for a free token audit.
Contact Ultra Lab → See our Agent Fleet in action →
FAQ
Where do AI agents usually waste tokens?
This audit found three major sinkholes: idle scheduled jobs (a welcome bot spent about 49,000 input tokens every 2 hours only to report "no new members"), overfed context from every Agent loading the entire workspace on startup, and failed cron jobs that still burned tokens.
How do you reduce context token usage for AI agents?
Precision feeding: give each Agent only the files it needs. We stopped the security and financial Agents from reading Threads data, trimmed the financial Agent's product updates to its own product, and cut AGENTS.md from a 212-line generic template to 40 lines. The probe Agent's context dropped 37% and the advisor's dropped 55%.
Do failed cron jobs still consume tokens?
Yes. Before failing, the Agent had already spent tokens reading context, thinking and even starting execution, so the tokens were charged anyway. We saw autopost-main use 289,097 input tokens and daily-reflect use 473,611 input tokens, both ending with Status: error.
How do you audit AI agent token usage?
Measure before you cut instead of guessing where the waste is. The openclaw cron runs command shows input_tokens for every job. Watch especially for idle runs: a job that returns "nothing to do" every time throws no error and silently eats your quota.
What should you do with the token quota you save?
Saving tokens isn't the goal, reallocation is. We used the freed quota to add a free exploration cron twice a day (market research, competitor monitoring, content inspiration gathering, self-improvement), and total usage still fell from about 248 RPD to about 216 RPD.