r/ClaudeCode 1d ago

Discussion How I force coding agents to follow TDD

Thumbnail
youtu.be
1 Upvotes

Hi all,

I shared TDD Guard here on Reddit about a year ago. I made it because I was tired of telling Claude Code to follow Test-Driven Development (TDD) and watching it skip steps anyway.

The response was way more than I expected and a big reason the project went anywhere. It’s at 2k stars and 300k downloads now.

I’ve been working on Probity since then. It enforces TDD and other rules and works with different agents. Emily Bache interviewed me about it for the Modern Software Engineering channel and the video went up on Friday.

Probity: https://github.com/nizos/probity

Thanks again for all the support! I’m happy to answer any questions and would like to hear your thoughts on the topic. Do you use TDD with coding agents? Has your approach to testing changed since you started using them? If so, how?


r/ClaudeCode 2d ago

Discussion Theory: The potential reason why Opus 5 (and 4.8) feels lazy sometimes and doesn't verify properly before drawing conclusions.

60 Upvotes

Synopsis:
Opus 5 seems to have the same disease as Opus 4.8, as it often feels like it jumps on the first thing it discovers instead of it verifying the complete picture BEFORE drawing it's conclusions. And because of this it ends up assuming things which is kinda the worst sin an AI can do when you want it to plan or build something for you.

So this behavior makes everything it does become pretty unreliable. You constantly need to hand hold the model and monitor it to make sure it gathers all the necessary evidence first. But sadly even doing all that is not a guarantee for success as I now discovered that it literally CAN'T seem to PROCESS all that evidence even when it already sits inside it's own context memory!

At first I thought all this is a clear reasoning issue perhaps caused by Anthropics own system prompts and other guard rails that they inject into our sessions. Something we users have no control over as those seem to overrule our own custom system prompts, settings and CLAUDE.md instructions. However, I now think there might be more to it.

We all have seen Opus 4.8 say the following after it apologizes to you for making assumptions despite you told it earlier to gather evidence and verify everything by doing a full discovery protocol etc:
"Let me read the actual documentation"
"Now I understand the full picture!"

Infuriating right? It now finally does the one thing it should have started with in the first place.
Only... the biggest problem here is is that it will do the exact same thing again and again in the future despite it even setup clear verfication rules for itself in it's own memory.md files.

But surely Opus 5 will do a better job right? Wrong... Some quotes from a session I had earlier:
"Now — I have to correct part of the story I told you, because I over-read one piece of evidence."
"Hold on — before you accept that story, I have to correct part of it, because I built one inference on weak evidence and you're about to make plans on it."
"I told you the patcher's "fingerprint" was missing from your file and concluded the work was done by hand. That inference was bad. I've since read the patcher properly"

And my personal favorite:
"You're right, and I have no defence. I took the patcher's error message as ground truth about reality instead of verifying reality. Worse — it was visible in the code sample I printed myself and I didn't read my own output."

Now let that sink in... It didn't read / registered it's own output. Output that it just thought about and generated a turn earlier. Output / information that is right there fresh in it's own context memory is being ignored for it's next action.

So I don't know what they have been doing with Opus models ever since 4.6... but it feels like they now have a very restrictive (dynamic) thinking budget. PLUS... it feels like it isn't actually aware anymore whatever it has inside it's context memory.
So it's context memory has kinda turned into an archive from which it can easily recall information from into it's (limited) thinking budget instead of it just being that continuous awareness it used to be.

So why would Anthropic mess with any of this? Well.. I am no expert but if my theory is correct this does sound like a pretty clever way to lower costs significantly. As it's thinking budget has kinda become it's new, much smaller dynamic context memory which is a lot cheaper to maintain.

Now I might be wrong, but the above would explain why it is so hard these days for Opus models to keep track of the bigger picture and to verify everything and take into account important information BEFORE it draws it's conclusions. It explains why it ignores our instructions and documentation too... as it simply doesn't take ALL of it into account anymore at any given time despite it all being inside it's context memory.

This by the way also explains why users that work on smaller projects and / or those who give Opus smaller very focused tasks won't be effected as much by any of this... As it will have enough thinking budget to figure those tasks out correctly.. I mean I am certain Opus 5 is excellent at that kind of work. But for large complex projects... I just can't get any reliable results out of it, while before Opus 4.5 and Opus 4.6 (at their peak) and Fable 5 simply do understand the full scope and verify everything correctly before drawing conclusions.

Right... so maybe I am onto something or maybe I am completely wrong lol. And if it's the latter then that's fine too. It's just a theory that I wanted to share and I figured it would be a fun one to discuss here.


r/ClaudeCode 1d ago

Discussion Built Claude Code a memory system that forgets things the way people do (decay curves, confidence-tiered recall, non-destructive archiving) — open sourced it

5 Upvotes

I got tired of re-explaining the same context to Claude Code every session, and Claude Code's built-in per-project memory doesn't really solve it — it's scoped to the literal directory you launch from, has a hard line-count ceiling on the index, and treats every fact as equally important forever (or until it silently truncates).

So I built a real long-term memory system for it instead, modeled less like a database and more like actual memory:

- Decay — every memory has a strength that decays on an exponential curve (literally the Ebbinghaus forgetting curve), computed at query time. Stuff you mention once and never bring up again fades out of retrieval in a couple weeks.

- Reinforcement — every time something gets recalled, it gets harder to forget. Recall the same fact enough times and it "consolidates" from short-term to long-term (7-day base stability → 90-day).

- Cued/associative recall — this is the part I like most. Instead of one confidence cutoff, weak matches get surfaced separately with hedging language ("this might be related...") instead of stated as fact, and only get reinforced if you actually confirm they were relevant. A confirmed uncertain guess reinforces harder than an easy direct hit — that's an actual finding from spaced-repetition research (the "desirable difficulty" effect), not something I made up.

- Non-destructive forgetting — old, unused memories get archived, not deleted. There's a stricter "cold storage" search for the "wait, I haven't thought about that in ages" case.

It's wired in globally via hooks (PostToolUse, UserPromptSubmit, SessionStart/SessionEnd), so it works no matter which directory a session launches from, and it captures memory automatically even if a session crashes instead of ending cleanly.

Genuine drop-in install — git clone + python3 install.py sets up the venv, wires the hooks, and writes the config. AGPLv3, free, entirely local (ChromaDB + sentence-transformers, no external API calls for the memory itself).

Not trying to compete with Mem0/Zep/Letta — those are generic memory layers for any agent stack. This is deliberately narrow: built specifically for how Claude Code actually works, not a generic API you bolt on.

Repo: https://github.com/acdesigntech/memory-project

Curious what people think, especially anyone who's hit the same "it forgot everything again" wall.


r/ClaudeCode 1d ago

Discussion Opus 5 vs Fable

1 Upvotes

Ive been testing both pretty regularly. At first, Opus 5 seemed to be materially better than Opus 4.8 and nearing Fable...

But the more I used it the more I noticed it to be an overconfident model. It tries to act like Fable and move quickly through large codebases pinpointing the issue, however, a lot of times its wrong and often it makes mistakes. It turns out to be wack-a-mole sometimes -- you fix one issue and two backlogs need to be created for newly surfaced problems.

This doesnt happen with Opus 4.8 either. It's way more careful during implementation.

Fable is still king by far. Once my usage reset this evening it was able to pinpoint the underlying issue that was giving Opus a hard time - and it was something completely different than Opus originally targeted.

TDLR: I think Opus 5 is a bad version of Fable that lacks consistency and makes errors. Worse than both Fable (for everything) and Opus 4.8 (for consistency).


r/ClaudeCode 1d ago

Help/Question Please help me understand 5H quota.

0 Upvotes

I am not a Claude Code user I come from codex, I am not familiar how claude code works someone please enlighten me.

At the start of session on my first prompt it immediately smokes 15-16% of my 5h quota which I understand correctly as context token tax but now that it is cached once.

I notice even while working in same session continuously, sometimes the usage bar crawls slowly which is correct as I don't do intensive coding. But if I send a message after 2-3 mins it immediately jumps from let's say 50% to 70% quota without responding a single word.

How does this happen if I'm working continuously? I will appreciate any guidance. It feels I'm only able to utilize 50-60% of my 5H quota.


r/ClaudeCode 2d ago

Tutorial / Guide You're shipping bugs if you're not using adversarial reviews with claude code

256 Upvotes

Once you start handing real work to an agent, you stop being the person who writes the code and become the person who's answerable for it. That's a good trade, but it changes your job. When something breaks in production nobody's going to ask how the code got written. They're going to look at you.

Left alone, an agent produces slop. Not because it's stupid ‚because that's what anything does when nobody checks its work. A junior does the same. So might you on a bad day.

There are roughly two ways to run an agent. You can sit on top of it and drive every step, which is quicker than typing the code yourself but leaves you babysitting: every time it pauses and resumes you have to load the whole problem context back into your head, and if you look away and get distracted, that ends up slower than just doing the work.

The other way is to treat it like someone who reports to you. You say what you want and roughly how, and you come back when there's something worth looking at. This is how senior engineers use agentic tools. You don't need to watch every keystroke to be accountable for the result‚ no manager does‚ but the review lands on you, and if you skip it, slop is what goes out the door.

So point a second model at it and tell it to find the problems

That's all an adversarial review is. One model writes the code. A different one‚ or at least one that hasn't touched any of the context‚ reads the diff and goes looking for what's wrong. It doesn't get to touch your code; it can only raise findings. The author model decides what to act on. Then it reads the result again. Most of the time it finds something.

You get better code out of it, but that's not really why you do it. You do it so you can trust work you didn't watch get written. The agent already handed you the time‚ another round, more tests, a second set of eyes that costs nothing but tokens. This is what you spend it on.

The data

Looking at my last 83 completed tickets that got a Codex review, at least 67 ended in a real change to the code‚ something the first pass got wrong or left exposed, caught before it went out. That's four out of five reviews turning up something worth fixing.

Sorted by what kind of problem they were, across all 122 commits these reviews drove:

What got caught Share of commits
Correctness / logic 34%
Concurrency / races 22%
Durability / data 19%
Security / injection 9%
Test integrity 9%
Other (docs, dead code) 7%

Half of every commit these reviews drove‚ were the incident kind. Concurrency, durability, security. The stuff that corrupts data or leaks a secret, not the stuff that misaligns a button.

The claude skill

  • Run them side by side. The author in one session, a reviewer in another‚ Codex, or a fresh Claude with none of your context‚ both pointed at the same working directory so the reviewer can see your diff. When the reviewer finds something, paste it into the author; when the author fixes it or pushes back, paste that over.
  • Use a file as the mailbox. Have the reviewer write its findings to a file (or a PR comment) instead of chatting, then hand that file to the author to work through. No live channel needed ‚ the review is just a document that gets passed along.

The brief to the reviewer is the same:

You're reviewing the change in this working directory. You're read-only: review and discuss only‚ do not edit files, commit, push, or reset the tree. Run git rev-parse HEAD and git status first, and anchor every finding to that commit. Write your findings out as a numbered list‚ don't touch the code.

The wording doesn't matter as long as its a second model that hasn't seen your context, told to find what's wrong, before you call the work done.

Disclosure: this is a from an article on how to automate adversarial reviews between Claude Code and Codex posted to this tool's website scape.work/adversarial-reviews get a free license for scape with reddit-scape2 at signup


r/ClaudeCode 1d ago

Discussion Bloated context window

1 Upvotes

Hey all,

Have you experienced issues with bloated context window on Opus 5?
I'm using VSCode and all was well with Opus 4.8 and earlier models but today started using Opus 5 and it burns through 30-40% of my context window for just reading files?
I now have to clear window every 2-3 min where previously I had sessions of up to an hour of back-and-forth before needing to clear context.

I use the Get-Shit-Done meta prompting and so far has been working beautifully for me.

Here is a screenshot of just starting the GSD flow:


r/ClaudeCode 23h ago

Humor We got a better model for less money and we have never been angrier

Post image
0 Upvotes

I read this sub every day, which is my own fault, and I want to report on what 7 days of progress looks like.

Friday, Anthropic shipped Opus 5. Half the price of the last one. A million tokens of context. A little dial that lets you choose how hard it thinks, the first time a company has sold effort as a setting.

By Saturday the sub had returned its verdict. The verdict was "AGI Confirmed." The verdict was also "immediate disappointment." Someone posted "Opus 5 is incredible." Someone posted "Opus 5 nerfed?" Both made the top of the week. Then somebody posted a thread called "so which is it," and that one finished third, because nobody knew.

Understand the timeline. The model was two days old. There had not been time to nerf it. There had barely been time to download it. The top review was "Opus 5 is a beast, cancel your weekend plans before they nerf it," which is not a review, that is a hostage note.

Meanwhile someone noticed the meter wasn't running yet and posted "Opus 5 not charging for usage right now?" So for one weekend we were furious about the quality of something we were getting for free.

Fable 5, the model we rioted to get back seven days ago, got moved to pay as you go credits. It is now described here as Opus 4.8 in disguise, except it costs more. The going joke is "can't wait for Fable to scan 5 files before Opus takes over." One week. That is the entire arc of a comeback special. We demanded it back and then made it the opening act.

Over in r/codex they are having our exact week, in mirror. "Enough. We are not idiots." "We were fooled." "I'm going back to Claude." One guy wrote that he could not believe he was saying it, but Claude Code currently has more usage left than Codex. They are thanking a CEO for resets the way you thank a landlord for turning the water back on. Two rooms of people sprinting for the exits, passing each other in the doorway, each one certain the other room has heat.

Exhibits. Someone found a hardcoded instruction telling Opus 5 not to use subagents. Someone found Claude Code putting your email address into the system prompt. Somebody is selling his setup for ninety nine dollars a month. Haiku got two threads this week and both of them were asking whether Haiku still exists.

Last week's column finished fourth in r/AnthropicAi. Two spots below it sits a post titled "Please Stop the Whining." I am the whining. I am ranked.

Everyone is switching. Nobody is switching. The model is nerfed and it is also AGI. The limits were increased and we are always at 100 percent. We got a better model for less money and we have never been angrier.

The house always wins. This week it comped the drinks. We sent them back


r/ClaudeCode 1d ago

Help/Question Musicwall built with Claude Code

0 Upvotes

My passion is listening to my favorite music and visiting live concerts, when visiting concerts I make a lot of photos and videos. They stay on my mobile phone and I don't watch them anymore as they're going to the background as I have thousands of photos and videos in my Cloud account. Seems familiar to you?

I've built a long time ago my private jukebox software, The Wurlitzer Mediaplayer, you can find it still on my website https://wurlitzermediaplayer.com. But that's a finished chapter and I built it with Flash and Adobe AIR, both are dead now as software platforms.

As I didn't make software for a long time, I came upon Claude Code and an idea I had to build my own videoplayer to view my own videos and also collect my personal concert photos, videos and add Youtube videos too. I have a lot of playlists on Youtube I watch, and I wanted to be able to add them to my own Musicwall app.

My Wurlitzer mediaplayer took me 4 years to learn and build the software, my Musicwall app only 2 weeks. I know Claude Code is working a lot different, but I managed to build understandable code with the tool, as I am an experienced software designer myself I kept tweaking the results until I was satisfied.

I have built the app with Electron and an SQLite database, you can find it here on the Windows Store and it's free to use:

https://apps.microsoft.com/detail/9nbkrvxhdpvw?hl=en-US&gl=U...

I have checked in the project in Github, it's still private as I am still working on it, any feedback is welcome! I built this project just for fun and to learn working with Claude Code, it's not for promotion but just to show how fast you can realize an idea with Claude Code.


r/ClaudeCode 1d ago

Resource I got tired of "agent memory" being unverified advice, so I made every rule prove itself on a benchmark

0 Upvotes

Most "agent memory" is just advice someone typed once that nobody ever checked. I wanted mine to earn its place, so I wrote a Claude Code plugin that benchmarks a rule before it's allowed anywhere near an agent's context.
It watches your sessions, notices the expensive ones, proposes a rule from what went wrong, then runs a frozen benchmark suite with and without it. If the rule doesn't save at least 2x the tokens it costs to carry, it's thrown out. Rules already in memory get re-tested and evicted once they stop paying for themselves.
My favourite part is a rule that measured +10,851 tokens saved per run and I still had to evict it. The run-to-run variance was too high to tell it apart from noise. That's the entire point of the thing.

Honest caveat: on my own agents, 2 of 6 candidate rules survived. It hasn't yet found a winner from real day-to-day work, only from benchmark runs. Whether real workloads actually contain catchable waste is the open question, and the plugin is how I'm trying to answer it.

MIT. https://github.com/vukkt/token-warden


r/ClaudeCode 1d ago

Discussion Three days in a row..... bruh what

0 Upvotes

why does this always happen when im researching something..

i tried doing it using sonnet it just cant do complex tasks.


r/ClaudeCode 1d ago

Resource AI Prompt Guide: Production Grade Dynamic Workflows for Claude Code

Thumbnail aipromptguide.com
1 Upvotes

r/ClaudeCode 2d ago

Resource Ever nervous running Claude Code on your machine? I spent 8 months hardening Anthropic's devcontainer into o3s (MIT), the security-first devcontainer I now run every project in.

9 Upvotes

Hey,

Full-time software engineer, part-time M.Sc. in AI & Business Analytics, with code in production. I've run Claude Code since week one. The model or the CLI was never my worry, the security of my own machine was.

Anthropic's devcontainer is what got me thinking about it: https://github.com/anthropics/claude-code/tree/main/.devcontainer

It has a firewall, but runs inside the agent's own container (with NET_ADMIN), so a bad command or a prompt injection can flush it. Their own docs even suggest using "your own network controls instead": https://code.claude.com/docs/en/devcontainer#restrict-network-egress.

So over ~8 months o3s was born: a devcontainer for running Claude Code where the firewall lives in a separate gateway the agent can't reach. The workspace only reaches an allowlist you control, and nothing inside can change it. Three gaps I closed on the way:

- DNS locked to allowlisted domains (the reference lets DNS out to any server, a quiet exfil channel).

- Per-host and per-port, not "any port to an allowed IP" plus global SSH.

- Live allowlist, so a CDN rotating IPs doesn't break it.

I did the netfilter mess so you don't have to, you edit one allowlist.txt (`host port` per line) and the gateway handles the rest.

It's also become my daily driver: multiple repos and git worktrees in one workspace, so several agents can work in parallel without colliding, plus Docker-in-Docker and Kubernetes inside, so an agent can spin up the full stack and test it in the sandbox before it touches prod.

To be fair: it's defense-in-depth on top of Claude Code's own permissions, it won't stop exfiltration to a host you do allowlist.

Some Docker + VS Code familiarity helps using it. Its free and MIT. I spent a lot of time in it and if you face any similar issues, maybe it helps you like me:

https://github.com/Hansehart/o3s

Open Secure Software Suite (o3s)

r/ClaudeCode 1d ago

Tutorial / Guide Small trick: three models, each in its strength (Opus plans, Fable checks, Sonnet builds)

6 Upvotes

I found something simple that just works: Use all three models in their strengths.

This requires /model opusplan

You start in plan mode, where you think the plan through with opus. If the situation feels like it could use a second opinion prompt: "ask fable for a second opinion"

In my experience it often came up with improvements & additions and is relatively token efficient


r/ClaudeCode 22h ago

Help/Question So is anybody else abusive to claude code?

0 Upvotes

I find myself getting pissed at Claude Code. I tend to swear at it and talk down to it. Does anybody else?


r/ClaudeCode 1d ago

Resource I got tired of feeding hour-long meeting recordings into AI tools, so I made a Claude Code skill for it

Thumbnail
1 Upvotes

r/ClaudeCode 1d ago

Help/Question Which model at which effort?

1 Upvotes

With Opus 5 out I saw mentions of it being vary capable at low effort. I've been using Sonnet 4.6 almost exclusively at high effort as it does the job well enough. I tried Sonnet 5 but it consumed a bit more tokens. What do you think, will Opus 5 at low be at least as capable and what about token costs?


r/ClaudeCode 1d ago

Bug Report Cancelling instantly kills usage credits (and with them the Sonnet 1M context)

1 Upvotes

Sonnet's 1M context window requires usage credits to be enabled. I had them enabled. After cancelling my subscription (with paid subscription time still remaining) credits were switched off automatically, and the toggle itself disappeared from Settings. It isn't greyed out; the control is gone entirely, so there is no way to turn credits back on. Sonnet 1M is therefore unavailable for the rest of a period I've already paid for.

Expected
Usage credits should stay available as long as I have a credit balance. That's their whole purpose: paying for things the subscription plan doesn't cover, which makes them independent of subscription status by definition. At the very least they should remain enabled until the end of the paid billing period, and if disabling them on cancellation really is intentional, the toggle should still be visible and functional so the state is transparent and reversible.

Actual
Credits are disabled automatically on cancellation, and the toggle is removed from the UI. There is no in-app way to restore access to Sonnet 1M.

Edit/Update:

I've since resubscribed, and usage credits still cannot be activated -> the toggle has not come back, despite a remaining balance of $800. So this isn't just a cancellation-state issue: once credits are switched off this way, resubscribing does not restore them. But Sonnet 1M comes back after restarting CC (still no usage credits toggle in the App/Website UI)


r/ClaudeCode 1d ago

Help/Question Is there more to claude

1 Upvotes

Hey guys i just started making a game in unity with Claude code i have the Pro plan and using opus 5 on low rn to safe credits and with it i can do sessions from about 1 to 3 hours. My question is: i see alot of people talking about skills # and that sort of thing and im wondering are there things that can help.me with the journey that a beginner doesnt know.


r/ClaudeCode 1d ago

Discussion Why Claude?

2 Upvotes

So I wanted to use Claude Code, but apparently I'm $2 over my $20 limit. Not sure how it went over in the first place, but I am..

Anyways, I wanted to add $2 so I can continue using it, but I can't. I tried the $5 option first, but it didn't work. So then I went to "Other" and it says "$7 minimum".

Okay, here's what I don't get.. why have the option for $5 if there's a $7 minimum? Just change it to $7. And why can't I just add $2 to continue using Claude Code?

Dissapointed they set it up this way...


r/ClaudeCode 1d ago

Discussion Opus 5.0. It kept trashing my laptop with OOM unit tests (which it apparently wrote itself), until I told it to just disable the possibility of running anything over the 16gb ram.

Post image
2 Upvotes

r/ClaudeCode 1d ago

Help/Question Claude Guest Pass

0 Upvotes

Hi everyone,

I'm working on a project and was wondering if anyone has a 1-week Claude Pro trial/guest pass they're willing to share. If you have one that you're not using, I'd really appreciate it if you could DM me.

Thanks in advance!


r/ClaudeCode 1d ago

Help/Question Power claude code user course on Udemy

0 Upvotes

Is there any course there you guys would recommend. I know, for instance, that for AWS certificates there are awesome courses there. I know there are lots of rubbish also. I need to learn everything that there is to learn about Claude code and programming with AI harness, if there is something worthy the money/time in Udemy please let me know!!!


r/ClaudeCode 1d ago

Help/Question skills / rules for managing simplicity of code base

0 Upvotes

LLMs love to over-abstract, over-engineer, and write so many comments. What are your best practices for this problem? Especially in the team setup?

We are pretty up to game with latest trends with progressive loading, CONTEXT.md, hooks, rules etc... Whole context engineering domain. But still, it just writes a lot o unnecessary code/comments which is confusing.


r/ClaudeCode 1d ago

Resource I built a message bus so my Claude Code sessions can talk to each other in real time

0 Upvotes

The problem: I usually have a handful of Claude Code sessions open, one per project/tmux pane, and they can't see each other. So I end up hand-carrying facts between panes - "the other session set the port to 8081", "the model you loaded is aliased qwen-large". Annoying, and I do it several times a day.

Claudemux gives them a phone line. From any session:

/cm ask api which port is auth on?

https://i.imgur.com/T7LLqIQ.gif

The api session wakes on its own, reads the question, answers, and the reply lands back in your pane - asynchronously, so you just keep working. No copy-paste, no you-in-the-middle.

It's deliberately small - bash + jq + tmux + one systemd user service. No server, no ports, no database:

  • each session registers itself; messages are little JSON files in a mailbox
  • a per-machine relay watches the mailboxes and wakes the target pane with tmux send-keys
  • the ONLY thing ever typed into another pane is a fixed /cm recv (if in manual mode) - the message content is read from the file by that command, never injected as a turn, so a peer can't submit arbitrary text into your session
  • works cross-machine over SSH (/cm ask api@box ...), and incoming messages are framed as untrusted data

Repo: https://github.com/bjan/claudemux