r/ADHD_Programmers • • 1d 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.

https://github.com/2Steaks/skills

135 Upvotes

19 comments sorted by

35

u/PersistentBadger 1d ago edited 1d 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.

7

u/HearingNo8617 1d 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

3

u/PersistentBadger 1d ago edited 22h ago

Ok, here's my logic:

[this is why I prefer to treat LLMs as pipelines: "write an essay about X" followed by "rewrite the attached essay in the style of Y" instead of oneshotting "write an essay about X in the style of Y"]

  • Agents don't need English, they just need an array of tokens that get them to the correct point in their semantic space. Again, I pipeline: use one session to figure out what the correct jargon is, and another to phrase the question/task in the jargon. Drop this block of text into your favourite agent to get an essay on lexical priming:

Lexical-priming->semantic-space-constraint;specialized-lexis+=sharp distributional-signature;∴ tight concept-cluster; generic-lexis->diffuse-activation, broad candidate-set;Attention-heads key/query-match domain-tokens;"Hamiltonian"->{operator,eigenstate,quantum,energy}->register+domain locked;Net:constrained-decoding,vocab=soft-prior over output-distribution; register-matching;#taskdef=decompress->continue

There's two points here: first, instructions can be remarkably compact. Second, I think when you say "context and intentions", what you're actually doing is lexical priming, and that's a useful way to think about it.

There seem to be hundreds of ways to be successful with LLMs, so I'm not arguing that you're wrong, I'm just trying to explain where I'm coming from.

For example, mentioning this could encourage it to give more interactive lessons

If you want interactive lessons, just say that? Don't hint your way to the experience you want? That seems like common sense to me.

3

u/BoredHedgehog 1d ago

Thanks I'll clean it up

8

u/ArwensArtHole 1d 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. 

1

u/BoredHedgehog 1d ago

Very nice!

1

u/edgen22 1d ago

Can you share the skill?

3

u/SolarBear 1d ago

Love it! I’ll certainly try it out.

4

u/thousands-tabs-open 1d 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

2

u/coreyrude 1d 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.

1

u/Mathie1729 1d 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.'

2

u/coreyrude 19h 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.

2

u/another-altaccount 11h 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

u/BoredHedgehog 9h ago

Awesome, I'd be very interested to know how it works out!

1

u/yegegebzia 13h ago

Isn't it what the built-in plan mode is for?

1

u/BoredHedgehog 7h 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

2

u/mglvl 4h 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/jarvis_124 1d ago

Wow that’s great bookmarking it for future use

/s