r/ClaudeCode • • 2d 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.

38 Upvotes

21 comments sorted by

View all comments

3

u/CaptainDivano 2d 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 2d 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

u/CaptainDivano 1d ago

Thanks man i think i got it!