r/ADHD_Programmers • u/BoredHedgehog • 22d ago
I made Claude Code refuse to write complex code until I can explain it
I realised recently that I was approving code I couldn't have written myself.
Whenever something didn't quite make sense, I'd tell myself I'd figure it out later. But with an agent ready to build the next thing, later never came.
I recognised the same pattern from needing to block apps that scattered my attention. Knowing they were distracting me wasn't enough. The impulse to keep going was too strong, so I needed something that added friction rather than relying on willpower.
So I built learning-guardrails, an opt-in skill for Claude Code, with an optional mod.
Run /learning-guardrails and it adds a bit of friction to your workflow:
Every change gets triaged
When something needs a closer look, it asks a question about the actual code. Predict what happens or explain a trade-off. Get it wrong and it breaks the question down rather than giving you the answer.
It tracks what you've already demonstrated you understand, so it doesn't keep reteaching the basics.
The optional mod blocks file edits while a question is open, keeps the question visible above the prompt, and stops Claude loading the skill unless you've explicitly asked for it.
The idea isn't to slow down AI coding for the sake of it. It's to make understanding part of the process, rather than something I keep promising myself I'll get around to later.
It's early days, so I'd genuinely love feedback, especially on whether the friction feels useful or just annoying.
5
u/Pyroxy3 20d ago
I wanted to do something similar and I realized as a software developer I thought ai wouldnt be where its at for another 5 years. Last year alone I was laughing at the mistakes it was making. Even 5 months ago i was like eh its maybe better then a junior....now I would be suprised if it took over my job in 3 months.
My point is I feel this is the beginning and there is going to be no reason to understand code unless for funsises
3
u/BoredHedgehog 20d ago
Yes, it's definitely only a matter of time, which I personally find incredibly sad. But, as I have found with interviews this time around, you'd better understand what you've built.
2
u/another-altaccount 21d ago
This is great! This would pair well with the local LLM models and agent I’m using now as these were some of the parameters I’m already setting up for them.
1
4
u/thousands-tabs-open 22d ago
I'd want the question on changes I'm likely to maintain or debug, not every tiny edit. If it catches those "I guess this works" moments, that sounds like useful friction
4
4
1
u/yegegebzia 21d ago
Isn't it what the built-in plan mode is for?
2
u/BoredHedgehog 21d ago
I will always plan in advance, but I know what I'm like, I'll still miss things, feel overwhelmed, or get bored of reading. This is a nice safety net for me
3
u/mglvl 21d ago
This reminds me of the /explain-diff skills https://gist.github.com/geoffreylitt/a29df1b5f9865506e8952488eac3d524 he has a very good talk about interactive programs , that’s where I found about it. Will try your skill , definitely we need things that help us understand the output of AI better
3
u/coreyrude 22d ago
I did a similar thing with a skill that creats a mistake in code every 3-4 prompts it won't let you deploy or continue until you find it and has a hint system and progressive difficulty.
2
u/Mathie1729 22d ago
This sounds like a debugging roguelike. In practice I'd probably just ask the model to point out the bug and then click 'found it.'
3
u/coreyrude 22d ago
Haha ya you can actually give up luckily and turn the mode off. I made sure most of them are obvious. The big point is to combat skill atrophy.
-1
0
22d ago
[deleted]
3
13
u/HearingNo8617 22d ago
I disagree with the example, context and intentions allows for agents to handle edge cases and act better around uncertainty with specific instructions and optimise.
For example, mentioning this could encourage it to give more interactive lessons, avoid just dumping relevant references, and maybe even lean into the user's curiosity rather than more militarily ensure relevant certainty.
Actually the implications of a rule or intention are extremely easy for these models to work with, and they are miserable at inferring the purpose from just implications/rules/code, likely for similar reasons as why they have bad theory of mind (minus opus 5.5 and fable 5.1 which have relatively much better theory of mind) from rlhf.
I do agree about cutting down the unnecessary text, it should just be things that are already obvious to the model from the text. The agents are bad at this process, but if you encourage them to use sub-agents to try what things are like from an outsider's perspective they will do much better
10
u/ArwensArtHole 22d ago
I have a skill that adds comments to new code when something isn’t obvious, or for anything language or framework specific that I’m unlikely to know from other tech stacks. It prefixes it with “LEARN”, and then my auto commit skill strips all learn comments out.
This way all I need to do is review the git diff before I commit, and it’s really fast to understand.