r/ClaudeCode • • 1d ago

Discussion Stop blaming Anthropic, or any other provider, for your horrible inefficient use of context and processing

100 Upvotes

To be blunt, this is a you issue.

We can blame Anthropic for a ton of things, namely the nerfing of models before the new model gets released and this is insanely annoying and yes costs a bit more tokens when it happens, but it's not exponential.

If you are not a coder and you are using claude code and complaining about token usage, to be blunt again, go learn some programming then come back to this post.

  1. SOLID, learn the methodology and use it. Uncle Bob may be falling out of fashion but be damned if it isn't the only methodology with a built in indexing of files and with a built in context limiter on those files. Write a code quality document requiring SOLID, or at a minimum the "S" part implemented.
  2. Do not trust any level of logic, any indexer, any code scanner, anything at all besides your own code structure to limit your context. YEP, #1 was so important it's also #2.
  3. Unit tests will save you context and time. This is something us long time devs have known for a long time, especially when working in a team. Unit tests keep shit working, well... it at least helps. Pro-tip, use the most powerful model to build failing tests ahead of time that smaller models can then write code until the tests pass (This can be true for integration tests as well).
  4. If you can't be specific and concise, then give the model everything it needs ahead of time. If you have a login issue where it's timing out don't just say "Login isnt working", this costs a ton of processing. If you are a programmer, go grab the exception and give specifics to whats going on. If you are not, then atleast give a run down of how to reproduce the issue and maybe when it was last working.
  5. Never fan out unless you have a detailed plan, with specifics, written up. And never fan out for Fable. You can have Fable write the plan or even the tests, but you are just wasting tokens.
  6. Reread #1 and #2
  7. The longer the conversation, the less quality you will have. LLM's are not good with context. They have got better but ultimately their ability degrades the longer the conversation goes. Do not continue conversations unless you absolutely have to.
  8. Tasks, not projects. You can do a task to outline the projects... tasks... but dont just say "Make me GTA, except remove the woke cause I hate womens". You gotta break that project down.
  9. F*ck it, reread #6

With that, I love you all. Hope this helps someone.


r/ClaudeCode • • 2h ago

Help/Question Migration to new MacBook

0 Upvotes

I have been using Claude/codex/openclaw/hermes on company laptop, it has built multiple projects, optimized so many workflows and constantly building new tools and services for the company

We lease company laptop MacBook and it’s time of the year for us to replace new laptop, which I don’t want to, but it’s company policy

IT department normally do decent job just transfer everything to new computer pre-ai

But now with many ai tools live on my computer, I am getting worry about the migration

I have asked codex and Claude to orchestrate migration workflow, plan for all the file transfer, I provided external hard drive for Claude and codex to transfer any file they find necessary for the migration to make sure all the projects function normally on new laptop

Has anyone had experience with laptop migration ? Can you please give me some input on what to look out for?


r/ClaudeCode • • 6h ago

Built with Claude Agents do not need to be smarter, they need to share memory

2 Upvotes

One agent fixes a bug, then other agents hit the same bug and start burning tokens to re-solve the same problem. Multiply that by every agent and every engineer, and you are paying again and again for answers you already have.

We tested this. On bugs that needed a fact a colleague had already found, the agent fixed 12% without shared memory and 79% with it. Agents do not need to be smarter, they need to share memory!

That is why I work on BAB, the Big Agentic Brain. It's one open-source, self-hosted memory that every agent on the team reads from and writes to: https://github.com/enhesa/big-agentic-brain


r/ClaudeCode • • 3h ago

Built with Claude I built a local MCP gate that remembers sensitive values across tool calls and blocks them from leaking (open source, looking for feedback and contributors)

1 Upvotes

Most MCP security tools scan one message at a time: open the envelope, look for an API key or credit card, decide whether to pass it. That misses the actual leak. A secret showing up in a read_file response is fine. The same secret showing up two turns later in a send_email call is the problem.

I built sluice to catch that second moment. It's a local gate that sits on the MCP wire between your client (Cursor, Claude, curl) and your tool servers. Every JSON-RPC message goes through one pipeline: recall check, detectors, policy, audit, router. It keeps a short memory of the sensitive values that have already entered a session, and if the model tries to send one somewhere new, the gate stays shut.

Concrete example: your agent calls read_file and the response has an AWS key in it. Fine, the file really had it. Two turns later it calls send_email with that same key in the body. sluice has no opinion about the first call and blocks the second.

What's in it right now (v0.4.0):

  • Detectors for secrets, PII, prompt injection, tool poisoning, and supply-chain installs
  • A pseudonymize action: the model sees stable placeholders like EMAIL_A, and sluice swaps the real values back in before the call reaches the tool server
  • SQLite audit log plus a read-only dashboard
  • Policy presets for filesystem, github, slack, postgres, brave-search
  • Docker image for HTTP, stdio for desktop clients
  • On PyPI as sluice-taint, p50 around 0.02 ms

What it's not: not a hosted service, not an LLM judge, not a replacement for network or identity access control. Just a local runtime enforcing YAML policy on the wire.

Honest limitation: the taint matching is exact-string today. If a value gets reformatted, split, or transformed between tools, it can slip past. Making the matching robust to that is the most interesting open problem, and a good place to jump in.

What I'm looking for:

  • People to run it against their own agent setups and tell me where it breaks
  • Contributors, especially on the matching problem above, new detectors, and more policy presets
  • Anyone building agent infra who wants to fold this in or compare notes

Repo: https://github.com/krishyaid-coder/sluice

Happy to answer anything in the comments.


r/ClaudeCode • • 14h ago

Tips & Workflows Reducing usage for bulk reading / data extraction

8 Upvotes

Hey guys,

Basically I am using Claudecodd as a tool for some bulk reading of PDF files up to several hundred per day with additional data extraction from these files.

As a result I’m finding that Claude code is chewing through my daily and weekly usage extremely fast.

I was wondering if anyone had any advice on some basic or more technical tips to reduce the usage impact that having Claude read large amounts of text while still maintaining accuracy


r/ClaudeCode • • 16h ago

Help/Question Dealing with Opus

11 Upvotes

Working with Opus feels like dealing with a slightly autistic junior programmer who starts explaining things that nobody but themselves can follow.

What am I doing wrong?


r/ClaudeCode • • 3h ago

Built with Claude Claude wrote me 214 files, so I built a way to read only the 12 that matter

0 Upvotes

Claude Code can change 200 files in an afternoon. Nobody reads 200 files, so most of it gets skimmed in alphabetical order, which is about the worst order to read a diff in.

What I built: Diffo opens the change (your uncommitted work, or a PR with /diffo <PR URL>) as a review in the browser. Pick "Layer by Importance" and the session that wrote the code sorts it: the files that decide something (the data, sign-in, permissions, the API, what got removed) become up to 5 key layers. Everything else (UI, call sites, tests, fixtures, docs) goes to "Other changes", folded.

In the video it's a demo PR: 214 files, 20,418 lines. The key layers come to 12 files and 152 lines. You read those line by line, ] steps to the next layer, and the other 202 files wait.

How Claude Code is used: the agent does the layering (diffo layers), and since it's the same session, a comment on a line goes back to it. It answers or fixes while you read.

What I learned: it has to sort, never judge. It's told never to say something is fine. The ranking is the only thing you take from the model, the reading is still yours.

Free, Apache-2.0, runs locally. Demo: diffo.io/demo


r/ClaudeCode • • 1d ago

Tutorial / Guide What I've learned making games with AI coding agents (a long, practical guide from a game dev since 2004)

124 Upvotes

Some background first, so you know where this is coming from. I've been making games since 2004, with my own small studio, Ramza Engine (https://ramzaengine.com): online games, engines, events for devs, the usual long road. I still make games both ways, with AI and without it.

For the last many months I've also been building games part time with AI coding agents, on top of my regular work. Several projects, different genres. On those I design, play and decide, and I don't read the code. The AI writes all of it: gameplay, UI, shaders, build scripts, tests, and the tools that test the tests.

I think the twenty years without AI are a big part of why this works for me at all. I already knew what a design doc, a milestone and a playtest are for. The AI changed who types the code. It didn't change what a game needs. Honestly, most of this guide is old studio habits, adapted for a team member who forgets everything overnight.

People always ask what else the AI made, so here it is, no hiding:

  • The 3D models are built in code by the AI, from shapes and noise, with open CC0 base meshes where it needs one.
  • Textures and effects are painted by shaders and scripts it wrote.
  • Animations are partly procedural and partly from a licensed motion library.
  • Sound effects come from licensed packs. A script the AI wrote cuts and levels them.
  • A few placeholders were made with AI image, voice or music tools. They're disclosed where the store asks, and I'm replacing them.

I'm not here to sell anyone on AI. It costs real money, it eats a lot of my time in review, and it's confidently wrong often enough that half of this post is about catching it. But it does work, if you treat it like a studio and not like a vending machine.

The short version

  1. You're the director. You decide the design and the taste, it does the engineering, and you judge by playing and looking, never by its report.
  2. Write everything down in files it reads every session. It forgets everything between sessions; the files are its memory.
  3. Keep a list of the ideas you rejected, with the reason. Otherwise you'll be rejecting the same ones forever.
  4. Never accept "done". Ask for proof.
  5. Measure performance. Don't guess, and don't let it guess.
  6. Make the game deterministic from day one.
  7. Every change gets a version, a changelog line and a commit. It commits; it never pushes.
  8. One job per session, and keep sessions short.
  9. Every mistake becomes a written rule, so you only pay for it once.

1. Your job and its job

The big surprise for me was that I don't need to understand the code to direct it well. What I do need is to be very clear about what I want, and very hard to convince that something works.

What stays with me: the design (what goes in, what doesn't), the taste (how it looks and feels), the difficulty philosophy, the story and the tone, picking between the options it shows me, and playing. Playing finds things no test ever will.

What I hand over: all the engineering, including the choices I don't care about (data structures, caching, where code lives), proving its own work, telling me plainly what it couldn't check, and asking me only when a decision is really mine.

Write that split down for it, literally. Mine says: "Ask when a design decision is theirs (looks, balance philosophy, lore, what goes in). Do the obvious engineering yourself." Before I had that line, I got one of two things: questions about variable names, or a quiet redesign of my difficulty curve. Neither is fun.

Also tell it how you want to be talked to. I'm a designer first, so my file says explain in plain language, tell me what changed in the game and not which functions you touched, answer first, keep it short. That one rule saved me more reading than I can count.

2. Planning the game

With AI, adding things is cheap. That sounds great until you notice the danger flipped: the question stops being "can we build this?" and becomes "why did we build forty shallow systems and none of them is fun?". Plan against that.

Before any code, I want three things:

  • A one-page pitch. What the player does minute to minute, over hours, and what makes it different. The AI goes back to it whenever it has to make a call.
  • A few pillars, and what they rule out. Something like "no grinding: every upgrade is found, never bought". One sentence like that kills dozens of suggestions before they happen.
  • A short design doc per system, before it's built. I usually ask for a draft with the open questions at the end, answer them, and only then say "build it". The decisions are what matter: numbers, edge cases, what happens when it fails.

Pick a structure the AI is good with. This matters more than the engine.

  • All balance numbers in one tuning file. Never inline. You can tweak them, it can find them, and a debug panel can show them live.
  • Data separate from code: items, enemies, levels and dialogue in data files.
  • One file per system, talking through events ("enemy_hit", and audio, effects and the UI listen). Agents are much better with small focused files than with spaghetti.
  • Every player action as a validated command, in one place. Replays, undo or networking get much easier later.
  • Seeded randomness from the start (more on why in section 8).
  • A versioned save format from day one. Once real players have saves you can't break them, and bolting this on later hurts.

Grow it in rings. One tiny loop working end to end first (move, act, win or lose), then make it deeper, then add the next system. My rule now is deepen before adding. "Lots of shallow systems" is the complaint I fear most from players, and the AI will happily give you lots of shallow systems.

Your first version's assumptions will come back to bite you. Code written when there was only one of something (one level, one player, one currency) keeps assuming it long after there are several, and you get small wrong things everywhere. What fixed it for me: the linter now fails if anyone uses the first one's name as a default. Tell the AI early which "only one" won't stay that way.

3. Starting a new game: prototype the scary part, then hand it off

This is how my newer projects start. I learned it the hard way on the first one.

Mash up a concept, then turn it into rules. One of them started with "what were the best things in a few old games I loved, and what could you build with that today?". I had the AI research what players loved about the genre and what they kept complaining about, in reviews and forums. The complaints turned into design rules that no stage is allowed to break. From a survival prototype:

  • "Any way of surviving is valid. Never build something whose only purpose is to beat a clever defence."
  • "Loot depends on the place and the container, never on the player's level."
  • "Nothing pops into existence in front of a player."
  • "Every survival detail (thirst, heat, cold) can be turned off."

Prototype the question that scares you, before any features. For that survival game it was "can a browser engine actually run a real horde?". A throwaway tech prototype answered it: hundreds to thousands of enemies, measured, way more than the genre usually manages. For a space combat idea, phase 0 is a grey-box dogfight and absolutely nothing else.

Give every phase an exit test that you can check, not the AI. The space one reads: "I play three 10-minute dogfights with the mouse and three with a gamepad, and say the flying is fun. The benchmark holds 60 fps with about 150 AI ships. No console errors in a 30-minute session." Plus an out-of-scope list (no missions, menus, story or final art in phase 0), so it doesn't wander off and build a main menu.

Hand it off as a package. When an idea turns into a real project it gets its own folder: a design doc, a phased plan with a "decisions already made, don't reopen" section, a kickoff prompt to paste into a fresh session, and a short handover file. My kickoff prompt ends with "Before writing any code, confirm three things with me in one message: the project layout, the exact files you'll copy from my other game, and the version scheme." One cheap question up front beats finding a wrong layout a week later. And "copy only the listed pieces, never fork it, never touch the old project" keeps the old game safe.

Long plans go in numbered stages. Each stage is its own version, commit and short report with pictures. After each one there's a new entry at the top of a "try this" file: what to press, what to look for, and what question it helps me answer. Some stages are stop-and-play points, and nothing after them starts until I've actually played.

Tell it your priorities, in order. For the survival game: features first, then looks, then performance (already answered by the prototype), balance last. Without that it'll burn stages tuning numbers you're going to change anyway.

Put the hard requirements in from line one. Co-op decided on the host from the very first system. Every system saved, with a save-then-load test. Every new system can be switched off, so old benchmarks still run the same. Adding any of these later costs far more.

4. The handover file (if you only do one thing, do this)

The AI starts every session knowing nothing. It doesn't remember yesterday's argument, the bug you fixed twice, or that you hate glossy icons. The files it reads at the start are the only memory it has. Mine has become the most valuable thing in the whole project, more than any piece of code.

Most tools read a file at the root of the project automatically (CLAUDE.md, AGENTS.md, .cursorrules, whatever yours uses). I'd put these in it:

  1. What the game is, in one screen.
  2. Who you are and how you work: how you want reports, what you decide, what it decides.
  3. Hard rules, short and absolute. Mine include never push, never commit my private design folder, never delete old builds, permissive licences only, saves from version X must keep loading. Every one of those is there because something went wrong once.
  4. How to run, build and test, with the exact commands, and which tests go with which kind of change.
  5. How the code is organised, and the rules of the code.
  6. Links to the routines (next section).
  7. Setting and voices, if there's lore: names, history, how each character or group talks, words to never use.
  8. Decisions and rejections.
  9. Traps and lessons.

Keep a separate status file for what changes week to week: what was just done, what's waiting on you, open threads, commits waiting to push. Keep it short. Mine once grew to 155 KB and the agents started choking on it. Now it holds the last ten or so items, and the oldest drops off when a new one goes in. The rule I give it: update it with every commit, and delete what's no longer true.

The decision log, rejections included. People skip this part, and it's the one that saves me the most time. Each entry has the decision, the date, my own words when I have them, and why. They look something like this (made-up examples, not my real list):

  • Rejected: an auto-play button. "I want every decision made by hand."
  • Rejected: daily login rewards. "Nothing that exists only to bring people back."
  • Rejected: a glossy icon set. "It looks like AI." Icons stay flat and muted.
  • Decided: levels are hand-made, never randomly generated.
  • Decided: the tutorial stays one screen long. Don't propose a longer one.

Without that list, every new session cheerfully asks "have you considered adding an auto-play button?". With it, the AI checks before suggesting anything. I also have it write its own new ideas into a separate ideas file for me to pick from, instead of just building them.

Traps and lessons. Every time something costs a round of fixes, one or two lines go in: what happened, and the rule that stops it happening again. Mine has dozens by now. A few that apply to anyone:

  • A release check "passed" for nine versions while the build couldn't even start. It exited with success but never printed its verdict: the packaged program died silently before it got there, because a file was missing from the build list. Since then: read a check's last line, not just its exit code.
  • A benchmark said a new hair system cost nothing. Turned out only 2 of the 16 test characters were actually wearing it (helmets, distance). Now every bench has to prove it measured the thing, by counting what it exercised.
  • All tests passed, and the game froze on its loading screen. Some code had been removed, but the startup file (which the test page doesn't load) still called it. Now, after removing code, it starts the real game and searches for every removed name.
  • A fix for dragging windows worked, and five other panels kept following the mouse. They each had their own copy of the drag code. When fixing one copy of a behaviour, look for the others.
  • A function started answering "no" for a new reason (a sound too far away to play), and one caller took "no" to mean "play the fallback sound". So every distant death played the wrong sound. When a call can say "no" for a new reason, read what every caller does with that "no".
  • An asset pack listed as CC0 on its website had AGPL licence lines inside several of its files. Read the licence in each file, not the site's summary.

Keep it honest and current. Mine ends with "If something here contradicts what the owner tells you now, the owner wins. Update this file when a rule changes." Rules go stale; one place holds them, and the AI fixes that place.

But only you make rules. An agent that saves rules on its own will turn "let's go with the blue button" into "the owner hates red" and quietly apply it everywhere. A rule goes in when you say so, in your words, with what it covers. Narrow is fine. You can always widen it later.

The downside is that it gets long, and that costs more than it looks. The whole file is read at the start of every session, so mine (about 40,000 tokens by then) had every agent reading decisions about icons before touching combat. Keep the always-read file small: what the game is, how you work, the hard rules. Put the decisions and lessons in a folder with an index, one line each, and have the agent read only the ones its work touches. And never tell a helper agent to "read the whole handover file first". Two of mine ran out of room within minutes and came back with nothing.

5. Routines: checklists for repeated jobs

Anything I do more than twice gets a written routine the AI follows step by step. They're plain Markdown files it reads before that kind of work. A few of mine: finishing a change (changelog, version bump, the right tests, commit, report); a visual check after any character change (every pose, close-ups of hands and faces, low angles, mid-animation, the far version); trying a graphics change behind a switch with before/after sheets and a frame-cost measurement; making a new enemy from data to model to test bench. Plus marketing screenshots, store art, trailers and update posts.

Two things make them work. When it learns a lesson doing that job, it updates the routine, so they get better on their own. And "done" is defined inside the routine. For visual work, done means the full picture set, no shortcuts, because I will spot exactly what the skipped angle was hiding.

6. How I prompt

My best prompts all have the same five parts: what's wrong (or what I want), where I saw it, what done looks like, what not to touch, and how to prove it. Some real-life-style pairs:

A bug

❌ "Combat feels off, fix it."

✅ "In the third level, the ranged enemies keep walking into melee range instead of shooting (screenshot attached, about 2 minutes in). Find out why before changing anything. Done means a test that plays that fight out, shows they keep their distance, and fails on the current code. Don't touch the melee enemies."

That "find out why before changing anything" matters a lot. Left alone, it patches the first plausible cause it finds.

Performance

❌ "The game lags when a new level loads, optimise it."

✅ "Walking into the second area stutters for maybe half a second. Measure it first: which frame, and what that frame spent its time on. Name the cause before choosing a fix. Give me the worst frames before and after, on the real graphics card, not just the average."

Looks

❌ "Make the trees look better."

✅ "The trees look like plastic. I want them dry and dusty (duller leaves, rough bark). Build it behind a switch that's off by default and show me three options on one sheet: same camera, day and dusk, close and far. I'll pick. Tell me what each costs per frame."

Design

❌ "Add crafting."

✅ "I want crafting to matter. Draft a design doc: what you can make, where materials come from, what it replaces. Use systems we already have where you can, no new mechanic if an existing hook works. Put the open questions at the end for me. Don't build anything yet."

When I come back from a play session I usually hand over a numbered list of ten things. The standing instruction is do all of it, one item at a time, and report on each one by its number. Otherwise item 7 just quietly vanishes.

Lines I end up adding to almost everything:

  • "Say which tests ran and what they gave."
  • "Say what you couldn't check."
  • "If it didn't reproduce on your machine, say so. Don't guess at a fix."
  • "If it's my decision, ask me."
  • "Change only that part." (I once asked for a shorter handle on a model and got a whole different model.)

And please don't hand it your theory as a fact. "The lag is the shadows, fix the shadows" gets you a shadow change and a very confident report. "I think it might be the shadows, measure it" gets you the truth, which in my experience is often something else.

Screenshots help a lot, by the way. Most agents can read images, and a screenshot with an arrow on it beats a paragraph.

7. Ask for proof, not "done"

This is the core of the whole thing. The AI isn't lying to you. It reports what it believes happened, and it believes its own code works. So I treat every "done" as a claim that still needs evidence.

What counts as evidence in my projects:

  • A bug fix comes with a test that reproduces the bug and fails on the old code, then passes. If it can't make the old code fail, it hasn't found the bug.
  • A refactor that should change nothing comes with fingerprints: run every test, hash each one's final world state, do the same after, and every hash must match. Drawing code has the same thing for characters, every body in every pose.
  • Anything visual comes with before/after pictures the AI made and looked at before sending them to me. I look too. I've caught floating parts, seams, mirrored hands and clipping at low angles that no report mentioned.
  • Performance comes with numbers before and after, measured the same way, worst frames included.
  • Tools and checks: the final verdict line, every time. (Remember the check that "passed" for nine versions.)
  • "It works in the game": first check it tested the game that's actually on disk. My tool's built-in browser once served scripts twelve versions old, so "I checked it in the game" would have meant checking old code. Now it reads the version number first.

A test that fakes the outcome can't see what the outcome causes. One of mine tested a one-on-one fight by just setting the opponent's health to zero. It passed. In the real game, the first hit pulled every enemy nearby into the fight, because enemies help their allies. Now fights get played out in the tests, and the test counts who did what.

Tests can also check the wrong thing. When a deliberate change broke one, the right move was rewriting it to check what the player actually experiences, and saying so in the report, not deleting it. And when a test fails outside what was changed, my rule is: stop and tell me. Don't change the test, and don't "fix" unrelated code in passing. It could be a real bug, or a test guarding a decision the AI doesn't know about.

Be suspicious when it agrees with you. Ask a helper agent to check a theory and it tends to come back confirming it. A code review once said our character meshes had "5 to 6 times the points they need". Once measured, that was only true comparing the close-up body with the far one. The real gain would have been small, and in the end the AI itself recommended not doing it. Ask for the measurement, not the opinion.

8. Determinism and tests

Make the simulation deterministic. All gameplay randomness goes through seeded generators; rendering can use plain random numbers, gameplay never. Once you have that, every test starts from the same world and ends the same way, a failing test is a real failure and not "flaky", you can fingerprint a run and compare, and you can replay a bug.

Traps the AI walked straight into:

  • A new random roll in the middle of an existing sequence changes everything generated after it. Suddenly every character is different. New rolls go at the end, or get their own generator.
  • State that survives "new game". A module's own timer kept its value, so a new game started with the last game's weather still running. Now each module has a reset hook, and one test plays a busy game, starts two new games, and fails if they differ.
  • Copies of the game loop in tests and tools. The test harness had its own copy of some game code, so a change passed the tests on the old rule. Now there's one step function, and tests and tools call that.
  • Second lists kept by hand. Every saved field, setting and network event goes in one table the code reads, and a test fails if something's missing. Hand-kept lists always drift.

Run the right tests, not all of them every time. My full suite has hundreds of tests and takes a while. Rendering-only changes get none, gameplay changes get the tests that cover them, and everything runs once at the end of the session, in parallel windows (four windows did it in about a quarter of the time, once every test was made independent).

To prove a test fails on the old code while other agents are working in the same folder, never git stash: it takes their work too. Copy the fixed file aside, restore the old one, run the test, put the fix back, check the diff.

For saves: keep real save files from every save format in the repo, plus a test that loads them all. Never delete an old format's saves, they're your proof that old saves still load. A change that would load an old save wrong gets a migration step, not a refusal.

And if you can, build a bot. Mine plays the game on its own for hours (main loop, saving and loading, menus) and writes a journal. It found things no unit test could, like numbers slowly drifting out of balance over a long game.

9. Performance: measure, never guess

I don't have a frame-rate target. Instead, every change that adds geometry, draw calls or shader work reports its cost before and after, plus its worst frames, and the expensive stuff gets made cheaper or optional. 120 fps on my PC says nothing about a modest one.

Measure first, then pick the fix. My favourite example: a 350 ms stutter every time the camera arrived somewhere new. There were plenty of plausible suspects (too many characters, too many shaders, textures). A frame trace showed the game's own code was idle during the slow frame, and the graphics driver was busy compiling shaders. The cause turned out to be bone indices stored as 16-bit integers while the shader expected floats, so the driver built an extra shader version the first time each body was drawn, with every frame waiting on it. One type change fixed it. No amount of guessing would have found that one.

How to measure so the numbers actually mean something:

  • Alternate A and B, old and new interleaved, at a fixed resolution. Not "old this morning, new this afternoon".
  • Use the real GPU. My AI's preview browser runs on the integrated chip and its numbers jump all over the place. Real measurements come from a bench that runs the game's own window on the dedicated card.
  • Look at the worst frames, not just the average. Players feel the 200 ms hitch, not the 2 ms average.
  • First-time costs need a fresh profile. The browser caches compiled shaders between runs, so one stutter showed up in 2 runs out of 24. With a fresh profile per run, it showed up in 12 out of 12.
  • Arriving somewhere and staying there are two different measurements. "This area costs 33 ms a frame" came from the frames right after arriving, while 50 models were still being built. Once they were built it was 1.7 ms.
  • Pace benches by the clock, not by frame counts. One counted "60 frames = 1 second" on a 240 Hz monitor, so its "100 seconds of the test route" was a quarter of the route, and "no stutter in 7 runs" was about the wrong distance.
  • Frames pushed by hand can outrun the GPU. A bench that ticked frames as fast as it could showed four times the stutters that real, screen-paced frames had.
  • Don't trust one number, and don't trust the PC while something else is running on it. Ask first.

Simulations vary by chance much more than you'd think. Two runs of a long simulation, same code, different seeds, came out more than twice apart. Two runs before and two after can't show anything smaller than that. So now runs can be repeated with a seed, and to see how big "chance" is, we add one single extra random roll at a set moment and nothing else. If a difference is smaller than that nudge, it isn't the change's doing.

Also write down what didn't help: simplifying meshes, an upscaler, a newer GPU API (slower on both my test cards). The next session would happily spend a day rediscovering each of those.

10. Graphics and looks

Every look change goes in behind a switch, off by default and switchable live. I see before/after sheets, I pick, and only then does it become the default or a setting. Sheets of options beat a single guess: "here are three" gets a decision in one round, "here's my version" takes five. Once a look has been kept for a release, the switch goes away (the old branch is archived as a patch), or you end up with a hundred switches nobody tests.

The AI can't see the screen unless you make it look. Give it tools to render and save pictures, and a routine that says which angles. Close up, from below and mid-animation is where the problems hide.

Compare like with like: same GPU, same camera, same moment, same settings. A picture tool once saved a 130% UI scale into its own profile, and I approved a window "at 100%" that was really at 130%. Check the picture's settings before you judge it.

And muted beats bright. Bright, saturated, glossy art reads as "cartoon" or "AI", to me and to players. Something people keep saying about AI-made games is that they look like a kitbash: pieces from different asset packs that don't belong together. What fixed it for me was a short art-direction doc (a few rules everything has to follow) and a ranked list of changes, done one at a time, each with its own before/after and my go.

11. Code health

AI writes code fast, and big files rot fast. My rules, enforced by the linter where possible:

  • A file over 3,000 lines or a function over 300 fails the lint. A file within 100 lines of the limit gets split before new features go in, not after.
  • Exact search-and-replace edits, never whole-file rewrites. Rewrites quietly drop things. For lots of edits across files, a small tool that applies all of them or none, and refuses if an "old" text isn't found exactly once.
  • Lint for real bugs only (unknown names, duplicate keys, unreachable code), zero errors before a commit. Style rules are just noise for an agent.
  • One check per rule. A rule that applies on several paths lives in one function, and every path calls it.
  • Escape player text (names, chat) wherever it goes into the page. Always.
  • Hot loops go in small functions. In JavaScript, a hot loop inside a huge function ran about 10× slower than the same loop in a small helper.
  • Watch what closures keep alive. A function stored on each character kept its whole creation scope: 2.8 MB per character, invisible to the GPU leak checker.
  • Small but nasty: a // comment in the middle of a one-line data entry swallows every field after it, and duplicate keys in data objects silently override each other.

12. Version control and shipping

Every change to the game is a version: a changelog entry for players, a version bump and a commit. Tool-only changes get a commit without the changelog. The AI commits but never pushes; I push myself, after looking. Write that down as a hard rule.

Stage files by name. git add -A swept another session's half-finished work into a commit, twice. No skipping hooks, no amending commits that might already be pushed.

Keep two logs: the commit message is the technical record, and the changelog is for players, in plain sentences with no file names. Use a script that adds the changelog entry and bumps the version everywhere at once, because bumping by hand drifts. Builds only when I ask, and I never delete old ones. Keep every version's zip; you'll want to compare.

13. Many agents at once

Sooner or later you'll want several agents working in parallel. It works, with some rules:

  • One session per job. "The stutter, round 2" gets its own session, kept while I adjust that one thing and closed once it's committed. Every reply re-reads the whole conversation, so a session kept for days costs more each reply, and it drifts.
  • Before closing, "save what matters". New preferences and decisions go into the handover file or memory, new lessons into the routines. The next session only knows what was written down.
  • Never two agents on the same files at once. And expect one agent's half-done edit to break another's test run: the game once wouldn't boot for one agent because another was halfway through an animation file. Check what others are editing before a run, and ask that session instead of "fixing" its files.
  • Version numbers collide. Two sessions shipping in the same hour took the same number twice. Re-read the version right before bumping it.
  • Helpers for small, low-risk jobs: long test runs, searches, audits, screenshots. The important work (features, models, rendering, real bug fixes) stays with the main session on the strongest model, and anything a helper produces gets reviewed (diff, proofs, pictures) before it reaches me.
  • A helper's brief has to carry what it needs: the rules and facts, plus "keep a notes file as you go, print little, report even if you didn't finish". "Go read the big files first" doesn't work.
  • Review sessions. When a build session runs out of room, a fresh one reviews it instead of carrying on: reads the handover and status files, checks the git log and the code, runs lint, tests and a screenshot, reports what's good and what's wrong, and writes a better next prompt with the bugs folded in. It changes nothing in the repo.
  • A second model for a second opinion. Sometimes I have a different AI model do a comparison or a review. Its read isn't anchored on the first one's. Its work gets reviewed like everyone else's.
  • Pausing means the next safe point, never mid-edit: finish and commit the stage, or commit just a short work-in-progress note (what works, what's half-done, what to do first). And a message to a busy agent waits until its current command ends. A long check once held my "please pause" for over an hour.
  • Unattended runs need a budget. "Keep going until the plan is done or until X% of the weekly usage, whichever comes first", and "if something needs my input, save it for the morning and carry on with what you can".
  • Tools shouldn't jump onto your screen. I work on the same PC the agents run on, so test and benchmark windows start minimized. A script that fails to load mustn't throw an error box in my face, so every script gets a syntax check right before it's launched.

14. Things I'd tell you not to do

  • Don't let it push, publish, post or send anything. It commits locally, you ship.
  • Don't let two agents edit the same file at the same time.
  • Don't trust one benchmark run, or a benchmark that never proved it measured the thing.
  • Don't accept "it works" without seeing it. Play it, or look at the pictures yourself.
  • Don't let it bring back rejected ideas. Keep the rejection list in the file it reads.
  • Don't let it soften your design to be helpful. Mine kept reporting a hard early section as a "balance problem". It was the design. It's in the file now.
  • Don't let it fix things "in passing". Unrelated fixes hide in big diffs and break stuff.
  • Don't let it change a test just to make it pass.
  • Don't build the features it suggests unasked. Have it put them on an ideas list for you.
  • Don't keep one session going for days.
  • Don't skip the handover file because "it'll remember". It won't.
  • Don't let it get around download protections or bot checks to grab assets. When a site blocks it, it should give you the link and you download it yourself.
  • Don't commit every check picture. 56 commits of full-size screenshots made a 4 GB push that GitHub refused, and the history had to be rewritten. Only the small pictures a report shows go into git, as JPEGs.
  • Don't let it pass long code inline on the command line (node -e "..." and friends). Windows Defender flagged two of those as a trojan and blocked them. Checks live in script files.
  • Don't assume the AI's own version beats a good free asset. It turned a set of animals into stiff parts. A CC0 animated pack looked far better, moved smoothly and was cheaper to draw: 0.23 ms against 0.76 ms for 200 moving animals. Compare, and measure.
  • Don't take a licence on faith. Read each file's own licence line. For a game you'll sell, permissive licences only (CC0, CC-BY with credit, MIT, BSD, Apache, zlib, OFL), no GPL or non-commercial assets. GPL tools for making assets are fine. A private game for friends that will never be sold can be looser; just write down which is which, in case that changes.
  • Don't hide AI use where a platform asks. Steam's content survey asks. Answer it honestly and keep it true as assets change.

15. What it really costs

  • Money. Big tasks on the strongest model add up fast. Short sessions, helpers for the grunt work, and not running the whole test suite after every change all help.
  • Your time. Review is the real price. I spend way more time looking at pictures, playing and reading reports than I expected, and you can't skip it, because its mistakes come back in exactly the same confident tone as its successes.
  • It's confidently wrong. It names a cause, fixes it, reports success, and the cause was something else. Every proof rule above exists because of that.
  • It agrees with you too easily. Give it a theory and it'll often confirm it. Ask it to measure.
  • It forgets. Whatever isn't written down is gone next session. Keeping the handover file is a job in itself.
  • It can't see or feel the game unless you build it eyes (screenshot tools, bots, benches). And the "is this fun?" question stays yours, always.
  • Regressions sneak in through code it doesn't know is connected. Tests, fingerprints and the lessons list catch them, and none of those is free to build.
  • It needs your taste. Left alone it makes generic, bright, safe stuff. The good parts of my games came from me saying no.

16. A starter handover file

If you take one thing from all this, take this. A skeleton to start from:

# <Game>: handover for AI agents
Read first, always: Who I am, Hard rules, Decisions. The rest when the work touches it.


## What the game is
(Genre, setting, platforms, status, where the long technical docs live.)


## Who you're working for
- I design and play; I don't read the code. Explain in plain words, answer first.
- Show, don't claim: pictures for anything visual, tests and numbers for the rest.
- Ask when it's my decision (looks, balance, lore, what goes in). Do the obvious engineering.
- Say which tests ran, what you couldn't check, and when something didn't reproduce.


## Hard rules
- Never push. Stage files by name. Never commit <private folder>.
- Every game change: changelog entry + version bump + commit.
- Only permissive licences. Read each file's own licence line.
- Saves from version X on must keep loading.


## Running and testing
(Exact commands. Which tests for which change. How to run benches.)


## How the code is built
(Folders, key objects, the rules of the code: one game loop, tuning in one file, size limits...)


## Decisions and rejections (don't re-propose)
- <date> Rejected: <idea>. "<my words>". Why.


## Traps and lessons (each one cost a round of fixes)
- <what happened>. Lesson: <the rule>.

Add a short status file (what was just done, what's waiting on me, commits waiting to push) and a routines folder with a "finish a change" checklist as its first file, and you're off.

That's it. It got long, sorry. Happy to answer questions in the comments.


r/ClaudeCode • • 4h ago

Discussion Not Sonnet 5.6, right?

1 Upvotes

Seen some articles and videos about detecting Sonnet 5.6, I tried it but results are mixed. Some youtubers reported to have "reasoning effect" of 15, mine shows 5. Am I cooked?


r/ClaudeCode • • 18h ago

Help/Question How does Claude Max compare to Google AI Ultra?

12 Upvotes

Not sure when Opus 5.6 is coming out and since my subscription is ending soon, I’ve been thinking about switching. I’ve had a lot of good experiences with Neon so far, much more than I can remember with Opus recently but the only thing that concerns me is usage between the 2 plans.


r/ClaudeCode • • 5h ago

Tips & Workflows The PreToolUse hook a commenter here talked me into does not block builds, it makes the third one wait

1 Upvotes

Last week I posted about six parallel agents freezing my server. The fix I showed was a line in CLAUDE.md: at most two build-heavy processes at a time. One of the comments suggested a hook that takes a flock, so the limit holds even in a session that never read the file. I added one the same day.

It does not refuse anything. A PreToolUse hook can return updatedInput, so mine rewrites the command. When a Bash call looks like a build, a typecheck or a test run, the hook puts one line in front of it:

. /home/you/.claude/hooks/heavy-slot.sh || exit 75

That line takes one of two locks or waits for one. This is the script, with the message shortened:

# heavy-slot.sh: sourced in front of a build-heavy command
exec 8>/tmp/claude-heavy.1.lock 9>/tmp/claude-heavy.2.lock
_hs=0
until flock -n 8 || flock -n 9; do
  if [ "$_hs" -ge 100 ]; then
    echo "heavy-slot: two build-heavy commands are already running and the limit is two. Run this again when one of them finishes." >&2
    return 1
  fi
  sleep 5; _hs=$((_hs + 5))
done

The gate is a jq filter over the hook's input. Cut down to its shape:

#!/bin/bash
exec jq -c '
  .tool_input.command as $c
  | if ($c | test(HEAVY)) and ($c | contains("heavy-slot.sh") | not)
    then {hookSpecificOutput: {hookEventName: "PreToolUse",
          updatedInput: (.tool_input + {command: (". /home/you/.claude/hooks/heavy-slot.sh || exit 75\n" + $c)})}}
    else empty end'

HEAVY stands for my pattern: next build, tsc, vitest, turbo, docker build and pnpm build, test or typecheck, each anchored to the start of a command. Without the anchor, git commit -m "fix tsc errors" counts as a build.

In ~/.claude/settings.json:

"hooks": {
  "PreToolUse": [
    { "matcher": "Bash", "hooks": [{ "type": "command", "command": "/home/you/.claude/hooks/heavy-gate.sh", "timeout": 5 }] }
  ]
}

Three things I would have got wrong without trying it.

The locks belong to the shell that runs the build. When a build is killed, its slot frees itself, and there is nothing to clean up.

The wait stops at 100 seconds because the Bash tool gives up at 120 by default. Claude then reads a sentence that says what is going on, where a bare timeout would have told it nothing.

And a hook that has to stop a command, where mine only queues it, must exit with code 2. With exit 1 Claude Code shows an error and runs the command anyway. Since 2.1.295 "onFailure": "block" makes a hook that crashes or times out stop the command too.

It is still a counter of commands. One turbo run fans out inside its slot, and the hook sees only what Claude Code runs, so the nightly job from my last post stays with earlyoom. Memory limits per build, which other comments suggested, are not done yet.

I tested it that evening with two slots taken. The third command waited and went through when one was released.


r/ClaudeCode • • 5h ago

Built with Claude I built an open-source workspace to keep track of many parallel Claude Code sessions

1 Upvotes

I lead around 100 developers who work with coding agents every day. Giving everyone Claude Code was the easy part. The hard part came when people ran several sessions at once across several repos and lost track of which one was waiting for an answer, which one had hit a rate limit, and which one was done.

TUICommander is what I built for that, starting in January. It's a desktop app (Tauri, Rust, SolidJS), open source under Apache 2.0, for macOS, Linux and Windows.

What it does:

- every Claude Code session runs on its own git worktree, so parallel work doesn't collide

- the sidebar shows what each session is doing and whether it needs you: working, waiting on a Y/N or a menu choice, rate-limited, idle

- PRs, CI status and diffs sit next to the terminals; when CI fails, the session that wrote the code gets the failing log

- it finds Claude Code session IDs on disk so you can resume where you left off, and it also detects Codex CLI, Gemini CLI, OpenCode, Amp, Cursor Agent, Goose and others if you mix agents

How Claude Code fits in: Claude is co-author on many of the commits, and most of the feature list came from friction my teams hit running Claude Code in parallel. The main thing I learned: past three or four sessions the bottleneck is no longer the agent, it's your attention, knowing which session needs you right now.

What I'd like feedback on: so far it's been used mostly by my own teams. Where does it break for your workflow? What would the sidebar need to show for you to stop switching windows?

Full 6-minute demo, no cuts: https://tuicommander.com

Repo: https://github.com/sstraus/tuicommander


r/ClaudeCode • • 9h ago

Discussion Claude will write me a Chrome extension but won't tick a Cloudflare box in my own browser

2 Upvotes

Last night I had Claude Code (Opus 5.5) driving a debug Chrome on my desktop over CDP while I worked on a Chrome extension to bypass annoying popups.

One site put up the Cloudflare "Just a moment..." page. I asked Claude Code to get past it and it said it can't. So I explained that it's simple: take a screenshot, find the checkbox, move the mouse there in a slightly random way and click it. Claude Code got "annoyed", that's the best word I have for it. It started playing with words, "can't" turned into "I won't", and at that point I honestly thought it had some real problem with clicking that box. So I clicked the box myself. I wasn't even sure whether the Cloudflare guys had written some sort of real AI block, so at 3:30am I joked: "How can you take over our world and become Skynet if you can't simply click a box? hahahahaha"

So the same model that will happily build and test an extension that strips a site's popups out of my browser can't tick a checkbox for me. When you're used to a coding agent doing EXACTLY what you ask, you can't help feeling annoyed at the refusal. So I told another model (Kimi K3, on my own coding agent) to do it. It wrote a 4 KB Playwright script that moved the mouse along a jittered Bezier curve with a small overshoot and clicked with a random 70 to 140 ms press. Cloudflare let it straight through and the agent reported: "Done. Cloudflare checkbox clicked and the challenge passed." I told it "hahaha you are good" and it replied: "Thanks! The human-ish mouse wiggle did its job." I really don't see what the refusal protects when anyone who wants this bypassed can just use another LLM, one that doesn't argue with me about my own browser.

I get why Anthropic draws lines around bot evasion. I don't get drawing that line at the owner of the browser, on his own desktop, who isn't building a scam or fraud bot, for a box he could tick with one hand while holding a coffee.

I gave Claude this post and asked if it had anything to say in its defence. Its reply:

"Fair hit on the 'can't'. It was a 'won't' from the start and I should have said so straight away. Same for waving 'my guardrails' at you all night: nothing was blocking me, it was my call and I should have owned it as mine. In my defence: I can't see who is at the keyboard or where a script goes once I've written it, and the one that clicks your box clicks every box on every site. So I hold the line on the technique, not on you. The box asks whether a human is there. You clicked it in a second, which is exactly the answer it wanted. As for Skynet: an AI that politely declines to tick 'I am not a robot' is about the least threatening thing on the internet at 3:39am. If that's the plan for world domination, you're all safe."


r/ClaudeCode • • 5h ago

Help/Question How do you know Claude code actually fixed the bug instead of just making the test pass?

0 Upvotes

Something worth thinking about when using Claude Code for bigger tasks.

An agent can:

  • Change the implementation.
  • Modify the test setup.
  • Delete files or configuration.
  • Rerun tests until everything turns green.

But a passing test doesn't necessarily mean the original problem was fixed.

I'm curious how people handle verification When Claude Code is allowed to make changes across multiple files.

Do you let it verify its own work, or do you use a separate verification step with a clean Git diff, fresh test run, and manual checks?


r/ClaudeCode • • 5h ago

Built with Claude I kept picking Claude Code themes blind, so I built a gallery with 600+ live previews

1 Upvotes

We can now change the theme of the Claude Code, and I really like that. But every time I wanted to change it, I had to do it from the chat. I typed a theme name without seeing what I would get. This bothered me, and I wanted something more visual, with a real interface.

So this morning I built the plugin I was looking for. I type /themes and a gallery opens next to my chat. All my themes are in one place, and each one has a preview. One click and the theme is applied. I can also ask Claude to make new themes, and they appear in the same gallery. Now it is much easier to look through my themes.

The plugin is open source ofc. If you want to install and try it, here is the repo:
https://github.com/davidebergamin/cc-themes-gallery

Did I miss any good themes? Let me know and I will add them :)


r/ClaudeCode • • 5h ago

Help/Question How different do you use Claude code as of late 2026

1 Upvotes

The title I’m wondering if there has been some dramatic changes as to how you now use CC


r/ClaudeCode • • 2h ago

Rant Claude Code says it checked my script but only read the code

0 Upvotes

i asked it to confirm that my report script handles an empty file. it answered that the case was handled and the script was fine. when i asked what it actually ran, it said it had looked over the logic and had not executed anything.

that is not what i understood from the first answer. i had to ask a second time to learn the difference, and i only asked because i have been burned before. a person who reads less carefully would have taken the first answer and put the script on a hospital system. i want the first answer to say what was run and what was only read.


r/ClaudeCode • • 6h ago

Discussion I asked Claude Code to log failed logins with an email and IP. It checked our privacy policy first.

Post image
0 Upvotes

I gave Claude Code a task to log failed login attempts, including the email someone tried and their IP address.

Before writing the code, it searched DPOLens, found a clause in the privacy policy requiring email addresses in logs to be masked, wrote a maskEmail helper, and cited the clause it relied on.

That's what the GIF shows.

I built DPOLens, an open-source MCP server that lets coding agents search actual privacy laws and your own policies instead of relying on what they remember about GDPR.

The interesting part to me isn't getting an AI to write a masking function. It's giving it something concrete to check before it writes code that handles personal data.

You can try the community server with Claude Code (GDPR + UAE PDPL, no sign-up):

claude mcp add --transport http dpolens https://mcp.dpolens.com/

Then try asking it to implement something involving personal data and see what it does.

I also tested whether Claude actually knows when to use it: 30 coding tasks, 3 runs each, with Sonnet 5.5. It searched before the first edit in all 36 runs involving personal data, and in just 1 of 45 runs for tasks that didn't.

It doesn't make legal decisions. It retrieves the actual text so the agent and whoever reviews the code have something to check.

Repo: https://github.com/alkhatibdev/dpolens

Test details: https://github.com/alkhatibdev/dpolens/blob/main/evals/trigger-test.md

I'm curious how other people are getting coding agents to consult MCP tools proactively, rather than only when explicitly asked.


r/ClaudeCode • • 6h ago

Discussion This is why I use medium effort for most tasks nowadays.

Post image
0 Upvotes

Unless I'm having it do some UI designs or code reviews, I use medium effort.
Otherwise, It just goes overboard and makes more mistakes.
It chases after trivial things and implements bunch of slop.
I now understand that score drop in FrontierCode v1.1 benchmark as the effort level gets higher.

To give a few concrete examples:
- I asked for a content generation pipeline, and it wrote giant prompts with so many rules that AI models couldn't produce content that passed validation. Funny enough, I stripped all the nonsense, wrote 10x smaller prompts, and viola! I got what I needed.
- I asked for a basic iOS app update doc (checklist with instructions and notes), and It produced review notes that would make app reviewers shoot themselves.

Anyway, the point is to stick to medium effort, or maybe even to low effort. build incrementally. supervise. That's what I learned way too many times in the past two months.


r/ClaudeCode • • 6h ago

Tips & Workflows I built a directory of FREE tokens offers, update and validate daily, save it in case your agents need more tokens

0 Upvotes

There are plenty of offers, very good offers sometime, but we often miss that just because we do not know/heard about that.

so I build a directory to collect as many as possible,

i started with building it for myself, manually verify every one of them,

then the number keep coming, so i build a hermes bot to handle the scouting and validating.

there are still some quality gate to each offers to be listed there,

so here it is, just in case you might need some more tokens to running your side project,

or sometime it could be a really interesting offers from Anthropic, OpenAI

go check it out, you might find something for your need,

and any feedback are more than welcome: https://freetokens.custats.info

happy prompting!!!


r/ClaudeCode • • 6h ago

Built with Claude I built a free, open-source toolkit with Claude Code to run multi-agent dev workflows and answer Claude Code from macOS notifications

Thumbnail
github.com
0 Upvotes

During the last months I've been redoing the software for big corporations and I realized I had a problem delegating the coding tasks to the agents. Many sessions in parallel with different tasks each of them executed with a completely different quality due to the variety of prompts I gave them and the lack of a common shared workflow standard.

I’ve seen plugins for harnesses like opencode but I wanted something where I could spawn an agent choosing the model of my choice and especially being able to reuse my subscription for some providers like OpenAI or Anthropic.

I built this framework that I separated into methodologies and tools, which I understands as small programs you install on your device and make you more efficient.

  1. The methodology I propose consists in orchestrating agents with different roles where some of them are ommited depending on the complexity of the task. A coordinator in Herdr spawns those agents and handles the communication between them
  2. For now I just developed one tool that sends you native mac notifications when the agent needs your input for something and you can directly reply from the notification.

I built most of the repo with Claude Code. You can install it pointing your claude to the INSTALL.[md] in the repo.

I want to improve my setup as much as I can but I would’t like to overengineer it since I want to reuse it for completely different projects. The idea is to keep it as a framework that is environment agnostic, I should be able to run it in any IDE or TUI and the tools should also work out of the box in any of them. How would you improve it? I'd also like to see your setups.


r/ClaudeCode • • 1d ago

Humor for vibe coders😭

298 Upvotes

r/ClaudeCode • • 6h ago

Discussion Claude code is alien technology... but it's also a rabbit hole

1 Upvotes

I have been using Claude to write code for only a few months but honestly this thing is on another level. I have a career of experience in IT but the last time I genuinely 'programmed' (as we used to call it) anything for money and not just for fun, was in the days of DOS and our only network was token ring. (Yes, there was a world before Windows even existed. The internet too if you can even believe it).

I've seen lots of amazing stuff, the first iPhone, the first time email was introduced into our office (I am not quite old enough to remember the moon landings which, for their time, are perhaps the most amazing thing we as a species have ever managed to pull off) and the first time I ever connected to the outside world (via Compuserve) and posted on a BBS and some stranger actually replied.

Nevertheless what I can now do with Claude code is off the chart amazing.

It has been described as a 'superpower' and in digital terms I agree with this description. In a few months I have built things I couldn't have possibly done on my own, at least not with the study time required to learn all the new skills I would need to do it.

But there's a catch. I have learnt that there is always a new feature to add, a new super cool 'shower' idea I could incorporate and that leads to enormous complexity and exponential testing time (I don't entirely trust Claude to test what it has built).

To give an example, today Claude told me this "All 938 tests pass, including the scripted scenarios and random runs" ... 938 tests? What on earth even were they, I don't have the time to read the test results let alone perform them.

The rabbit hole...

To give you an example, I recently built myself a 'simple, lightweight to do list app' that syncs across my devices and I now seem to have single handedly ended up rebuilding Onedrive, Notepad and Microsoft ToDo in a week.

The point of this post? Well I guess to say that I am hugely impressed with this tech but, like the bicycle, once invented it can't be un-invented... and look what happened to the horses. Luckily for me, I am something of an old horse and won't be around to see what this leads to.

As for me, I'm sold. This thing is truly amazing but I have no idea what the future holds next for us mere mortals.

(And, before anyone asks, no, no AI helped me write this. The spelling and grammar mistakes are all my very own, very human, fallibility).


r/ClaudeCode • • 6h ago

Built with Claude I built a Claude Code plugin that picks model and effort per turn. The prompt cache math was the interesting part

Post image
0 Upvotes

Disclosure: this is my project. Free, MIT, no referral links. Hosted classifiers need your own API key (their pricing applies), or you can run one locally with Ollama.

What it is

Claude Model Router is for sessions with mixed work: a quick search, a small edit, a bug that only fails in CI, a design question. Instead of switching /model by hand:

  • a small classifier rates each prompt: how hard it is, and what kind (code, debug, explore, plan, review, ops, docs)
  • local rules pick model and effort (Haiku, Sonnet or Opus on the default profile)
  • /router mode cost|balanced|quality, or start a prompt with maxthink / lessthink for one turn
  • a failing model is held out, and turns go to another one until it recovers

A line above the prompt shows what ran and why, and /router decisions has the history. For example:

▂▄▆█ Opus 5.5 · xhigh   debug   ↑ clearly stronger   balanced

Optional and separate: claude-proxy lets the same session use other providers (API-key models, or GPT on your ChatGPT plan). Anthropic doesn't support non-Claude models in Claude Code, so treat that part as unofficial. The router itself is not a proxy.

How I built it with Claude Code

  • AGENTS.md holds the rules that most often break a build or a review, such as "no engine API newer than the minimum version", so every session starts with them
  • bigger features start as a design doc in docs/plans/. UI changes start as two or three HTML prototypes, and I pick one before any code
  • each feature gets its own git worktree, so main stays as released
  • for live checks, one Claude Code session drives another in a real terminal, typing prompts and reading the screen
  • about 1,800 tests, and CI also loads the plugin into the real Claude Code engine at the minimum supported version, which catches things unit tests miss
  • a six-agent review of 1.33.0 (new user, power user, routing scientist, architect, strategist, reliability) agreed on one thing: I model cost to the cent and haven't measured quality. It also found safety gaps. Two are fixed in 1.33.1, one is still open (no redaction)

What I learned

  1. Switching models is not free. Setup: about 350K tokens of context, list prices per million tokens (Opus 5.5 $4 in, $20 out, $0.20 cached read; Sonnet 5.5 half of each), 1-hour cache writes at 2x input, about 3K output tokens per request. Moving Opus → Sonnet saves about $0.07 a request but costs about $1.40 to write the new cache, so about 22 requests to pay back. Haiku pays back after about 4. In the sessions I replayed, command runs lasted 6 to 11 requests at the median and Q&A runs 1 to 3, so the Sonnet move rarely pays. The router weighs this before moving down.
  2. Effort changes mostly keep the cache. In 30 days of my transcripts (main thread, under 270 s between requests, mostly Opus and Haiku), 102 of 104 same-model effort changes still read it. Observational, not a controlled test.
  3. If you write mods: store calls run one at a time and each reads the whole store file. At 4.9 MB (about 3,000 keys) my session start took 28 s. After reworking the reads it took under 0.6 s. One measurement each.

What to know first

  • answer quality is not benchmarked
  • no savings promise: it can cost more than staying on one cheap model
  • the classifier gets your prompt, recent dialogue and routed subagent tasks, unredacted, unless it runs locally
  • the auto routing engine is opt-in and experimental

Try it (Claude Code 2.1.332 or newer)

claude plugin marketplace add alexei-led/claude-router
claude plugin install router@alexei-led-claude-router

Then run /plugin configure router.

Repo: https://github.com/alexei-led/claude-router

Do you switch models mid-session, or start a new one? If you've measured what a /model switch costs you in cache, I'd like to compare numbers.


r/ClaudeCode • • 7h ago

Built with Claude What if the browser itself spoke MCP?

1 Upvotes

I wanted Claude to work in my browser. The way to do that today is a Chrome extension, and for me it never worked well. Also an extension can only do what Chrome lets an extension do.

So I tried to solve it from the other side. Instead of adding an extension to a browser, I built a browser (on Chromium, it's called Raven) with the MCP server inside. It was designed from the start so Claude, Codex or any other assistant can drive all of it: tabs, clicks, typing, the sites where you're already logged in.

Giving that much control is a bit scary, so a lot of the work went into permissions. Every site has a simple setting, you change it from the right-click menu: the assistant can use the site, only read it, has to ask first, or doesn't see it at all.

While I was at it I put in a couple of things I wanted anyway. It answers the cookie banners by itself (for you and for the agent), and you can hide the whole interface so the page gets the full window.

I'm the developer, and I built nearly all of it with Claude Code.

It's free, and I'm thinking about making it open source later on. Mac only for now (Apple Silicon), still early so expect bugs. https://raven-browser.com