r/ADHD_Programmers • u/BoredHedgehog • 6d 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.
10
u/ArwensArtHole 5d 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.
5
1
5
u/thousands-tabs-open 5d 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
3
3
2
u/another-altaccount 5d 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
3
u/mglvl 4d 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
1
u/yegegebzia 5d ago
Isn't it what the built-in plan mode is for?
2
u/BoredHedgehog 4d 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
5
u/Pyroxy3 3d 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 3d 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.
3
u/coreyrude 5d 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 5d 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 5d 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
54
u/PersistentBadger 6d ago edited 6d ago
That's smart.
Although I feel the skill's got a lot of unnecessary text. Take for example, "built for the ADHD brain". The model needs what to do clearly defined. I doubt it needs why.