Skip to main content Announcing Tool Policies: AI agent permissions down to the field Read the announcement
Free tool

AI agent token optimizer: Make your agent faster and cheaper to run

Describe its job and get the fixes that cut its tokens and wait time, ranked for your harness.

Try

We keep what you type to improve this tool.

Or let your agent ask: POST /api/v1/token-optimizer/

Example result

Claude API and Agent SDKZendesk List Tickets

Your agent answers in 0.6 s, not 2.4 min

Same question, answered from a synced copy of your Zendesk data: 50 live calls become 2 reads.1,2

Stacky, StackOne's mascot, with the robot he fixed
Share
Calls and waiting, same clockContext sent with each request
Today50 calls, 72 tools
50 calls · 2.4 min
25K tokens
With fixes2 calls, 2 tools
2 calls · 0.6 s
7.3K tokens · cached
01.2 min2.4 min
SwitchSettingTodayWith fixes
Deep Query50 live calls · 2.4 min2 reads · 0.6 s
Load tools when needed72 tools · 25K tokens2 tools · 7.3K tokens
ModelOpus 5.5 $29 a monthHaiku 5.5 $0.73 a month
ThinkingHigh effortLow effort
Prompt cachePrefix sent freshPrefix cached
Old resultsKept in contextCleared

The fixes, biggest saving first

  1. Deep QueryStackOne50 → 2 calls1

    Data Sync keeps a copy of Zendesk List Tickets, so 5,000 records take 2 reads instead of 50 live calls.

    The live API returns 100 a page.

    Waiting 2.4 min → 0.6 s at production averages; 33% to 74% fewer tokens per connector on 1,345 benchmark tasks.2

    Data Sync on Zendesk List Tickets

  2. Load tools when neededStackOne25K → 7.3K tokens3,4

    72 tool definitions, about 25K tokens, go out with every request before the first word.

    Tool Search was 3.8x cheaper per request than loading every tool across 824 tasks. Anthropic reported over 85% fewer tool-definition tokens with its own tool search.3

    Add https://mcp.stackone.com/mcp; "Load tools when needed" is on by default (Project Settings, General, MCP Settings, or ?tool-mode=search_execute)

  3. Run it on Haiku 5.5$29 → $0.73 a month5,1

    This task doesn't need Opus 5.5.

    Haiku 5.5 for counts and lookups, Sonnet 5.5 for filtering and summarising, Opus 5.5 for multi-step work. This one is counts, totals and lookups, where Deep Query or the API does the work and the model reads one small result, so Haiku 5.5 fits. Check it on your own runs first.

    Over 1,000 runs, the 7.3K tokens of tool definitions per request cost $29 a month on Opus 5.5, $15 on Sonnet 5.5 and $0.73 on Haiku 5.5, at list input prices.

    Claude API and Agent SDK
    model: "claude-haiku-5-5"
  4. Prompt caching

    The same tools and system prompt open every run, so the prefix can be cached.

    Cache hits bill at $0.20 per million tokens on Claude Opus 5.5 and $0.10 on Sonnet 5.5 (0.05x their input price), and $0.01 on Haiku 5.5 (0.1x).5

    Claude API and Agent SDK

    cache_control: {"type": "ephemeral"} after the tools and system prompt

  5. Clear old tool results

    Long sessions keep every old tool result in context.

    Claude API and Agent SDK

    Beta: context_management with clear_tool_uses_20250919, or server-side compaction

  6. Keep live questions liveStackOne

    Keep the live action for questions about one record or the provider's state this minute.

    Your agent

    Keep the live action next to the _s1query tool

  7. Lower the effort setting

    Counting and retrieval rarely need high effort.

    Claude API and Agent SDK

    effort: "low" for high-volume or latency-sensitive work (the default is high, or medium on Opus 5.5 and Haiku 5.5)

  8. Tool PoliciesStackOne

    Narrow which actions and fields the agent can use, per project.

    No token figure: it's a control.

    StackOne

    Tool Policies on the project

5 more we checked
  • CheckTurn off tools you don't useSwitch off servers and tools this agent never calls.
  • CheckCap tool outputWe couldn't confirm a setting for it in Claude API and Agent SDK.
  • Doesn't fitLet the agent run code over results2 calls left, and Anthropic reports no gain on flows of one or two calls.
  • Doesn't fitRead web pages as textYour task doesn't browse the web.
  • Doesn't fitBatch scheduled jobsApplies to scheduled jobs only; your agent answers people live.

Sources

  1. Arithmetic on your inputsEstimated from your inputs
  2. StackOne production averageMeasured by StackOne
  3. StackOne benchmarkMeasured by StackOne
  4. Estimate from a medianEstimated from your inputs
  5. Published list pricePublished by the vendor or in our docs
How we worked this out

This result

  • Zendesk: 72 actions; matched List Tickets (list_tickets, Data Sync available).
  • Records: 5,000, you gave. Runs: 1,000 a month.
  • Calls: 50 live calls at 100 records a page, 2.9 s each in production. Deep Query: 2 reads at 0.3 s.
  • Tool definitions: 25K tokens with every tool loaded, 7.3K with tool search, from our benchmark or its median per tool.
  • Matched by rules over the catalogue. Rules do every calculation.

How every result is worked out

Matching
Your question is matched to connectors and list actions in the catalogue of 640+ connectors, and to the list actions Data Sync can copy. An action has to share a word with your question, so no match is shown rather than an unrelated one.
Live calls
A list action pages through every record a question covers, at the page size its config sets, or 100 when it doesn't say, and the result says which. Each live call takes 2.9 s, the production average over two weeks of traffic.
Deep Query
Two reads, 0.3 s each on average in production: the queryable fields, then the query. Tokens are 33% to 74% lower per connector across 1,345 benchmark tasks. On a single page, the optimizer makes no Deep Query claim.
Tool definitions
Input tokens per request with every tool loaded and with Tool Search are measured per connector on our benchmark of 47 connectors. For other connectors we multiply the action count by the median, about 346 tokens per tool, and mark it as an estimate.
Ranking
A small model may help read your question, but rules decide which fixes apply and do every calculation. Fixes with a sourced number show it; fixes without one say why they apply and show no number. Vendor figures are labelled as the vendor's own.

Benchmark and production figures are explained on the Deep Query page and the Tools Discovery page. Your own systems will differ.

Want us to look at your agent with you?

Go through your harness, your apps and these numbers with our engineers.

What to switch on, by agent type

Pick yours for the three to start with, or open the comparison of all 16 under it.

2

Load tools when needed

Tool Gateway MCP, or the SDK's own tool search.

High impact One setting StackOne

Add https://mcp.stackone.com/mcp; Advanced Tool Search is on by default

3

Prompt caching

cache_control on the Claude API; automatic on OpenAI.

Medium impact One setting

cache_control: {"type": "ephemeral"} after the tools and system prompt

Compare all 16, side by side

YesPartlyNoNot confirmed on the vendor's page Open a technique for what it does and where to read more

Technique Your own agentCoding agentsEnterprise assistantsWorkflow tools
Query instead of paging
Call the _s1query tool over MCP or the API Through the Tool Gateway MCP Through the Tool Gateway MCP n8n's MCP Client Tool; Zapier and Make not confirmed
Keep the live action next to the query tool Keep the live action next to the query tool Keep the live action next to the query tool Keep the live action next to the query tool
Programmatic tool calling on the Claude and OpenAI APIs; Pi codemode Experimental in Claude Code and Codex, on by default in OpenCode Not offered in enterprise assistants Use a code step instead
Load fewer tools
Tool Gateway MCP, or the SDK's own tool search Claude Code and Cursor do it by default One Tool Gateway MCP server exposes two tools One MCP server with Advanced Tool Search in n8n
Filter the tool list per step Disable servers and tools you don't use Copilot Studio and Gemini Enterprise cap tools per agent Zapier suggests 3 to 5 actions per agent
Keep the system prompt short CLAUDE.md under 200 lines; Cursor rules under 500 Keep agent instructions short Keep the agent prompt short
Return less
source on any _s1query call source on any _s1query call source on any _s1query call Where the workflow calls _s1query
Context editing and compaction on the Claude API /compact and automatic compaction Handled by the vendor Runs are short
Reshape results with toModelOutput in the Vercel AI SDK MAX_MCP_OUTPUT_TOKENS, tool_output_token_limit No setting exposed Cap history and output in Make
Text snapshots, or filtered web search and fetch on the Claude API agent-browser or Playwright CLI with a skill The vendor's browsing tool decides Fetch the page as text, not a screenshot
Pay less per token
cache_control on the Claude API; automatic on OpenAI The harness caches for you The vendor caches for you Depends on the model node
Route side tasks to a smaller model model: haiku in a Claude Code subagent The vendor picks the model Pick the model per node
The effort parameter on the Claude API /effort in Claude Code The vendor picks Where the model node exposes it
Message Batches API, 50% off Interactive Interactive Scheduled runs only
Measure and govern
Log input tokens per request /context, /usage, /skill-doctor in Claude Code No per-request view Execution logs show each step
Per project in StackOne Per project in StackOne Per project in StackOne Per project in StackOne

For one harness at a time, with each setting and its source, see the harness guides on usefewertokens.com.

Let your agent run it. Any agent that can make an HTTP request can use the optimizer.

See the prompt
Use StackOne's AI agent token optimizer on my agent.

POST https://www.stackone.com/api/v1/token-optimizer/ with JSON {"task": "[what the agent does, naming the apps]", "segment": "build" | "coding" | "enterprise" | "workflow", "harness": "[for example claude-api, claude-code, copilot-studio, n8n]", "records": [how many records a question covers], "runs_per_month": [number]}, or call the optimize_agent_tokens tool if this browser offers it on stackone.com.

Tell me the lead number, the fixes that apply with the exact setting for my harness, and which inputs were assumptions.

FAQ

Questions about the optimizer
Learn what StackOne can do for you.

Connect your agent once, then cut what it loads.

One Tool Gateway MCP server for 640+ connectors, with Advanced Tool Search and Deep Query.