Original Reddit post

I’ve been noticing with certain projects that Claude Code just absolutely crushes my token usage. Anything gitops related, like managing and applying Ansible / OpenTofu toolkits, specifically when using lots of bash exec, seems to burn about $50 worth of credits in an hour with Opus 5-high. I’ve played around with compression tooks like rtk (rust token killer), lean-ctx, and more recently Headroom. These all definitely help with coding projects (read/edit/modify/test loops), significantly less so with sysadmin type loops (modify Ansible playbooks, run in the lab, fix and repeat). I haven’t yet figured out exactly where the token usage is going. I don’t have too many MCPs or skills loaded, and I don’t see any obvious bash patterns like unbounded recursive find / grep against a large directory. I’ve kept all my jsonl session logs around so I should be able to analyze them and see what the worse offenders were. The couple tools I tried for analyzing session transcripts don’t give me anything finer grained than “bash was 75% of the tool calls” Two things I did notice: Claude’s Auto-mode classifier sends the entire session transcript to Anthropic with every bash call (seems it uses a Haiku model to classify auto mode calls as safe or unsafe). While I know prompt caching should make this cheaper, does anyone find that Auto mode burns tokens significanlty faster than Accept Edits mode? Second thing is that one big difference between read/modify/test loops in gitops vs typical coding is the long wall clock times waiting for things to converge. 15 minutes on average, often waiting for lab hosts to report results, with frequent timeouts. Could this be part of the culprit? What tools do you find actually, measurably reduce token burn consistently? lean-ctx has worked well but its codebase is pretty clearly slop, Headroom looks promising but I haven’t tuned or measured it (and setting the anthropic proxy URL disables /remote-control which is annoying), rtk is cool but it’s fairly limited in what it does. Any pointers or suggestions or stories to share? submitted by /u/dangerousdotnet

Originally posted by u/dangerousdotnet on r/ClaudeCode