Coding With ADHD: The Complete Survival Guide
I have ADHD and autism. I taught myself to code and shipped 160+ projects in 8 months. Not despite my brain. With it.
This guide is everything I wish someone had handed me on day one. No “just use a planner” advice. No pretending willpower is a strategy. Just what actually works when your brain refuses to cooperate with how programming is “supposed” to be done.
Why coding with ADHD feels impossible (and why it isn’t)
Programming demands sustained attention, working memory, planning, and tolerance for boring setup work. ADHD attacks all four. That’s the bad news.
The good news: programming also rewards pattern recognition, novelty-seeking, rapid problem-solving, and the ability to sink into a problem for six hours straight. ADHD brains are unusually good at all of those.
The trick is not to fix your brain. It’s to build a workflow where your brain’s defaults are features, not bugs. Let’s go through the four big walls, one at a time.
Problem 1: You can’t start
You know exactly what to do. You’ve known for three days. You are physically incapable of opening the editor.
This is executive dysfunction, not laziness. The task-initiation circuit in an ADHD brain needs more activation energy than a neurotypical one. So lower the activation energy instead of trying to summon more willpower.
Tactics that actually work
Shrink the first step until it’s stupid. Not “build the auth system.” Not even “write the login function.” The task is: open the file. That’s it. Once the file is open, momentum usually takes over. If it doesn’t, the next stupid step is: write one comment describing what the function should do.
Leave yourself a broken build. End every session mid-task, ideally with a failing test or an unfinished line. Tomorrow-you doesn’t have to decide what to do. Tomorrow-you just fixes the red thing. Deciding is the expensive part; skipping the decision is the hack.
Use an AI assistant as your starter motor. This changed everything for me. When I can’t start, I describe the task to an AI in one messy sentence and ask it for a skeleton. Reading and fixing generated code takes a fraction of the activation energy that a blank file demands. My brain will happily criticize code it refuses to write. Use that.
Body doubling. Code on a call with someone, or in a focus room, or next to a friend doing their own work. It sounds ridiculous. It works absurdly well. It’s one of the main reasons we’re building a community of ADHD devs at TheOnes — join us if you want people to not-talk-to while you work.
Timer, but tiny. Forget 25-minute pomodoros if they feel heavy. Set 10 minutes. Anyone can do 10 minutes. You’ll usually blow past it, and if you don’t, you still did 10 minutes more than zero.
Problem 2: Hyperfocus (the gift that bites)
Hyperfocus is why ADHD devs can outbuild entire teams on the right day. It’s also why you looked up at 4 a.m. having refactored a module nobody asked about while the actual deadline burned.
I wrote a whole post on this (ADHD hyperfocus and programming: superpower or trap?), but the short version:
Steer it, don’t fight it
Aim before you fire. Hyperfocus locks onto whatever is in front of you when it starts. So control what’s in front of you. Before a session, put exactly one task on screen and close everything else. If the wrong thing captures you, at least make the wrong thing hard to reach.
Set exit tripwires. Alarms don’t work; you’ll dismiss them without noticing. Use tripwires that force a physical break in the loop: a calendar event with another human, a kitchen timer in another room, an app that hard-locks the screen. Something that can’t be swatted away with muscle memory.
Pay the body tax up front. Water, food, bathroom before you dive. Hyperfocus suppresses every bodily signal. You cannot rely on noticing hunger at hour five.
Commit before you surface. The most painful part of hyperfocus is the crash afterward, when yesterday’s brilliant session is an uncommitted mess you no longer understand. Commit small and often during the session. Your working memory will not survive the night. Git remembers so you don’t have to.
Problem 3: Context switching destroys you
A neurotypical dev loses maybe 15 minutes to an interruption. An ADHD dev can lose the whole afternoon. The context you were holding doesn’t page out gracefully; it evaporates.
Defend the context
One goal per session. Not three. One. Write it on a sticky note or at the top of a scratch file: “Make the webhook retry on 500s.” When you catch yourself doing anything else, the note drags you back.
Externalize state constantly. Keep a running scratchpad next to your editor: what you’re doing, what you just learned, what’s next. When (not if) you get interrupted, the scratchpad is your save file. Reloading from it takes 2 minutes instead of 40.
Batch the interruptible stuff. Slack, email, code review pings: pick two windows a day and let them pile up outside those windows. ADHD brains can’t “quickly check” anything. Every check is a full context flush.
Make re-entry mechanical. After any interruption, don’t ask “where was I?” Ask “what does my scratchpad say?” Then run the tests. Red tests are a breadcrumb trail back into flow.
Let AI hold the context. This is the underrated superpower of AI-assisted coding for ADHD. A long-running chat with an AI assistant is an external working memory. After an interruption I re-read the last few exchanges and I’m back. The model remembers the plan, the constraints, the dead ends we already ruled out. My brain doesn’t have to.
Problem 4: Your memory lies to you
ADHD working memory is a leaky bucket. You will forget the clever fix you didn’t write down, the reason you chose library A over library B, and the deploy step that isn’t in the README.
Stop trying to remember. Build a system that remembers for you.
The external brain
Decision log. One markdown file per project: date, decision, why. Takes 30 seconds per entry. Six weeks later it’s the only reason you know why the architecture looks like that. I keep one in every one of my 160 projects and it has saved me hundreds of hours.
Commit messages as diary. Write commit messages for amnesiac-future-you: not “fix bug” but “webhook retried forever because we compared string status to int; cast before compare.” git log becomes searchable memory.
READMEs with a “how to resume” section. Every project gets a section that says: how to run it, what’s half-done, what to do next. Because you will drop this project for three weeks, and the difference between resuming and abandoning is whether re-entry takes 5 minutes or 5 hours.
Automate the rituals. Anything you must remember to do, you will eventually forget. Linters, formatters, pre-commit hooks, CI, deploy scripts. If it matters, a machine should do it or check it. I build a lot of this kind of tooling; see what we use and make at /tools.
AI as an ADHD copilot, not a crutch
Some devs worry AI-assisted coding makes you a fake developer. I built an entire portfolio with AI in the loop, and here’s my honest take: for an ADHD brain, AI isn’t a shortcut. It’s a prosthetic for exactly the functions ADHD impairs.
- Task initiation: AI drafts, you edit. Editing costs a tenth of the activation energy.
- Working memory: the conversation holds the context you’d otherwise drop.
- Boring-task tolerance: boilerplate, config, test scaffolding: the parts most likely to stall an ADHD dev are the parts AI is best at.
- Learning: instant, judgment-free answers keep momentum alive instead of dying in a 40-minute doc-diving detour.
You still have to understand the code. You still make the architectural calls. You still debug the weird stuff. AI removed the friction that used to stop me from ever getting to those interesting parts. If you’re just starting out, I wrote a whole realistic guide to learning to code with ADHD built around this approach.
Build your environment, not your discipline
A recurring theme in everything above: successful ADHD devs don’t have more discipline. They have better environments. A few final environmental moves:
- Dark, quiet, boring workspace. Every visible object is a potential hyperfocus hijack.
- Phone in another room. Not face-down. Another room.
- Uniform project structure. When every repo looks the same, resuming any of them costs less.
- Tools that fit your brain. I maintain a full roundup of the best tools for developers with ADHD, including the ones we build ourselves.
- People who get it. The single highest-leverage change for me was finding other neurodivergent devs. If that sounds like something you need, that’s literally why TheOnes exists.
FAQ: coding with ADHD
Can you be a good programmer with ADHD?
Yes. Some of the most productive developers I know are ADHD. The distribution is just spikier: terrible at sustained boring work, exceptional at deep problem-solving and rapid learning. Build your workflow around the spikes and the numbers speak for themselves; mine were 160 projects and 4000+ commits in 8 months.
Is programming a good career for ADHD?
Better than most. Novelty, puzzles, fast feedback, measurable output, and increasing acceptance of async/remote work. The hard parts (meetings, estimates, long boring migrations) are real but manageable with the tactics above.
How do I stop getting distracted while coding?
You don’t, fully. You reduce the cost: one goal per session, notifications batched, a scratchpad to reload context, and a physical environment with fewer hijack targets. Aim for fast recovery, not perfect focus.
Should I tell my employer I have ADHD?
Personal call. Many devs disclose only the accommodations (“I do my best work in long uninterrupted blocks; can we protect my mornings?”) without the diagnosis. That gets you 80% of the benefit with none of the risk.
Does AI-assisted coding make ADHD devs worse at programming?
In my experience, the opposite. It removes the friction at exactly the points where ADHD kills projects: starting, boilerplate, and context recovery. You still need to read, understand, and own every line you ship. Treat AI as a copilot with infinite patience, not an autopilot.
I’m Wojciech, founder of TheOnes.io. AuDHD, self-taught, 160+ projects in. If any of this hit home, read my story or join the community.