Ask HN: How do you get into a flow state when using AI to code?
Now, with slow agents like Claude, I find myself no longer working deeply.
What are you all doing to stay focused?
I’m quite sure I’ve left money on the table over the years as a result of my reluctance to manage and mentor junior developers. Disappointing that I’ve ended up managing junior AI developers who won’t even grow as a result of the time I’m putting into them.
I just watch YouTube in the downtime these days, or movies that I don't care too much about
Does that mean when I'm in deep thinking without any external "information inflow" I'm not "in flow state"?
I'd agree that waiting for replies kind of pulls you out of flow if you just sit and wait, but I'm not sure why you'd do that. You can continue working along-side, validate, or continue iterating on the design while the agent does other things.
It's the opposite of watching YouTube, pretty much.
Attention is on the full body, and the field of perception, then field of awareness, all at the same time.
A bit like shavasana practice, but instead of scanning part by part, expand presence to everything.
The thinking analytical mind stops, the nonthinking mind activates and softly intensifies.
It’s direct, effortless, always available, takes no time.
Easily done in any situation of passivity including meetings. Recommended during stand ups ;)
Michael Taft has many different guided approaches to this on his channel but there are many other teachers as well, e.g. Adyashanti, Angelo Dillulo, Loch Kelly, Shinzen Young (specifically his Do Nothing and Auto Focus techniques) and expanding the gamut to traditional Vajrayana teachers, Lama Lena, Mingyur Rinpoche, Lama Dawai Gocha, all with accessible online teachings. Also Sayadaw U Tejaniya and Christopher Wallis who are less conventional, so to speak.
It is possible, there are many ways, some people are curious about this state and lean into it, most are not. Who does, or doesn’t, and when, in my experience, is matter of grace. So no need to worry about it.
I see it as something that happens to me rather than caused by willpower. Much like a memory or a flashback that then transports you.
The provisional techniques are great because different techniques click for different people. Once they've seen what it is, it's easier to drop in more directly. If there's any willpower involved, it's more a subtle dropping of discursive mental commentary (especially on the process itself: I've got it - almost there - why can't I get there today - ah so this is what works, etc).
Once you're there, it feels like the most familiar and comfortable place in the world. As one of my teachers said, this is real rest.
Such a cycle previously could take hours or days, resulting in long, deep flow states. But now I go through dozens such cycles a day.
So less of a single flow state, more so many short flow states. As for waiting, that’s when you can explore another idea in parallel. Double the flow states for me :)
I don't believe that multi tasking and flow can happen at the same time
I've tried, and I feel like I've got closer with faster models, but ultimately the agentic loop excludes you. Even if you're asking the agent to do simple short tasks, it's still: prompt, wait, wait, wait, check, and you never really feel like you're the one in control.
The problem with faster models is also that they're more stupid, so that additionally breaks your flow when you have to fix something dumb it's done.
LLM-powered autocomplete is a bit more like it, but that tends to be either so dumb as to be a net negative, or slow enough to be useless. And autocomplete is pretty distracting for me.
I feel like I'm missing a mode that works more like a pair programmer. Perhaps a multimodal model that can talk to you about what you're writing, as you write it, and offer suggestions rather than trying to take over and do everything for you.
Edit with an example: Read some interesting science news yesterday regarding man made risk of high water (Nature). Mailed the author, found the article (popular news doesn’t do attribution) and data and code was open source. Claude Fable had it running very fast and explained the things I forgot from high school. Started on localization and adding some methods from my background (econometrics, extreme value theory). All nice in the /hobby/ way. I can overlap fields in hours now. A brilliant feeling (but probably not brilliant).
What I cannot do is assess the value and novelty of the created work on my own. So I still need to have a set of geologists and econometricians / actuaries work through ‘my work’. That’s what we need tools for! We need UI/UX in this case for novel fields interacting with quality controls made easy. I currently wouldn’t dare ask the author for her time based on my slop. And I cannot critically assess what I’ve made. I only learned today that Greenlands ice attracts water, that Manila and other cities are sinking due to exhaustion of their aquafiers and that the North Sea is surge heavy and unique that way.
Llm-buddy is an “Emacs package that watches your recent buffer edits and asks an LLM to review them. When it finds something worth pointing out, it can add a short inline note in the relevant buffer or show a message in a popup buffer (it usually does the former).
The goal is lightweight feedback while you work: typos, logic mistakes, questionable edits, or prose issues that a normal compiler, linter, or spell checker may not catch.”
Side-note, I wonder if audio cues would work well here. When another person is commenting on something, we as humans can typically remember their point while still being focused on text, but if a popup with text comes up we usually get distracted by it. Just my two cents.
Skill issue, not a universal problem.
This is exactly what I have also been thinking and wanting for a while now. A realtime agent that I can share a screen and mouse / keyboard with. and we can just work together at times. I think it will probably come at some point but we might be a few years away from it.
It's more taxing because I'm switching problems but at least these are all libraries within the same ecosystem so eventually, they line up.
I've half-joked a few times that ADHD with hyperfocus is a perk in this agentic coding era.
"Higher levels" of AI usage are exhausting and flow-free endeavours.
I guess to take it a step further you could just write everything in a single file with enough context to let the LLM figure out location but this is quite literally just a prompt.
the trick to get it uninterrupted is "selective multitasking". i don't like having too many Claudes / Codexes in parallel on auto-pilot; this way im finding i'm getting _something_ that is perfectly plausible, but rarely what i wanted. but I have N going at any given time, just enough to be basically non-stop reading. problems need to be related; within one project, ideally adjacent areas that are complementary. then my "flow" is just switching between reading and typing non-stop. never felt time flying by faster in my life, pure flow
Main thing is (1) how do I verify the agent hits the happy path and (2) how can I elicit and clarify assumptions it might make.
Then follow up the build with exploring and refactoring.
(2) prioritized context switching (like playing an RTS) I have several tasks going at once, while one works I hop onto other tasks.
I usually have one or two “core” goals I’m trying to accomplish that take deeper thinking and get priority. The other tasks are smaller and require less thinking.
A lot of times I’ll have the secondary agents build research docs I can review in detail later.
I come from more of a hardware & environmental engineering background and we were always taught that projects were iteratively built via Design, Build, Test, Learn cycles.
I drive the Design and basic skeleton of the build (pseudocode or boilerplate), then pass off the rest of the Build and Test to the agent. I pick up after the test and read the agent commits/notes, then write up next steps. Repeat DBTL. Maybe spin a few features out at a time in parallel depending on how much time I want to devote to reviewing new project features later in the day.
Nowadays with AI I try to start most tasks with a plan, review each phase/step, research parts I'm more unsure of, and try to refine it. Ironically it's more of a dev cycle like process anyway IMO.
It’s why the execs get so excited about these tools: they understand how to delegate.
I still do deep work, but I actually enjoy a session bouncing between agents. And I can chose how much focus to give each tasks.
Be real, most of that flow state was typing boilerplate
Pair programming. I call it pilot / copilot / autopilot. Two real people plus one or two agents working together. Classic XP stuff, the copilot can help remind what we are focusing on, file follow up issues, give instant code reviews.
Bake offs. Do the same task but in two different chats or agents or approaches (TDD vs vibe or legacy app vs next app).
I don’t do these all the time, and they don’t guarantee ROI, but it keeps me focused on one thing to completion intend of getting distracted
I can not fathom context switching between multiple worktrees so that the PM can make JIRA graph look better.
I think that this is mostly a UI problem. Chat UI is just not a good UI for programming and the fact that the current "AI"-coding sphere has converged on it is incredibly silly.
One of of the first things that I did when I first seriously tried an LLM-based coding agent is making an ad-hoc task manager on skills and simple daemons.
So that I can interact with it using files instead of this stupid workflow of typing a prompt into the console and then just doing nothing while waiting for the response.
There is absolutely no reason not to do it asynchronously.
Ask HN: Do you struggle with flow state when using AI assisted coding tools?
I tend to focus on on project at a time with multiple agents, rather than agents on multiple project, and then time slice myself across projects
- Use a fast model like DeepSeek Flash V4 on high (it's Sonnet level, but fast and cheap).
- While the LLM is working, start writting your next prompt. A good prompt usually takes between 1 and 10 minutes to write anyway.
Doing this should keep you busy enough to never leave flow.
But it is intense and demanding when the LLM is fast, I'll tell you that.
Playing Star Citizen? There's pockets of 5 minutes all over the place traveling from A to B. I keep my laptop nearby and have a prepared todo list of items to work through. Those moments wasted on Reddit are now moments wasted on feature experiments!
Waiting for a cup of tea? Run an experiment. Waiting on wife? Run an experiment.
Piece by piece an app is coming together built from 5 minute increments of reclaimed time.
I was thinking about this when I tried a faster model (Cursor released something fast about a month ago?). It was such a joy to use (well, at least compared to other models, where you wait 5-10 mins for even simpler tasks), and I noticed I felt much closer to the problems, and I got closer to a "flow" state... ...but unfortunately, the models are faster for a reason, and the output got worse. While I did enjoy my job more, I was also left worried that the model missed important things (and it did when cross referenced with other models or just doing the thinking myself).
IMO we need much faster yet capable models to bring back a bit of a flow state.
Another approach worth trying is to get some agents researching 4-5 tasks thoroughly in the background, discovering all the relevant details, collecting all the files likely to be edited, their content etc..., then work on one thing at a time with a better focus for yourself, maybe use a faster model.
One thing I try to do is code manually if I know that I can be faster and better. It's convenient to stick to one tool, the agents, when editing code, but for smaller clean up tasks, they just never get it right, and sometimes it's better to do 1 min manual work over 5 mins of explaining what you want and the agents still not delivering it...
a) making me not think at all
b) giving me weird adhd brain (I never struggled before with this)
This isn't even troll post. AI has killed the ability to reach flow for me, but I basically have to use it at work so <shrug>. But if I'm WFH or at night, a little help helps me stay focused and connected to my work, sometimes even with AI. Does my mind drift? sure. But that's as close as I get to flow now.
The difficulty is to break down the task in a way that multiple agents can work on it.
I usually spin two or three major issues with 10-12 agents in total.
When I send one agent off to do work I usually begin thinking about some other unrelated problem I also want done, and then I try to spin up a parallel agent to do that as well. The thinking itself is where a lot of the deep work happens for me IMO. I probably spend like 80% of my time thinking, researching and reviewing plans. The other 20% is actually promoting.
I see a lot of people saying that agents trivialize work now - like you just push a button and an answer comes out. This is so far from my experience I actually don’t know how to bridge the gap. If you are not spending a lot of time researching you are likely going to be asking the agent to do things that don’t really make sense.
Literally every task/feature now involves me learning or thinking through an architecture. I enjoy it because that was always my favorite part pre ai thinking through and designing the system.
It is actually more mentally taxing I think because now all I do is work through complex architectures and thr fact that code comes near instant means the scale and volume at designing the architecture is 10x now.
Top models are so good at not messing up code whenever there's lots of bugs it actually means my design and testing methodology was poor which is also a much harder problem.
I have a couple of terminals open and work on at max 3 things.
A main task, an exploration task and another prompt/skill improvement or documenting an issue (or a proposal)
The more time I spend waiting for an AI to think, the less flow I experience. Fast autocomplete-style AI boosts flow. Slow autonomous agents usually break it.
My workaround is to stay in the loop: AI handles the typing, I handle the thinking.
Just give it a zillion linters - including ones you wrote yourself - and make it write its own tests (red/green) so it doesn’t need to stop until it’s made working software with nothing dumb in it.
Then get into a flow state when you write your weekly update emails and respond to customers.
Keeping build in steps keeps me as well as AI focused.
Run tons of experiments. Turn yourself into a researcher. If you don't have a constant interface to the latest interesting experiment results to engage with/learn novel things/see novel solutions, you aren't running enough experiments.
Running an experiment means you don't already know the result, and you've looked at the prior art so you are doing genuinely new things. Establishing this prerequisite is completely trivial with modern agents.
Hopefully the answer is interesting and impactful enough that it will be useful in your work. This is honestly easier than it sounds; if you're a smart person working in a field where people are willing to pay money for impactful results, you can do this.
Anything that's not running experiments -- including debugging -- is grunt work that you should automate away, and you increasingly can if you set up your harnesses correctly. Make a pipeline so that the novel results of your experiments are polished, packaged, and shipped by your agents. How to do this obviously varies by domain but it's increasingly possible for most things.
And if your job is not doing the above, I have bad news for you: your job is going away fast. So you might want to set up a day on the weekend to give this approach a try; it'll be good for your flow and your career.
Start with a set of work that's well specified and reasonably chunked to sizes that make it so that the review parts fit in the gaps of the working chunk and interleave (1-4 tasks of this). While the agent is working on the A task, you're reading the B task, only add a 3rd task if you're waiting on the agent excessively. Give yourself some slack on this to think about side quests (maintenance / tech debt / planning future work to your system etc.)
Make sure the handoffs are reasonably detailed (prompts / AGENTS.md instructions) - make your agents provide more context than normal - make them assume that you don't read all the text they spit out and need to be handed succinct summaries with information that helps reduce cognitive burdens (what I was doing, how I did it, what's next etc.)
It's reasonable to regularly ask the agent what things you've worked on choices made, options considered and discarded, context rehydrating. There's a lot of small tweaks you do when interactive prompting that get lost in a drift rather than captured as a neat single list. Make the agent help track that stuff. (at least prior to shipping, but often in intermediate steps.
Write flows that keep software in a buildable state so you can run it and queue up changes based on what you see. Avoid long periods of broken refactoring (caller code written before callee, deletion before add in a move etc.) Run quick checks (e.g. rust's cargo check) after each change, not at the end.
Correction of agent errors should end up as future steering. If the agent makes a mistake once it's the agents fault, twice it's your fault.
Leave time to stop and evaluate the current state regularly (where are we on the work). It's easy to mistake momentum for progress when you're the human part of an agentic loop.
I've just started up a new gig where I'm swearing off any agents, I'm even not looking up answers with an LLM. There's nothing so crazy I'm doing SO still doesn't have the answer.
So far, I'm having a great time. I'm progressing quickly, understanding the domain better.
I'm also finishing an older job at the moment, which has been almost 100 percent agent-driven. Real brain-dead drudge work, there's no flow to get into with these things. I'm not sure it's been any quicker than the old-fashioned way. Certainly a lot less fun.
Normally, I work on my core work plus something tangentially related (e.g. 20% projects). The 20% projects keep my attention while the core work is LLM'ing.
Flow = high talent/skill + high challenge
It's hard as yet for me to feel skilled in interacting with AI agents when coding, and the challenges I face are more interaction with agents, and less around the object of the coding.
Today I fall more into:
Anxiety (high challenge level, low skill level) Arousal (high challenge level, medium skill level)
git worktrees and sidequests
Some people can work like that, some very few people may even produce acceptable results like that. I cannot and I am not interested in doing so.
The closest you can get to agentic coding while still actually being in the control loop is something like intellisense - where it just fills out the implementation of small chunks of code, one block at a time and only when you specifically request it.
In the few instances I've been able to achieve really joyful flow state, there are usually two simultaneous workstreams, plus or minus one. They're usually working towards a large goal that I roughly know how to judge, in digestible bites.
For example, sequentially modifying the UI in a series of operations towards an overarching goal, where it's easy to tell if a step worked, and what the next step should be, but where you're not sure exactly what you want, so there's some curiosity and discovery rather than just feeding the bot tiny instructions. I try to keep the two workstreams from overlapping. If both streams start fighting over a file they both dirty, things go south fast.
Adjusting your prefs/harness/etc for model terseness goes a LONG way. Context quality is absolutely everything. A good context "seed" can go back and forth for many turns cleanly and with focus, and even compact successfully once or twice. A bad seed will be annoying to work with from the jump, will thrash towards compaction faster, at which point it gets even worse. This is difficult to troubleshoot objectively, but I'll frequently restart conversations if I don't like the vibe of the first couple turns. It's made harder by constant model churn. Until opus 4.8, I ran opus/sonnet 4.5 high for a long time in large part for continuity of intuition, if that makes sense.
There are also many elements of human knowledge management that make a difference. I've found "append only" to be a magic word, generating markdown logs of changes, or learnings, etc. Whatever workflows create visibility and resumability so that you can return from a spell away and get up to speed effectively. Manually keeping your own dev log alongside the session sometimes helps, makes things sticky and ensures you understand what's happening.
But it's hard. Feels incredible when it goes well, but going well feels very nearly random, and whittling towards reproducibility can be very mentally draining, in terms of both energy and morale.
i am solving a problem, so i think (keyword) about how im doing to do that.
then i lay that out for the LLM. i have a bunch of documentation and todos etc.
i manage that and then orchestrate the ai to implement what ive asked it to do.
it is really fun!
It's pretty exhausting to be honest. In the past I didn't have to know how the entire app was supposed to work. I would plan a bit, then code for a long time, test, plan some more. Sometimes I would get lost in some (enjoyable) architecture nonsense.
Now I just read and write regular text. Instead of exceptions I'm avoiding misunderstandings. It can almost feel like a flow state, so I have some hope that it'll turn into that once I get more used to it.