<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp" -->

---
title: Why Claude Code Burns Tokens | daily.dev
description: Claude Code often burns far more tokens than necessary because it defaults to verbose Python scripts instead of concise bash commands, and dumps full output...
canonical: https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why Claude Code Burns Tokens | daily.dev
og:description: Claude Code often burns far more tokens than necessary because it defaults to verbose Python scripts instead of concise bash commands, and dumps full output...
og:url: https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp
og:image: https://api.daily.dev/og/posts/n76uR2MdP.png
og:image:alt: Why Claude Code Burns Tokens
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.

# Why Claude Code Burns Tokens

**[Medium](https://daily.dev/sources/medium_js)** · 11 min read · 0 upvotes · 0 comments

## Summary

Claude Code often burns far more tokens than necessary because it defaults to verbose Python scripts instead of concise bash commands, and dumps full output into the conversation context. A concrete example shows a duplicate-file finder taking 20 lines of Python vs. one bash line, and verbose output generating 137,000 tokens vs. 3 tokens for a summary. The post also covers tokenizer behavior (code is denser per character than English, non-Latin scripts like Hebrew cost ~5x more), and why code-golfing is counterproductive. The author built an open-source skill/plugin that enforces token-efficient patterns automatically: prefer built-in tools (Grep/Glob), then bash, then Python; return summaries not raw data; and save large outputs to files.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@shimonmoyal/why-claude-code-burns-tokens-d26138f024d2>

## Questions this post answers

### Why does Claude Code use so many tokens on simple file system tasks?

Claude Code's underlying harness often writes verbose Python scripts with logging and full output printing instead of using lean built-in tools or bash commands. A task like finding duplicate files can take twenty lines of Python versus one bash one-liner using find, md5sum, sort, and uniq, and printing full results instead of a summary can push a single command from about 3 tokens to roughly 137,000 tokens.

_Developers tuning agent workflows for cost track practical token-saving techniques like this on daily.dev._

### How many characters per token do bash, Python, and English text average?

English text averages about 4.7 characters per token, Python code about 4.1 characters per token, and a bash line about 2.9 characters per token, using a standard (non-Claude-specific) tokenizer. Because code syntax like brackets and camelCase gets split into many small tokens, dense bash commands end up cheaper overall despite being less character-efficient per character than English.

_Anyone optimizing prompts and agent scripts for token cost can follow tokenizer behavior comparisons like this on daily.dev._

### Does minifying or golfing code actually save tokens when using an AI coding agent?

Not proportionally. Golfing code into single-letter names and no whitespace cut character count by 48% in one test but only reduced token count by 25%, because it optimizes the wrong metric. Dense golfed code is also harder for the agent to read and can hurt bug detection, so slightly more verbose but clear code without unnecessary ceremony like comments or argparse tends to work better for throwaway scripts.

_Teams writing agent-facing scripts weigh trade-offs like this by following token-efficiency techniques on daily.dev._

## Similar posts on daily.dev

- [7 ways I make Claude Code use fewer tokens without hurting the results](https://daily.dev/posts/7-ways-i-make-claude-code-use-fewer-tokens-without-hurting-the-results-s1mmfwq7r) · XDA Developers · 1 upvotes · 0 comments
- [Why use so many tokens when a few do the trick?](https://daily.dev/posts/why-use-so-many-tokens-when-a-few-do-the-trick--uvekb2vuw) · Product Hunt · 4 upvotes · 1 comments
- [GitHub - drona23/claude-token-efficient: Universal CLAUDE.md - cut Claude output tokens by 63%. Drop-in. No code changes.](https://daily.dev/posts/github---drona23-claude-token-efficient-universal-claude-md---cut-claude-output-tokens-by-63-drop-cba3nnscu) · Hacker News · 3 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#ai-agents](https://daily.dev/tags/ai-agents), [#claude-code](https://daily.dev/tags/claude-code), [#bash](https://daily.dev/tags/bash), [#context-engineering](https://daily.dev/tags/context-engineering)

[View this post on daily.dev](https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp)

```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":"Why Claude Code Burns Tokens","url":"https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp"},"datePublished":"2026-07-21T08:07:17.283Z","dateModified":"2026-09-13T20:04:58.365Z","description":"Claude Code often burns far more tokens than necessary because it defaults to verbose Python scripts instead of concise bash commands, and dumps full output...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/79f0b913d1ee95a0717b6f4a2ffb7b61?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/79f0b913d1ee95a0717b6f4a2ffb7b61?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","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":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,ai-agents,claude-code,bash,context-engineering","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Why Claude Code Burns Tokens"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/why-claude-code-burns-tokens-n76ur2mdp#faq","mainEntity":[{"@type":"Question","name":"Why does Claude Code use so many tokens on simple file system tasks?","acceptedAnswer":{"@type":"Answer","text":"Claude Code's underlying harness often writes verbose Python scripts with logging and full output printing instead of using lean built-in tools or bash commands. A task like finding duplicate files can take twenty lines of Python versus one bash one-liner using find, md5sum, sort, and uniq, and printing full results instead of a summary can push a single command from about 3 tokens to roughly 137,000 tokens. Developers tuning agent workflows for cost track practical token-saving techniques like this on daily.dev."}},{"@type":"Question","name":"How many characters per token do bash, Python, and English text average?","acceptedAnswer":{"@type":"Answer","text":"English text averages about 4.7 characters per token, Python code about 4.1 characters per token, and a bash line about 2.9 characters per token, using a standard (non-Claude-specific) tokenizer. Because code syntax like brackets and camelCase gets split into many small tokens, dense bash commands end up cheaper overall despite being less character-efficient per character than English. Anyone optimizing prompts and agent scripts for token cost can follow tokenizer behavior comparisons like this on daily.dev."}},{"@type":"Question","name":"Does minifying or golfing code actually save tokens when using an AI coding agent?","acceptedAnswer":{"@type":"Answer","text":"Not proportionally. Golfing code into single-letter names and no whitespace cut character count by 48% in one test but only reduced token count by 25%, because it optimizes the wrong metric. Dense golfed code is also harder for the agent to read and can hurt bug detection, so slightly more verbose but clear code without unnecessary ceremony like comments or argparse tends to work better for throwaway scripts. Teams writing agent-facing scripts weigh trade-offs like this by following token-efficiency techniques on daily.dev."}}]}
```

