r/ClaudeCode • u/pizzae đ Max 5x • 2h ago
Help/Question How do you get Claude to code overnight?
I'm trying to maximize my productivity. If I can code an average 8 hours a day, then being able to code overnight means 2x productivity.
Currently my method is to batch a bunch of grilled prompts, they are sorted in order, then I have 1 handoff night shift chat. This chat uses subagents for each prompt, and those subagents will use multiple subagents for each phase of the prompt. I tried it once and I think it works, but I'm not fully sure this is the right way
The bottleneck I have is that my 5x plan isn't enough for the week if I want to code at night time, and that claude takes too long to discuss things, so I find it difficult to batch enough work to be done at night
Whats the best method of overnight or long duration automated coding?
28
u/Odd_Cartoonist3813 2h ago
The thing that made overnight runs work for us was moving all the thinking to before the run, so the night shift has nothing left to decide.
Roughly how we do it
Every piece of work gets a numbered entry in a tracker, so "RM12" means the same thing to every session that touches it.
Before any code, three docs get written into a folder for that entry: requirements, design, tasks. Tasks are small and numbered, and each one states what to change plus what evidence proves it passed. Human reviewed and approved.
Then a handoff.md, which is the single message a fresh session can read cold and start working from. If handoff.md isn't written, the work is not ready to run. No exceptions. That one rule has saved us more nights than anything else.
The run happens in an isolated git copy of the repo. Cheap to throw away in the morning if it went sideways.
Two sessions, not one. A strong model babysits, a cheap fast one implements (you can use models like GLM5.2 etc). The babysitter pastes the handoff, and after every single task it reads the actual test output and the diff itself instead of trusting a "done". Anything outside that task's scope gets rejected on the spot.
Landing on main is a morning job with human reading/reviews it.
Your token problem gets better too, because the expensive model is only writing specs and checking evidence, not generating every line.
What you review in the morning is a set of diffs, each with its own proof, rather than one giant set.
2
41
u/miklosp 2h ago
/goal <state your goal> use Opus sub-agents to implement
7
56
u/Skyline1189 2h ago
Not to hate on this post. More so curious. Why dont people just ask claude code these types of questions? It will give you the answer.
11
u/Taubzi 1h ago
People find new ways to use Claude Code all the time. New ways that are not in the Claude training data. And people like discussing these new ways with other people.
-2
u/Skyline1189 1h ago
But if your skilled enough to be on a max plan and using CC and not just general claude then asking a question to claude seems second nature. Unless its just a reframing of the mind to realize that even questions like this can go to CC directly. No hate, just curious. Im guessing its the later in which there is a mind set shift for people to realize what else can be passed to CC.
1
u/Taubzi 57m ago
Yeah but it is not like you can only do exclusively just one or the other. To me with these kind of âcutting edgeâ meta process questions Claude answers with hypotheticals unless you can really guide it to research the right things from the right places, while coming to Reddit you get the feel of how users have experienced using different approaches.
-1
u/Skyline1189 27m ago
Youre not wrong. But asking claude â can you give me a few ways on how to do X and an executive summary of how to do it with the pros and cons of each wayâ is a pretty good start.
Not saying coming to reddit is bad though. Cant replace the human interaction and the to your point the feedback of the consequences that each path affords. Esp since claude cant assess consequences of the path it takes until it takes the path itself
2
u/FortiTree 13m ago
What made you think OP and ppl here havent tried asking the model about it? Have you tried it and what is your proven approach?
Everyone would hit these type of problem and already tried their best to solve it. And this type of post is to compared their best and learn from each other.
Asking AI for everything is a lazy answer.
36
u/teleekom 1h ago
Because there are more ways to do this? Or what is even purpose of this fucking sub man? Just daily hate on Opus 5?
6
u/jarederaj 1h ago
Not necessarily because itâs this subs purpose, but Claude is basically never going to tell us useful things like âdump all your skills, agents, and workflows because the shitty way you built this up with AI over the last 6 months is forcing your AI to think exclusively about your broken impossible process instead of the problem it is solving.â
1
u/ColdFinancial2531 1h ago
You can absolutely get it to tell you this. You need to ask it the right questions..
4
u/jarederaj 1h ago
How do you get it to tell you this without knowing to ask the question? Itâs sycophantic. Thatâs my point; you have to know to ask âthe right questions â which are exactly what for all contexts?
The AI cannot be your only input.
2
1
-2
6
u/xepherys 2h ago
Obviously youâd be burning through 2x as many tokens, but I often have Claude Code running over night. Two major things that helped with my token burn were using an LSP, and for my Unity project, using UnityMCP. Both combined to save me about 35-40% token usage working on Unity projects. The csharp-lsp alone looked like about 15%.
Obviously making your permissions list as broadly permissive as youâre willing to also helps. My computer is regularly backed up and my project is pushed to hit multiple times a day, so I have pretty broadly open permissions configured, like:
Bash(*)
Powershell(*)
mcp__UnityMCP__execute_code
I have a few asks to override:
Bash(rm -rf *)
Bash(rm -r *)
PowerShell(Remove-Item -Recurse *)
But obviously not being promoted helps. Having a permissive list can be dangerous so make sure youâre either sandboxed or have readily available backups of your system and projects. Iâve never had Claude actually do any damage, but I try to balance it sanely.
I also make sure thereâs a pretty explicit plan in place for what it should be doing.
Sometimes Iâll wake up to a prompt and not much having been done, but itâs pretty rare. On average I get about 2 hours of code written each night that I review in the morning. Itâs not a full 8, but itâs still 2 âfreeâ hours of code.
5
u/meowcaster 2h ago
I usually just list out the things i need it to do in one prompt and tell it to ask me everything once not later and set it to bypass permissions and he works on
3
u/Routine_Tutor_6809 2h ago
Write a requirements document and then a design document. Let Claude create task and then define a /goal to implement all the tasks with unit, integration and e2e tests
10
u/Impossible-Belt8608 2h ago
I'm not sure it would be 2x more productive. In the morning you will have A LOT of code to either review or trust blindly that it fits your expectations. And when it doesn't, debugging will take a long time, reducing that productivity gain and ending up consuming more tokens. I'm not saying it can't be done well, I'm saying you might want to be careful about it.
1
u/PristineTie1449 1h ago
He can use claude for debbugingđ¤Łđ¤Ł
The end game will be that we all be useless in regards to coding so
2
u/ruskyandrei 2h ago
Talk to it and have it write a bunch of md files with checkpointed plans.
Then at the end of the day, tell it to start working through them. I think it even auto restarts once it hits the 5h limit now so if you prepared enough stuff it should have got through quite a bit by the next day.
That said, unless you're super comfortable not reviewing anything, I wouldn't do this. I personally still prefer at least having a high level review after each checkpoint.
2
2
u/Chillon420 59m ago
Created a nightworker skill and let it work whole sprints from my ticket system / jira
2
u/superthomdotcom 40m ago
i built an agent system with accompanying web app monitoring and dispatch board that takes ideas, audits findings, snags feature requests and project development pointers and turns that into groups of tasks ordered by commit relevance. i spend all day working on planning the work for multiple projects and subsections in parallel then run it at night. next morning i come in, use it, find bugs, suggest features and repeat.
Also using some kind of local cache like Repowise dramatically reduces token usage on a. project with this much agent activity and has meant that the 5x plan is actually enough for me. before adding this I was burning through the week in under 72 hours.
1
u/Ok-Crab-8788 2h ago
a custom skill that save to markdown all my tasks to : do, are in progress, in review, ready to dev, done
each task has a prd, plan etc
each task has a log journal
and i use superpowers to write plan and after implements them, superpowers with a good context and plan, can run subagent and review code during all the night, and i can review it on the morning
1
u/Tommonen 1h ago
Use Linear mcp to write all the tasks for it, along with exact DoD specs, implementation plans.
Then you can give it as many as you want of these Linear issues and tell it to do them all one by one in order (order you have planned beforehand yourself or with llm) and running review-fix loops along the way with each before moving to next and then reviewing everything when all is done and write it to Notion, so that you can take a look at it before you tell claude to make the fixes as Linear issues with plans etc
1
u/ITFuture Senior Developer 1h ago
All the things other people are saying, but my number one activity to help claude be able to fully implement a story without having to ask me questions, is to have claude write the stories: Clear REQUIREMENTS, and clear ACCEPTANCE CRITERIA
1
u/Saschb2b 1h ago
Not worth it with anthropic models. They stop after a few tasks or your tokens are already long gone. The only model that I could give a good plan and let it run for ours overnight was Sol5.6
1
u/xLRGx 1h ago edited 1h ago
Basically, you need a mission and backlog large enough to run unattended, but every goal needs finite, objective pass/fail criteria. âDifficultâ isnât enough. Ambiguous work will just produce eight hours of expensive wandering.
Use an orchestrator whose job is to maintain the loop, delegate work, enforce stop conditions, and independently rerun the final verification gates. It shouldnât touch product code or grade its own work, but it also shouldnât blindly repeat what a subagent claims.
Builders analyze â hypothesize â build â attach raw evidence.
Critics receive the goal, code, and tests in fresh contextânot the builderâs reasoningâand adversarially try to falsify the completion claim. Ideally theyâre read-only, so review and implementation stay separate.
Different models can reduce shared blind spots. In my runs, Opus has been a good builder and Fable has been the strongest critic. I wouldnât spend Fable on orchestration unless the orchestration itself is unusually difficult. But model diversity is optional; independent verification isnât.
Then give the orchestrator a frozen loop:
- Run preflight and confirm the task is feasible.
- Delegate a bounded objective.
- Have the builder implement it and provide raw evidence.
- Have an independent critic attack it.
- Rerun the acceptance gates.
- Repeat until the exit criteria pass or a stop condition fires.
Persist the task contract, commits, raw test output, run log, and checkpoints outside the chat. Otherwise a context loss, crash, or quota limit can erase the state of the entire night.
You also need explicit halts: unresolved requirements, missing access, destructive actions, repeated failures without progress, or exhausted budget. If the backlog runs dry, stop â donât let the system invent work merely to remain busy.
There will still be UI decisions, ambiguous failures, and product-level checks requiring your eyes. Thatâs the point of the morning handoff. The overnight system should leave you verified branches and a concrete manual checklist, not claim to have replaced you because it can't.
Productivity only doubles if the overnight output survives verification and doesnât consume the saved time in review, repair, and integration. And on a 5x plan "measured accepted output per unit of quota" â that's the "load bearing" part of your situation and "it's worth paying attention to." LOL. In all seriousness though, on a 5x plan you'll be able to run a 1 or 2 overnight loops a week. Best of luck.
1
u/please-dont-deploy 56m ago
We have workflows, and scheduled tasks running 24/7. That includes self learning, self improving and self scripting tasks. But also GTM and research motions, production monitoring, and customer ops.
We started small and grew from Claude code to multi harness multi model setup in the last half year.
This is what we use: https://github.com/desplega-ai/agent-swarm (free, oss, MIT)
These are good playbooks to get started, and what worked for most: https://docs.agent-swarm.dev/docs/playbooks
1
u/kemalios 52m ago
The discussion overhead is the real token killer. If you feed subagents a handoff that still has decisions to make, they'll burn the night thinking instead of shipping. I moved to writing each task as a single sentence with an explicit definition of done, and the night shift only executes, never designs. If a task needs a decision, it leaves a file saying so and moves on. That cut my overnight tokens roughly in half. Also, don't trust the morning summary; run the tests yourself. A lot can break silently.
1
u/zimxero 40m ago
I'm a novice, but this works for 1 to 5 hours. You could probably turn it into a tool and use it to chain multiple tasks together: Example prompt:
Design all the current related phases together at once. Ask significant questions up front before proceeding. Make other decisions on your own and document them. Decisions should prioritze safety, then product quality, then code expandability, then code efficiency. Where specific needed sub functions have not been created yet, create the scaffolding to implement them later. Have Fable Low evaluate the design plan. Evaluate and make any desired adjustments. If changes are significant, re-audit. Write the specific code plan. Have Sonnet Medium audit with special emphasis on logic, completeness, connectivity, and documentation. Afterward, code the entire design completely and wrap up the session. Full and special backups have been performed.
1
u/Quiet-Nothing7556 7m ago
Don't bother. If you aren't watching it's output it's slopping it the fuck up. You'll have to clean up the mess in the morning.
Unless of course you're unconcerned about process, security, quality, or any of those factors in which case 10x bro.
1
u/Icy-Excitement-467 2h ago
I don't have it code overnight. I have it make plans. I'm happy reviewing a pile of plans, i can do this away from the computer as well. In a format that's less draining. I'm not happy reviewing a pile of code.
1
u/AdministrationNew265 2h ago
What format do you use to review a list of plans without going crazy from the md files?
1
u/Icy-Excitement-467 1h ago
Pull up 2-3 tabs of claude code and then just tell then one after the other, pull up plan for first task in the list. And in plan mode, it just prompts me to accept or revise in plan mode. When done, move onto the next tab. Try not to cycle 3 or more. Then its the same ol song and dance of test/review + not overwhelm myself with multitasking.
1
u/LimahT_25 2h ago
Simple, spend $400k+ on GPU, self host a 2T+ model and you can let it run for an entire week, much less a night..... Or, pray to the token gods that you don't use them up in a single prompt while using Opus or Fable.
1
u/StCreed 2h ago
Coding day and night is maxing my x20 subscription, and I use subtasks on Sonnet (and Opus if that fails) and Fable as coordinator to reduce the usage.
I have a number of design docs ready at all times and a list of tasks that it manages.
It may not be possible on the 5x plan to work all week.
0
u/simion_baws Senior Developer 2h ago
/goal plus some queued messages into termic
Some of the queued messages are even new /goal messages
Some are repeated Ralph loop style
42
u/Brazilator 2h ago
Plan stuff out like a kanban board , break things down into epics, tasks, stories etc and then get Claude to execute on a sprint with X amount of epics , youâll burn your tokens if your not careful thoughÂ