<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh" -->

---
title: 26 Tool Calls, One Script, $0.02: Measuring “Code Mode”...
description: A production measurement of &#x27;code mode&#x27; — the pattern of running multiple tool calls inside a sandboxed script rather than sequentially in an agent&#x27;s context....
canonical: https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: 26 Tool Calls, One Script, $0.02: Measuring “Code Mode” in Production | daily.dev
og:description: A production measurement of &#x27;code mode&#x27; — the pattern of running multiple tool calls inside a sandboxed script rather than sequentially in an agent&#x27;s context....
og:url: https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh
og:image: https://api.daily.dev/og/posts/bLm59RZBh.png
og:image:alt: 26 Tool Calls, One Script, $0.02: Measuring “Code Mode” in Production
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 26 Tool Calls, One Script, $0.02: Measuring “Code Mode” in Production

**[Hacker News](https://daily.dev/sources/hn)** · 11 min read · 0 upvotes · 0 comments

## Summary

A production measurement of 'code mode' — the pattern of running multiple tool calls inside a sandboxed script rather than sequentially in an agent's context. Using a real workflow-triage script that makes 26 underlying API calls, the team measured a ~126x reduction in characters reaching the agent's context (25,811 vs ~3.26M), cutting cost from ~$2.44 to ~$0.02 per run on Claude Sonnet 5. The post details exactly what was measured vs. extrapolated, includes the full script source, and prices the token savings across five current LLM models. The core insight: intermediate tool results that stay inside the execution environment never inflate the model's context window.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.agent-swarm.dev/blog/code-mode-token-savings>

## Similar posts on daily.dev

- [Claude Code Sends 4.7x More Tokens Than OpenCode Before Reading Your Prompt](https://daily.dev/posts/claude-code-sends-4-7x-more-tokens-than-opencode-before-reading-your-prompt-9m02iom1z) · Hacker News · 6 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"26 Tool Calls, One Script, $0.02: Measuring “Code Mode” in Production","url":"https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh"},"datePublished":"2026-07-23T11:42:01.804Z","dateModified":"2026-07-23T11:42:58.208Z","description":"A production measurement of 'code mode' — the pattern of running multiple tool calls inside a sandboxed script rather than sequentially in an agent's context....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cc976ea6c2524957a20efd3d72724f96?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cc976ea6c2524957a20efd3d72724f96?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/26-tool-calls-one-script-0-02-measuring-code-mode-in-production-blm59rzbh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,mcp","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"26 Tool Calls, One Script, $0.02: Measuring “Code Mode” in Production"}]}
```

