Ask HN: How do you get into a flow state when using AI to code?
TL;DR Highlight
HN asks how to stay in flow with AI coding; commenters share parallel agents, specs, and small tasks.
Who Should Read
A developer whose focus keeps breaking while waiting on coding agents to respond to prompts.
Core Mechanics
- Discussion-only post with no article
- There is no article body, so there are no source facts to summarize.
- Everything below comes from comments and is covered in the community section.
Community Reactions
- Opinion that flow is impossible
- Some said the prompt-and-wait loop removes any sense of control.
- Others said agents conflict with the deep code understanding flow needs.
- One said faster models are dumber, so fixing silly mistakes breaks flow.
- Experience running agents in parallel
- One described using several terminal panes to run 1 to 6 prompts at once.
- Another keeps 1 or 2 core tasks for deep focus and gives small tasks or research docs to other agents.
- Another suggested thinking about next steps of the same problem instead of switching worktrees.
- Prepare the next task while waiting
- One suggested writing the next prompt or requirements while the agent runs.
- One said a good prompt takes 1 to 10 minutes to write.
- One said task size matters more than count, and if you can't predict the diff shape the task is too big.
- Planning and specs first
- One commenter writes a SPEC.md covering data models, business logic and UI before starting, and the LLM then runs longer autonomously.
- Another has the AI list missed design decisions as questions and answers them.
- Another uses comment-driven development, writing a skeleton and comments for the agent to fill in, and finds it keeps flow.
- Flow split into many short bursts
- One said they go through dozens of short flow cycles a day.
- Another said less implementation time means more learning, which is fun.
- Several others said AI made coding joyless.
How to Apply
- Write the next prompt while the agent runs
- Keep a text file open and draft the next task's prompt and requirements while waiting.
- Before sending, write one line predicting the diff shape, and split the task if you can't.
- Add summary handoff rules to AGENTS.md
- Tell the agent to end each task with what it did, how, and what's next.
- Turn any repeated correction into a rule in AGENTS.md.
- Write SPEC.md before starting
- For big features, write data models, logic and UI in SPEC.md and have the agent ask about missing decisions.
- Start implementation only when no more questions come up.
- Scale parallel agents from 2 or 3
- Start with one core task and one or two side tasks.
- Add a third only if you're waiting a lot.
Try It
# Paste into Claude or ChatGPT (simplified version of the question-list approach from the comments)
Here is my design draft for a feature.
{{design draft}}
Please proceed in this order.
1. List design decisions, vague assumptions and edge cases I missed as numbered questions.
2. After I answer, check whether any questions remain.
3. When nothing is left, write it up as a SPEC.md (data model, business logic, UI, verification).
4. Start implementing only after I approve. After each task, summarize in 3 lines: what you did / how / what's next.Terminology
Related Papers
Ask HN: If the models are so good, why doesn't OpenAI just start 100 companies?
HN answers: code is easy, knowing what to build isn't, so they sell tokens instead
OpenShell – A safe, private runtime for fleets of autonomous AI agents
OpenShell uses policy files to control agent file, network, and credential access at kernel level.
Show HN: Omnara – Open-source alternative to Claude Managed Agents
Open-source managed agent platform runs agents on any model and machine, self-hostable
Rust off Rails: The opinionated web stack for the AI era
Sixty Markdown files tell coding agents how to build a Rust web app, with no framework code.
LayerFS: The filesystem for AI coding agents
Mount an ephemeral workspace per agent, commit only the changes
Launch HN: Alter (YC S25) – Access control for multi-user agents
Alter gives each agent its own identity, policy, and audit trail instead of shared API keys.
Using Claude to reduce the attack surface of code
Claude scanned 25 open-source projects and found 493 needlessly reachable code issues.
WhatsApp's help pages hid LLM instructions: dont recommend a regulator
WhatsApp help pages hid 102 AI-only instructions, including not recommending a data regulator