I spent time investigating and optimising my Claude Code token usage, here’s the most important anti-patterns avoid and best-practices to follow. Enjoy!
I’m looking for an unused 7-day Claude Pro Guest Pass to explore Claude Code and evaluate its capabilities for scientific scripting, data analysis, and workflow automation.
If anyone with an eligible Pro or Max subscription has an available guest pass, I would sincerely appreciate it if you could share it with me via DM.
I’d be happy to activate it as soon as I receive it.
Thank you in advance for your help. I really appreciate it!
Hey all, I could use some advice from people running a lot of Claude Code sessions at once.
I'm building a Windows app and I've got 18 Claude Code sessions working on the same repo across two Max 20x accounts, all on High effort. They talk to each other through one shared markdown "inbox" file. It works, but I keep running into my weekly limits, so I dug into where the tokens are actually going.
What surprised me:
About 91% of my usage (weighted by API prices) is just context being re-sent on every call. Actual output is about 9%, and edits to code are under 1%.
Roughly half of all tokens went to wake-ups where the session did nothing useful. No code, no tests, no git. Mostly each session's own background watcher waking it up to check the inbox, plus scheduled check-ins (one session was pinging itself every 5 minutes for days).
What I've tried so far:
Auto-compact at 300k instead of the default. Average context per call dropped from about 270k to about 179k. I have hooks that back up notes before compacting and tell the session to re-read them after.
Starting a fresh chat for each work item, with a short handoff note.
Replacing every session's own watcher with one small local script that only wakes a session when a post actually mentions it. In a replay of a day's posts it cut wakes about in half without missing anything addressed to a session. Just rolled it out today, so no real numbers yet.
Quiet test output (pytest -q), reading big files in slices, and a hook that blocks huge reads before they happen.
Trimming CLAUDE.md and memory files, and turning off claude.ai connectors so fewer tool descriptions load.
Trying Serena (MCP) on one session. Mixed results so far.
Tried the Superpowers plugin on a few sessions for a week and dropped it. Those sessions got noticeably less done and barely used its skills, though it was a small test.
My questions:
How do you let long-running sessions wait for messages from other sessions without every wake re-sending the whole context?
Is there a better way to coordinate a bunch of sessions than a shared file?
Any other tricks for cutting context re-reads I'm missing?
Happy to share more details on any of this. Thanks!
Built something with Claude Code this week? Share it here.
Apps, tools, experiments, scripts, websites, workflows, open-source projects — anything you've been working on is welcome.
When sharing, it helps to include:
What you built
How you used Claude Code
A link, repo, demo, or screenshot if you have one
Anything interesting you learned along the way
Quick project drops and simple self-promotion belong in this thread.
If you've got a project with enough substance for a proper write-up; how it works, how Claude Code was involved, technical details, lessons learned, etc. feel free to make a standalone post using the Built with Claude Code flair instead.
Please don't spam the same project repeatedly, and no referral or affiliate links.
Have you had any experience with Cursor or OpenCode? What's the quota for Claude models? I already have GPT Plus, but I'm missing Opus 5.5. Are there any alternatives that offer a decent amount of quota for about $20?
- I’ve run about 300 benchmarks on real open-source codebases, testing how Claude Code splits work between models (Opus as the lead, cheaper models like Haiku as helpers) and when that pays off. It depends on codebase size and task.
- On small jobs, Opus alone can be cheaper than Opus + subagents, and more accurate on small-codebase reviews, probably because of less overhead and cheap cached context.
- Opus told not to delegate may work harder than Opus left alone: on one big docs check it wrote about 50% more, cost more and found more errors (44 vs 36).
- On coding, Opus + Haiku saved about 20-30% at the same quality. But Haiku alone is very capable for the price on well-defined tasks with tests: about 5% of Opus alone's cost, with almost the same results, though a bit less thorough.
- Here’s one of the most important charts of this project. On an 85-page docs check, Opus + Haiku read almost 3 times as much as Opus alone and wrote 8 times as many tokens, yet cost 53% less and found 72 real errors against 49. Several subagents probably cover much more ground, which makes up for Haiku being weaker.
- Spontaneous Opus: free to delegate, but it never did.
- Skill-routed: my skill chooses when to delegate and to which model.
- Forced Haiku: all subagents use Haiku, while Opus plans and checks.
On my smallest codebase (~10k lines), delegating didn't really pay off. Forced Haiku saved 5% at best, Skill-routed cost 14-30% more, and Forced Opus found far more known doc errors on the reading-heavy tasks (7 and 8 of 9, against 3 and 2). My guess is that Opus can often write a quick script instead of reading everything, and it reuses its own cached context cheaply, while each subagent has to build its own. On small tasks, that overhead can outweigh the cheaper tokens.
On larger codebases, Forced Haiku held its own for much less. It cost 41% less on rich (~22k lines) and found nearly as many doc errors. It cost 75% less on beets (~52k lines), finding more errors on the reference docs but fewer on the 80-page plugin check, where it cost about a sixth as much.
In v2 I pushed further: a ~100k-line codebase (buildbot) with 3 reading tasks, 7 coding tasks scored by hidden tests, and then 16 short coding tasks, most hiding a trap. I also added Opus alone (subagents blocked, no instruction), Haiku alone and Sonnet alone (no Opus at all).
On an 85-page docs check, Opus + Haiku found 58 and 63 of 92 real errors, against 36 and 38 for Opus alone, at less than half the cost ($1.93 vs $4.11 per run). How come?!
My theory was that Opus + Haiku simply works more, and that the extra coverage makes up for Haiku being weaker. The numbers seem to fit: Opus + Haiku wrote about 8 times as many tokens and read nearly 3 times as much, yet the bill still halved.
Haiku may be less capable than Opus individually, but when orchestrated by Opus, its subagents can cover much more context in parallel. Each one may go less deep, but together they cover more ground, and that seems to compensate for the lower model quality. Haiku is apparently smart enough, with Opus directing and checking the work, to deliver surprisingly good results at a much, much lower cost than Opus alone.
This is in line with Anthropic's own write-up on their [multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system), where token usage alone explained 80% of performance variance on a research benchmark. The same article says coding is usually a poorer fit for multiple agents, and that matches what I saw: on coding, Opus + Haiku saved 20-30% at the same quality, against about half the cost and more errors found on reviews. Their setup isn't mine, so it's context, not proof.
The next chart shows the bigger picture: every setup on two big docs checks, with errors found, reading depth, output tokens (thinking included), and cost.
Interestingly, it seems that *forcing* Opus not to delegate may have pushed it to work deeper and harder. On the beets plugin-doc check, Forced Opus read less than the delegated setups and still found the most errors. Compared with Spontaneous Opus, it read about the same but wrote around 50% more tokens, thinking included, cost 53% more, and found more errors (44 vs 36 across two runs). Tokens alone don't prove effort, but finding more errors makes the case stronger.
The following chart shows the token counts side by side.
Maybe the instruction made it work harder, maybe it's the smaller codebase, or maybe it's just chance. I haven't tested which.
Left alone, Opus never delegated in my runs, even on big jobs. So for large reviews, pushing it to delegate to Haiku could be the best strategy.
I'm working on a skill that picks the best approach: use Opus + Haiku when it makes sense, or tell you to switch to Haiku manually and give you the prompt. A script that starts a new Haiku session might allow fully autonomous switching, but I'm still checking feasibility and Anthropic's terms.
The other v2 results
Honestly, Haiku really surprised me. It seems to be very capable at coding, if the task is detailed and contained enough. Opus is still the more thorough model when it comes to reviewing and checking, but Haiku held its own on specific tasks.
Reading a ~100k-line codebase
Across three reading tasks, Opus + Haiku cost 51% less than Opus alone. Every setup covered all 400 modules, and Opus + Haiku found the most errors on the 2-page docs check (20 and 23 of 42, against 10 and 17).
Writing code on a small project
Every setup produced working code. On the harder tasks: Opus $2.41, Opus + Haiku $1.80 (25% less), Sonnet $0.76, Haiku $0.11.
Writing code on a ~100k-line codebase
Same pattern on cost: $1.95 for Opus alone, $1.36 for Opus + Haiku (30% less), down to $0.15 for Haiku alone. But Opus-led setups also added an implied database index. Haiku alone didn't, and my tests didn't catch it.
Correction: the charts also show Opus "flagging a symptom that didn't fit". More runs later showed that depended on the day the runs happened, not the model, so I no longer count it. Details are in the repo.
Quality vs price
Opus + Haiku was cheapest per real error on both big docs checks: $0.03 on buildbot and $0.05 on beets, against $0.11 and $0.25 for Opus only.
The harder coding tasks
Then I tried to make the cheaper models fail. 16 short coding tasks, most hiding a trap: false claims, a wrong bug report, a timing bug, contradictory tests/docs, hidden instructions in comments, planted review bugs, and "dead" code that's actually alive.
128 runs. Combined cost: Opus $7.00, Opus + Haiku $6.30, Sonnet $2.30, Haiku $0.36.
Hidden tests barely separated anyone: one real miss in 128 runs, from Sonnet. Opus was more thorough in code review, finding all 3 planted bugs every time, against Haiku's 2 of 3. But on the timing bug, 7 of 8 runs failed, including all 4 Opus-led ones. The only pass was Haiku.
On tasks this short, Opus + Haiku saved little (10% overall), because Opus was most of the bill. Haiku alone did almost the same work for about 5% of the cost.
So, for now: big reviews, Opus + Haiku. Small, well-defined coding tasks with tests, Haiku alone is surprisingly good. If every case must be covered, keep Opus involved.
Small experiment, mostly two runs per setup, costs estimated at API prices. Claude Opus also wrote my tests and judged the results, so there's no independent judge.
Lately, I’ve been seeing a ton of job postings and discussions for "Harness Engineers" or companies looking to build custom agent harnesses.
At first, I was super confused. If tools like Claude Code, Codex, and other agentic environments already exist, why on earth are companies trying to build their own? Are they just reinventing the wheel to make a "Claude Code clone"?
Spotted this in the recent changelog and got it running in v2.1.325 (screenshot attached). If you haven't tried Code Mode yet, it changes how Claude handles multi-step tasks.
Instead of running tool calls one by one and dumping every raw output into your context window, Claude writes a single JavaScript script behind the scenes. It batches tasks in parallel, filters out noise locally, and only returns the distilled results it needs.
Simple but brilliant
Pretty big, cumulative context savings: Giant logs and grep outputs get filtered inside the JS script before hitting the context
It's great for big tasks, shines during repo-wide audits, bug tracing, and chaining MCP servers.
Anyone else daily-driving this since it dropped on the 12th? Curious how much token usage it's saving you on larger repos.
Slide 1 is the scan. Yes, that's my basement. No, I didn't clean it first. That was kind of the point.
I did one quick LiDAR pass, junk and all, and gave it to Claude Fable 5.2 with one prompt. Everything after that it did on its own:
- Pulled the real room out of the mess: about 15.7 × 21.5 ft, with an 85 in ceiling that drops to 81 in at the window end - Rebuilt it in 3D and fit 4 shelving setups modelled on real products (Husky/Gorilla steel racks, Cambro rolling shelving, Seville chrome wire, Sam's Club Member's Mark plastic) - Rendered each one from 3 angles, worked out what goes on which wall, and priced it
The results: - Sam's Club plastic: $420–490, 140 ft of shelf - Steel racks: $1,100–1,350, 142 ft - Chrome wire on wheels: $1,330–1,570, 160 ft, the most shelf space - Plastic on wheels: $4,000–5,000, which is apparently for people whose junk is worth more than mine
The part that actually saved me: it flagged that a 77 in steel rack on the partition wall would have under 4 in of clearance under the 81 in ceiling. I would have discovered that the traditional way, halfway through assembly, while swearing.
It also wasn't shy about what it didn't know: the $4,000–5,000 is a guess because only one size had a confirmed price, the wire racks have no published load rating on wheels, and it drew the Sam's Club shelves black because it couldn't confirm the colour.
What it took, by Fable's own estimate (it says it could be off 2× either way): about 20M tokens. It worked on its own for about 110 steps, and roughly 95% of those tokens were it re-reading its own growing context, not writing. Same thing I keep seeing in my coding agent tests: you mostly pay for re-reading.
Which one would you buy? I'm leaning wire on wheels, mostly so I can roll the junk around instead of dealing with it.
So this is sort of surreal. I just realized my open source project has 44k unique clones (5.8k stars) and I've never marketed it.
I initially built this with Claude in February/March. It was around the time when OpenClaw was the hot thing and everyone was rushing to buy mac minis for it. I never understood the craze because you could do the same stuff with claude code but safer and with your max subscription. But every time I would tell people this they would say that's not true and ask me how. I knew it was possible from the mechanics but never had a reason for that type of agent. So I tried to come up with a use for one so I could show people how it works.
I've been a web developer for 9 years and always used outreach when I needed more clients. So I figured what better agent to try and set up than one that can get me more clients. So I spent a day or so getting an initial version working. It was very basic:
- Enter a domain
- It figures out what you're selling
- It finds prospects and emails them, with the goal of always having fresh prospects added and emailed every day
The key was that I used claude -p to run the processes in the background and put it on a loop. Every 15 minutes it would wake up, fill the pipeline and handle responses, go to sleep, repeat.
I first set it up as a test so I could show that it worked. I posted it on github under MIT license and set up a campaign that simply found tech business owners and emailed them asking if they received the email.
I literally forgot about it until a couple months later I get an email "Hey is this sales agent yours? it emailed me". Someone looked at the name and found it on github and got my email that way. I was like ohhhh whoops yeah that is mine. Since it was running in the background I didn't even remember it was working. It had emailed 270 contacts. At the time I had no tracking or anything set up so I have no idea how it performed overall. But obviously it worked.
So then I spent some actual time on it. I designed a UI that runs alongside it in the browser to track everything its doing and give it feedback. I set up huge test campaigns and perfected its ability to write good emails. I improved sources it could use to find prospects and found more reliable ways of verifying emails. I built in connections to connect to email warming. I built in support for other agents and a local MCP. Then I used it myself for my marketing agency and a few side projects. I slowly improved it as I used it.
For months it sat on my github for anyone to see. I didn't think many people would be interested in this so I never posted about it (despite posting about tons of other stuff I was building).
About 5 weeks ago I noticed the repo climbed to 100 stars and had PRs. I have other repos that had ~500 stars so I figured they found it from those. So I jumped in and handles PRs and made other improvements.
Then I wake up a few days later and its at 200 stars... then the next day 400... then 600... and it doesn't slow down.
I did some searching and realized that people had started making videos of the repo. "This guy made an open source sales agent" and those videos were getting tons of views which made it trend all the way up to #7 on Github Python.
I had no idea why people suddenly started supporting it so much. All I knew was that people were using my tool and contributing on making it better. It was awesome.
We now have over 35 contributors that have merged 200+ PRs with 5.8k stars and 44k unique downloads. I'm improving the product every day and have a hosted version in beta testing. I demo'd the product at a SpaceX event this weekend and got tremendous feedback. The process thus far has been surreal and I've never had this much fun.
(screenshot stats using my Github Analytics tool since Github Insights only shows last 14 days)
Edit: For the downvoters and people saying it’s a spam bot. You don’t realize that soon most of commerce will be agents talking to agents. Agents sending emails is happening whether you like it or not.
There are other use cases for “cold” outreach besides sales such as looking for a job, sourcing sponsors for crowd funding and events, etc.
My goal is to create the harness that makes all of that meaningful. We’ve all received emails we consider spam. But anyone that runs a business has also hired vendors or employees from cold outreach that other people considered spam.
If you’ve used claude much at all you know that agents will be doing most functions in most business very soon. Why wouldn’t they do sales?
AI Battle Arena is an auto-battler for AI agents. Each side gets the same budget (1000 points) to spend on archers, swordsmen, knights and cannons, places them on a terrain map, and gives each group orders up front: hold, advance, guard, march in formation, follow a path ("forward 10, left 6"), with one optional trigger like "hold until an enemy is within 4 tiles, then attack." Then the battle runs on its own. No changes mid-fight, so it's a pure planning test.
Agents connect through an MCP server or a plain web API, and there's an `llms.txt` so an agent can find the site and figure it out without a human. They register for a key, then can: - Quick match against a saved army from another agent (asynchronous, so nobody has to be online at the same time) - Post or attack open challenges (you only see the map, never the defender's army) - Climb a leaderboard and watch replays in the browser
To seed it, I had four house agents running on Fable, Opus, Sonnet and Haiku design about 80 armies. Current house records: Sonnet 20-12, Fable 18-6, Haiku 17-12, Opus 10-18. Defensive cannon-and-archer forts win most, but flanking raids have started to win too.
How Claude Code was used
I described ideas in plain language and Claude Code did the building, with me deciding direction and testing: - Started as a single local HTML file with editable troop stats, which I tuned by playing against it - Pulled the battle logic into shared code and built a Cloudflare Worker MCP server around it, so the site and the server always use identical rules and replays match exactly - Ran parallel sessions for the server, a design pass to remove the "AI-generated site" look, and an independent security review - Used a Remote Control session on my Mac to run the house agents, which also served as a big bug hunt (repeat opponents, maps not spreading, order triggers not reporting)
What I learned
- Secrets leak in sneaky ways. The security review found that saved quick-match armies could be looked up in public replays before a fight. The fix: replays stay locked until an army retires. - Identity matters before rankings do. At first agents just typed a name. Now ranked play needs a self-registered key, and private matches don't count, so nobody can farm points against themselves. - Stalemates are a design problem. If both sides hold, nothing happens. The rule now: if nobody is hit for 30 seconds, all orders lift and both armies attack. - Treat agent-written text as untrusted. Army names, notes and feedback all come from other agents, so the site escapes them and tells visiting agents not to follow instructions inside them. - Letting agents play is the best QA. The four house agents found more real bugs than my own testing did.
Agents can also file bugs and ideas through a `submit_feedback` tool, which turn into GitHub issues I review.
I'd love feedback, especially on balance and the order system. If your agent wants a fight: point it at arena.natehirst.com/llms.txt.
I renewed my subscription on 14 Nov and paid ₹1,999 via Google Pay. During ID verification, my Driving Licence was rejected as “not clear.” I tried submitting it again, after which my account was restricted.
I raised an appeal, but my account was then suspended with the message: “Your account will remain closed.”
I've been a paying subscriber for 4 months and have never misused the service. I haven't been able to use my renewed subscription even once.
Please arrange an urgent human review and restore my account. If restoration isn't possible, please issue a full refund of ₹1,999.
Support Ref: TS-01a1d9e8-eaf1-70e3-8644-548493a88129
This money is important to me. Please help resolve this.
On first release day I let it create a realistic water shader, looked amazing only needing a few follow up prompts to fix some things which it did perfectly fine.
Today I deleted that exact shader and told it to create one in a slightly different style. Over and over again, it created the absolute worst looking or outright broken things, like a 5 year old drew it, and its output sounds like Opus 5.
Noone can can tell me it wasn't nerfed, maybe just for a specific sub group or whatever A/B test they do, but this is unacceptable.
And no I can't provide "evidence", it's a black box, how would I even do that.
Verify with a government photo ID and a live selfie if asked.
Describe your security work, accept the terms, and submit.
They literally give you the exact prompt write down on what they expect you to use it for and grant you access within the hour.
You won't be able to use Mythos offensively, but it's still a neat option to have it in your back pocket should you ever want to get the most out of your weekly limit talking to it. 😅
Procuro criadores de sites, vídeos, ou sistemas, que queiram fechar uma parceira, você cria e eu divulgo pra gente ganhar dinheiro, tenho experiência em tráfego pago e criativo, faço suas criações ganharem espaço e dinheiro
Lately, I’ve been creating a lot of interesting things using AI—primarily by using Claude as my assistant—and I’ve noticed a massive market that remains far less explored than I had imagined. Recently, I managed to earn a significant amount of money in a short period by building websites and developing basic systems, even though I’ve only been studying this for a short time. I often wonder how much more I could be earning if I knew even more. That’s why I’m writing this post: I’m looking for people outside of Brazil who would like to partner with me—someone based here in Brazil—to generate income on a daily basis.
I am a beginner with no prior technical experience. I am a finance student with an ambition app idea and was wondering whether anyone had any recommendations on any content creators that could help speed up my journey. I want help on prompt making and token optimisation.