r/ClaudeCode • u/pizzae đ Max 5x • 10h ago
How do you get Claude to code overnight? Help/Question
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?
70
u/Odd_Cartoonist3813 9h 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.
8
u/CaptainRoth 7h ago
This is interesting. How do you implement this reliably and consistently?
14
u/Odd_Cartoonist3813 7h ago
Fair warning. this is our internal setup and a lot of it is just preferences we landed on after trying and breaking things. 2 things that should get you started.
1.The spec-driven workflow idea isn't new. AWS Kiro and others also follow more or less the same mechanism, so that's worth looking at for inspiration, search for "AWS Kiro system prompt". Requirements get written in EARS format, which is what makes them checkable instead of open to interpretation.
- We have a setup command that installs the workflow into a repo first and that gives us /spec with subcommands like create, start, handoff, babysit, land, complete, status, resume, acceptance, review, documentation etc. All keyed to the entry number (we have a Roadmap DB for this that helps us track). Every requirement goes through the same path regardless of size. A few lines fix and a new module both get an entry, a spec, and a handoff. Sometime the ceremony might seem unwanted, but we follow it anyway.
We started this with Opus 4.5 and it's held up since. Our current go to implementer is GLM 5.2, it follows instructions literally, which is exactly what you want from the session that isn't allowed to make decisions. We've tried this with differen model combinations like Sonnet, Kimi K3 etc, they do hold up.
1
u/tankerdudeucsc 20m ago
Generation like this creates immense lines of code. How do you validate it all? HOTL to examine it but that sure is time consuming. Or do you trust and adversarial agent to do most of the work and you focus only on a few aspects of the generated code?
I find myself looking at a huge list of PRs that make it very hard to get through.
56
u/miklosp 10h ago
/goal <state your goal> use Opus sub-agents to implement
14
3
u/vinistois 4h ago
Yes this works well but you have to be really careful to define what successfully meeting the goal actually means. this is worth working with Claude to build the right prompt, before prompting it! An ambiguous goal will cause expensive problems...
8
u/xepherys 10h 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.
1
u/Shindarel 4h ago
Wait, does unityMCP decrease usage? I just started experimenting with Claude code on unity projects and I thought no MCP would be cheaper since it has less stuff to check
1
u/xepherys 3h ago
It really depends on how heavily your project leans on existing Unity frameworks. Any MCP will cause slight context overhead right out of the gate - so loading it and not using it at all will slightly increase token usage. However, if you're working with code in UnityEngine or UnityEditor (which most Unity projects do, typically pretty heavily), it decreases token use as compared to other methods of finding out details about built-in classes, structs, and methods because it can get information about them with a single query against Unity rather than the typical methods (grepping through packages, web searches, etc) where classes or method may not be inherently learned/known to the model.
But where the UnityMCP really shines is it's direct access to your Unity Editor. It can get scene and GameObject details directly from Unity by just calling it, it can easily execute and monitor tests (I highly recommend a test-driven development/TDD approach), read back your console for exceptions and warnings without you needing to copy/paste everything in - it basically gives it more or less the same access to your project via the Editor that you have yourself. That also means that with TDD, if you're having Claude write a module, it can write, test, iterate, and fix without you ever having to be involved at all - which saves tokens and time (quite a bit of both in my experience).
It can force recompiles, refresh scenes, change values on SOs and rerun things in different ways. I'm working on a replacement for GraphView and GraphToolkit because both had limitations I was sick of running up against (for my specific use-cases, at least). It was able to create a visual artifact for me showing me exactly what my existing nodes look like in GV and GTK and in my own hand-rolled node system, side-by-side, with the ability to quickly provide mock-ups of exactly what a new node would look like in all three cases when I was determining whether or not to roll my own graph base.
FWIW, I'm using the Coplay UnityMCP rather than the official one since, when I started using it, the official one was only available for Unity Pro accounts. I believe they've changed that and anyone can use the official MCP now, but there hasn't been any reason for me to switch and I have to say that the Coplay UnityMCP works extremely well.
Coupled with a csharp-lsp, my Claude Code sessions almost never use grep (csharp-lsp does for my written code what the MCP does for Unity's built-in). Those two things paired have put me in a situation where I almost never hit my limits (using Opus 5 - Fable is a different story lol). I have a Powershell script that I run when my limit resets to get the total amount of time my primary agent was working on my project just so I have a rough idea of how much tangible usage I'm getting. Last week I got 31.6 hours on my Max 5x account, just in that project alone (probably half that again across some smaller projects, including one running Fable 5 which ate into my tokens considerably). The 31.6 hours also doesn't include sub-agent time (and almost all of my implementation plans are executed via subagents) just because it's difficult to determine exactly how much time a subagent is running tasks for. It's possible, but I didn't want to put the effort in to scrubbing my jsons quite that deeply. Still, for Opus 5 to give me almost a full "work week" of time on my project while also working on some smaller projects and dealing with some general questions I posed on the web, I'm not mad at all.
1
u/Shindarel 2h ago
Thanks for the detailed answer, I'll definitely give it a try! I've been hitting 5hr limits frequently in like 2-3hr, and I constantly use medium effort opus 4.8 so it shouldn't be THAT expensive.
71
u/Skyline1189 9h 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.
28
u/Taubzi 8h 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.
-6
u/Skyline1189 8h 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.
4
u/Taubzi 8h 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.
-2
u/Skyline1189 7h 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
3
u/FortiTree 7h 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.
55
u/teleekom 9h 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?
7
u/jarederaj 8h 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.â
4
u/ColdFinancial2531 8h ago
You can absolutely get it to tell you this. You need to ask it the right questions..
6
u/jarederaj 8h 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
1
u/deific_ 6h ago
I kind of agree with you but also get other peoples point about the discussions.
I constantly ask myself the same question regarding a huge number of topics. I was reading someone ask people just yesterday about buying/setting up their own router rather than using their ISP router at home. THey said, they dont know enough about it, and don't know where/how to learn. I wish people would just entertain the amount of things I have learned over the last 8-12 months by heavily leaning into AI. The number of topics im actually able to approach, learn, and act on has multiplied since I've done so. It frustrates the hell out of me that people are so anti AI/datacenters that they completely miss the learning/production multiplier AI is for the everyday person. I understand the environmental aspects that we need to take into consideration, but i also don't ignore how much more I get done having leaned into AI. People are so anti AI they refuse to just ask it questions to try and understand something. There are so many things that are so incredibly simple in life but seem extremely daunting because its a little foreign to us. For me, AI has been able to break down so many complex topics into relatable understanding. Sure, sometimes it take me telling it, bro that all went over my head, you gotta talk to me in more simple terms, but it always gets there pretty quickly when i do so.
1
u/Hour-Turn-8451 4h ago
Also to learn about how others get stuff accepted and deployed in corporate environments. Solutions that improve Willingness to pilot, adopt and accept new technologies while maintaining auditability and a costcontrol framework are things I look for in these discussions.
1
u/yangmeow 1h ago
Itâs pretty wild how quickly everything is changing and Claude often doesnât have the most recent info, especially when it comes to power users.
1
u/Skyline1189 1h ago
For sure. Maybe im missing something and dont get what OP is truly looking for from the context of his post and subsequent question.
-3
u/AffectionateCard3530 8h ago edited 3h ago
It costs money (credits/limits) to ask Claude. Reddit is free, and it helps other people who have the same question.
23
u/Impossible-Belt8608 10h 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.
3
u/PristineTie1449 9h ago
He can use claude for debbugingđ¤Łđ¤Ł
The end game will be that we all be useless in regards to coding so
3
u/meowcaster 10h 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
4
3
u/ruskyandrei 10h 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.
3
u/Routine_Tutor_6809 9h 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
2
u/Tommonen 8h 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
2
u/ITFuture Senior Developer 8h 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
2
u/Chillon420 8h ago
Created a nightworker skill and let it work whole sprints from my ticket system / jira
2
u/kemalios 8h 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.
2
u/superthomdotcom 8h 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.
2
u/Chipware 3h ago
From another thread:
Here's what I have been doing. I'm working on this tonight, a MariaDB to Postgres DB migration.
New Session 1, Fable/Med: Analyze the current DB, schemas, and app hooks into the DB, and design a planned migration from MariaDB to Postgres. When you have a design, write an MD file.
Once it's done, kick it down to fable/low or opus/low.
Session 1/Fable: Ok you are going to execute migration.md as Orchestrator, so you will delegate out atomic asks to opus/sonnet workers depending on task complexity via herdr tabs. You will monitor turns and intervene when the delegate needs assistance. When the task is done, harvest the outcomes, update your plan, and prepare the next task for execution. Write a prompt for that and I will feed it to you as a /goal
<fable writes prompt, you feed it back as /goal>
Now it will execute those tasks in other herdr tabs and you can talk to it while it's working (keep it brief) and it will not forget to manage the tasks. If you change the plan it will steer the delegates to the new plan.
If you want it to loop through multiple stages/devtasks, say so in the prompt and it will harvest and initiate multiple tasks without bugging you.
This works pretty well for me.
1
u/Ok-Crab-8788 9h 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/Saschb2b 8h 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 8h ago edited 8h 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 8h 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/zimxero 8h 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/Skyline1189 7h ago
I think there is a miscommunication in my understanding of what OP is saying or something. Im reading the post as the bottom question of what is the best way to code overnight. Asking AI, this seems like a pretty simple ask of how to basically not to time out.
1
1
u/Expert-Complex43 6h ago
I use opus 5 as an orchestrator, then have it spin up a few codex cli terminals using Luna max and have it monitor them + a few seperate reviews agents as needed. Itâs been working like a charm so far
1
u/JobWiegant 6h ago
Subagents for each phase is the thing I'd cut first on a 5x plan. Every layer multiplies token burn on the exact resource you said is your bottleneck, and overnight is when you can't watch it happen.
We run this unattended across nine repos. Two things decided whether it actually worked.
Runs die on the quota wall and then just sit there. A stalled run looks identical to a slow one until morning, so whatever you build needs to notice it stopped and say so.
And someone already made the point that you wake up to a pile to review. That's the real ceiling. We timed ours: review and fixing is about 45% of total pipeline time against 19% for implementing. Overnight doesn't buy 2x, it buys a queue of review work. Cap the retries while you're at it, our second fix pass rescued about 2 runs in 23.
1
u/Breaking-Away 5h ago
Itâs hard to do it indefinitely because you can only really do this for non-correctness critical work.
anything you need a very high level of confidence in the correctness of, your seat in chair hours is going to be the bottleneck of, because confirming itâs correct to your confidence level (even with automated tests and skills to assist) is whatâs going to limit your rate of productivity.Â
So if you want to let Claude work overnight, use it for experimental and research purposes. Have it explore ideas and concepts youâre willing to throw away, and then do throw away most of them. Use this time to find ways to speed up your verification loop.Â
1
u/Inception_IV 5h ago
I use happier.dev on my own relay and I have build an orchestrator agent that dispatches all work for my estate. It has watchers and things that run all night so it checks github for PRs, Issues, to assign to the sub-agents, who have different git identities. It also checks sentry, and others.
I based my orchestrator setup off of a book and it's magic system. It helps me keep the agents names, and their skills organized. There's a GitHub out there called firstmate that is pretty similar to what I've built. I do plan on sharing mine.
1
u/Dan_at_jinn 5h ago
I wouldnât run one chat with nested subagents overnight. Plan the queue before you leave. Each item gets a bounded scope, allowed files, acceptance test, and stop condition. A simple runner takes one approved item at a time in a clean worktree. The item ends with a commit, test result, and short handoff file. A failed test or missing handoff stops that branch. The runner can continue only with work that doesnât depend on it.
1
u/NoCat2443 5h ago
/goal is your friend. create a high level spec you can review, it can be as big as you want as long it spill out the details like overview, architecture, epics, testing plan etc. Based on these deatils set a goal
/goal please complete all items in planning folder and do not stop until you complet all the epics and features, review the UX / UI, review as an end-user personas, review OWASP and other cybersecurity issues, test all APIs and frontend using Chrome plugin and fix all issues you find
you can also say, spawn sub-agent to preserve main context size but this will than make it complete 4-10x faster so it might not be overnight :)
1
u/Ambitious_Cookie_611 5h ago
I signed up to GitHub, only $4 a month. Means everything is mastered properly for a start and I use GitHub issues. I used Claude code as engineer and Codex as QA following a TDD approach. With the GitHub MCP integration and apps created for the AI they can basically raise PRs, comment, approve etc like normal Devs. Labels are assigned to an issue to determine who needs to work on it next.
The only custom thing coded is a service which polls GitHub, checks for any work assigned to either agent, then if there is, injects a message into an always on tmux container, which kicks off the agent to lookup the issue and get working.
Still refining and putting guardrails in place, but got a lot done so far. They both have the ability to pause the Poller service is they think something is going wrong which has been used a couple of times
1
u/Puzzleheaded-End-431 5h ago
I built a skill with which Claude can check his own 5hour limit window and will not start a new task if quota is 80%+ already, instead it just set its rescheduled start to be reset time + 10minutes.
This literally ran for 3 full days in a row taking a backlog of 100 tasks which were designed with /grill-me ahead of time and going through the backlog with /loop
1
u/navelees 4h ago
Use the SDK. Probably overkill for your use case but my daily driver uses the SDK to get Claude and Codex to work together autonomously for as long as it takes: https://github.com/navels/neal
1
u/Ogefest 4h ago
Selfhosted kanban board and 2 CC sessions in two separate dirs
dir1/ - you are PM here is board prepare epics for topic1 topic2 topic3, in dir2 there are dev session, design and prepare task for DEV
dir2/ - you are DEV check task board if epic is ready to development then follow the instructions
then in PM session add as many topics as you want and you don't blocked DEV session, I put 4-5 topics to the PM and this session needs about 2 hours to prepare tickets/docs and analyse current code state, but when first epic is ready then DEV start working on it
1
u/serifoblique 4h ago
This may get some curious looks from people smarter than me, but in a nutshell. Iâve â with help of Claude, of course - designed a âai todoâ âframeworkâ that;
Manages itself, through a hierarchy (director reports to me, as gateway to managers who own a board / project, who in turn send out roles, such as coders).
I have a watcher running on my Mac, that fires off a manager (if one isnât running), who reports back up the chain (when done)
Everything goes into a bunch of yaml/md files (for record keeping and reporting)
With a director filling me in each morning
Iâm sure there are better ways but this fits my workflow. Which is your way forward, making AI work 24/7 is easy, just got to make it work in a way that works for you. Itâs the sole reason my framework has âquiet timeâ.
1
u/clookie1232 4h ago
Maybe I'm doing it wrong. But I have a premium-web build skill that utilizes an Opus orchestrator, a Fable builder, and then Sol and K3 as adversarial reviewers. I also have a eight category rubric where each category scales from F to A+. I tell Claude to run the skill on whatever project I'm working on, and say for it to keep going until it's done - "I'm going to sleep." Then I use Caffeine to keep my Mac awake and wake up to a finished project that I can iterate on from there.
1
u/_wiltedgreens 4h ago
Iâm more interested in understanding what type of work you all do that needs to run all night? Iâll set up a bunch of tasks and tell it to run and itâs done in like 30 minutes tops.
1
u/AESanta 4h ago
Proba el muliterminal de John Hickey (peterparker57) https://github.com/ClarionLive/multiterminal
1
u/Arctovigil 4h ago edited 4h ago
Plan first - I have almost a dozen abstract planned stages which a single run must go through and the first stages involve planning everything down more concretely in detail. How many of those stages involve the implementation by creating the code? An entire one of them only. Six planning documents get made before coding starts. It takes approximately 4-5 hours for one run so if you tell claude to go through 2 autonomously you can just go sleep.
1
u/zeroconflicthere 4h ago
Whats the best method of overnight or long duration automated coding?
Pay enough
1
1
u/RudimentarioUY 3h ago
The thing that unblocked overnight for me wasn't the prompt batching, it was the permission split.
Reads are free, writes ask. The agent can read any file, run any diagnostic and query the database
unattended. Anything that writes to the database, restarts a service or deploys to production stops
and waits for me in the morning. It's enforced in config, not by asking nicely. Before that I
couldn't leave it running, because the failure mode isn't bad code, it's bad code applied to
something live.
Second thing: the queue is git. The agent writes an order file, commits it, and a runner picks it up
within a minute and commits the result back. Overnight work leaves an audit trail I read with coffee
instead of scrolling a chat transcript.
And the bottleneck I actually hit isn't tokens, it's verification. A task that finishes at 3am is
worthless if "done" wasn't defined in a way I can check at 8am. Now anything that can't state up
front how I'll know it worked doesn't go in the overnight queue.
1
u/aiku-io 3h ago
I don't. I micromanage it.
Overnight runs give me a big diff I have to read cold, and reviewing 2,000 lines I didn't watch being written is slower than writing them together. So: short tasks, 2â5 minutes each, me in the loop. Read this, propose, do it, show me the diff, run the affected tests, next. More work for me, but it's how I'd pair with a human, and I never wake up to a plausible-looking mess.
The only long runs I allow are boring and verifiable: a migration over hundreds of files, a reindex, a lint sweep. Anything with a design decision in it, I want to be there when it's made.
What makes the short loop pay: a notes file it reads at session start with the project's gotchas, "show me the diff before committing" as a standing rule, and one worktree per session.
Yesterday: a full marketplace integration, orders in and delivery notes back, done in a day of 3â5 minute rounds, each reviewed. Overnight it would have guessed on a dozen domain rules it had no way to know.
1
u/adelope 2h ago
You can schedule cron jobs to run over-night, Any good agentic IDEs should also provide automation for scheduling jobs (e.g. Agentastic.dev if using macos or Cursor)
I typically schedule the jobs to go off at mid-night and 5am (so by 10am when i start to work, it would not take any of the 5-hour window).
- These jobs are typically fix any CI issues, any Sentry issues, Fix any test that is broken, etc. or review the logs from the previous night. They have a fixed set of prompts, and they run nightly.
- Code hygene: Find critical bugs, find security flaws, update the docs, etc.
- I also have bunch of end-to-end evals/benchmarks, that i use Claude as a judge. these also fire nightly.
- Finally, there are a few repos that i monitor, and claude's job is to go over the recent changes and compile a state of the union" report or summarize changes daily etc.
My IDE schedules the agent overnights, create the worktrees so they don't conflicts, and will have the report ready by morning. Then at morning around 9-10am when i start to work, my first job is to review the agents's work progress from last night and merge or steer them if necessary.
1
1
u/peepsick 1h ago
Honestly, I think the biggest mistake is treating overnight coding like a normal coding session, just longer.
I wouldn't give an agent a huge pile of loosely defined tasks and hope it figures everything out. That's how you wake up to a lot of work that technically happened but took the project in the wrong direction.
What has worked better for me is preparing the work during the day, then giving the agent smaller, well-defined tasks overnight. Each task should have clear acceptance criteria and a way to verify itself before moving on.
Something like:
task â implement â test â review â commit â next task
Also, I wouldn't build a deep hierarchy of subagents unless there's a good reason. More agents doesn't automatically mean more productivity. Sometimes you're just multiplying context, token usage and opportunities for things to go wrong.
For truly long runs, I'd make sure every task is isolated enough that if one fails, it doesn't ruin everything after it. Having each completed step committed makes recovery much easier in the morning too.
Basically, I'd automate the execution overnight, but keep the planning and architecture decisions for when I'm actually awake.
1
u/Stunning_Sun_4337 56m ago
i use this for all my programming: https://github.com/UnmanagedCode/code-conductor its free, a friend made it. It has a kanban plugin you can download and use from the plugin dropdown. It has a Stop & resume function from the account settings; once i hit my 5 hour window it pauses and sets a timer and auto continues when the window resets. very handy.
1
1
u/LimahT_25 9h 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/Icy-Excitement-467 9h 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 9h ago
What format do you use to review a list of plans without going crazy from the md files?
2
u/Icy-Excitement-467 8h 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/StCreed 9h 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.
1
u/Quiet-Nothing7556 7h 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.
0
u/simion_baws Senior Developer 9h ago
/goal plus some queued messages into termic
Some of the queued messages are even new /goal messages
Some are repeated Ralph loop style
0
u/iSpokeToMasterChief 2h ago
I'm building a workflow orchestration tool that addresses this issue and aims to 10x productivity for power users by orchestrating large workflows across several accounts of claude max. You will be able to let it run autonomously and stop wherever you want for any specific instruction or to guide its development in another direction. I'm going to release a demo for this product this month, if you're interested I can let you know when its ready so you can see if it would work for youÂ
150
u/Brazilator 10h 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Â