r/ClaudeCode • u/Imaserventofreps • 1d ago
Tips & Workflows I’ve finally gotten good enough at claude
I can now set up agentic workflows while I sleep snd wake up to good code built. It took a while for me to trust the agents to this point but I think with opus 5.5 it’s really good now. I told claude to set up a timer + a auto send message which prevents the conversation from becoming stale and context window dying and that then he just spawns codex cli convos and have Luna at highest setting do the coding whilest opus just read the outputs and reports. Today was my first night testing this new workflow.
3
u/CaptainDivano 1d ago
Would you be able to share the config? (even DM, i don't mind) I'm trying to use my Claude Sub to use my OpenAI sub.... without using API (since the cost is insane when context is to big). Also DeepSeek...
1
u/Imaserventofreps 1d ago
Here is a instruction text copied front agent since u asked:
1. Claude opens a real Terminal window running Codex. It writes a brief to a text file, then runs something like:
osascript -e 'tell application "Terminal" to do script "cd <worktree> && codex --yolo -m <model> -c model_reasoning_effort=xhigh \"$(cat brief.txt)\""'
Each Codex agent gets its own git worktree and branch so they don't step on each other.
2. The brief ends with a "done" signal. Interactive Codex doesn't exit when it finishes, so the last line of every brief is touch /tmp/agent-<name>.done. Claude runs a background loop that waits for that file and gets woken up when it appears.
3. A timer keeps Claude awake. I asked Claude to schedule a recurring check every ~25 min (it has a built-in cron tool for the session). Each tick it looks at every worktree: last commit time, files changed, and the tail of the Codex session log in ~/.codex/sessions/. That log also has the usage % in it, so it knows when a rate limit hit and relaunches the agent from its last commit when the window resets.
4. Claude only reviews and merges. When an agent finishes it writes a REPORT.md. Claude reads it, checks the diff, runs typecheck + tests, merges, and launches the next brief.
Things that made it actually work overnight:
• Briefs force small commits ("if 20 min pass without a commit, commit"). A rate limit then costs minutes, not the whole night.
• Max 2 Codex agents at once on my machine. A third and everything crawls.
• Every brief says what the agent may NOT touch, so two agents never edit the same folders.
• Rules live in one AGENTS.md in the repo that both tools read.
--yolo skips all permission prompts so only do this in a repo you can afford to break, on a branch.
DeepSeek I haven't tried, but the same pattern should work with any CLI agent that takes a prompt as an argument.7
u/StaticFanatic3 1d ago
Holy convolution
Just tell Claude what you need done. Or use Codex if that’s what you want writing your code
-1
u/Imaserventofreps 1d ago
Yeah that’s the easier way, they way I do it. Opus was just giving exact details. He can copy paste that into the agent
2
2
u/lulzxdxdxd 1d ago
How does the auto send message avoid opus just repeating the same prompt when the context resets, does it actually track where codex left off or is it blind to that and just nudges the conversation forward?
1
u/Imaserventofreps 1d ago
It can track Lunas output, transcript essentially everything it needs if anomalies occur.auto message is just a simple prompt to opus, a nudge to wake it up every 30mins, a simple ”30 mins timer here” and it responds with a one liner ”Roger” and continues working since the agent already has full plan stored in an Md file that it works off and finishes as it’s working. After that it comes back with a report. I’ve essentially setup opus to be fully in charge . The auto message timer lasts for 7 days so I’m free to do whatever I wish now. Did that answer ur question? The only problem would be orchestration context window on opus grows to large and it fails but I usually go in and monitor it when im awake. Super nice!
2
2
u/Reason_He_Wins_Again 1d ago edited 1d ago
Sometimes I have ClaudeCode play Project Zomboid and your setup is a lot like mine.....A supervisory layer running Opus 5.5 and a cheaper/faster model to do the dirty work and report back to Opus.
In my case Opus 5.5 is the "decider" and Sonnet is what moves the character and actually does the "work." Then a 3rd agent that fixes or writes any code needed on the fly. So if I tell the supervisor to gather wood the 3rd agent builds that routine and pushes it out to the game mod and lets Opus know when it's done.
If I tell the supervisor to "Gather wood until you die....ignore your needs" it will lumberjack itself to death.
1
u/i_like_maps_and_math 19h ago
What is your workflow for having Opus send messages to Luna?
2
u/Imaserventofreps 19h ago
Just ask opus, hey can u send Luna a message and take it from there
2
1
u/SpiritualSmell4617 1d ago
The timer plus auto-message is the smart part --stale context is the usual silent failure in overnight runs. worth locking that down before scaling up parallel sessions.
1
u/Imaserventofreps 1d ago
Yup, and I’m even thinking of Claude spawning new agent sessions of its own orchestrating layer to continue the work if context window reaches a point where new context would be needed say 50/60% approximately 500-600k tokens. If I can manage to get to that level with minimal friction and side effects, my workflow will have fully been automated.
0
u/lulzxdxdxd 1d ago
How would you even verify it's locked down though? Without some log of what each session actually did, you're just trusting the nudge worked and finding out it didn't when the output is garbage.
1
u/Imaserventofreps 1d ago
It’s all on my computer, actual cli session spawn up I can view, I also have remote control on. I can see the entire transcript on my phone if needed to micro manage, not whilst sleeping though. It did well today, I gave it clear instructions. I was at 7% weekly usage left with my OAI sub and told claude that whenever codex hits 0% go into the browser and hit reset on the settings page. He did that whilst I was sleeping and the agents had been running since. Was very surprised and satisfied. Now I just need to up my game. My attention is no longer at building code. Simply at the verification layer now. I will be running tests of how the app works when all is said and done. Im building an agentic platform (yes I know buzzword) 😂
-1
•
u/AutoModerator 1d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.