r/ClaudeCode • u/ThePenguinVA • 8h ago
Tips & Workflows Using hooks and skills I have three concurrent instances all working in the same branch, coordinating testing and deploys
I have one side hustle client. He's all in on AI just doesn't know or want to know how to use "computers" beyond some basic functionality.
He's a real estate agent who uses lots of different pieces of software. So I am building an orchestrator that facilitates some pretty cool automated workflows between the different tools, and alerts a human immediately if it encounters a problem, or it's time for one of the pre-defined human steps.
I also build and maintain his website, and I am building a membership program for him.
Those 3 projects all have deadlines and needs and so I will have a Claude Code instance open for all of them at the same time. What one does can and will impact the others.
So I created a hook that fires on any first message to an instance that gathers all the required context for the project at large and its specific part of it. Because my client often sends me his random thoughts for the project in text or email, the hook also checks my text and email. It files the relevant information in the various instances boards, and then it is ready to begin. The next instance fires the hook, sees the texts and emails that have been filed for its review, etc.
Then, when any instance is done, I have a skill to wrap up the session. It updates all relevant materials, commits any outstanding information, updates build plans or sources of truth, etc. Then it dispatches an agent to ensure that the next session can start cold from the exact same spot.
I also record all my convos with my client and feed Claude the transcripts and it files it accordingly as well. Even during a session, a new transcript will be filed to the appropriate boards, even if not relevant to the specific instance receiving the transcript.
And, of course, if one of them needs to do something that could impact another instance, like a commit, build, test or deploy, it communicates with the other instances and gets the go ahead. They all work in unison, obey when a test or deploy lock is taken, and make it work.
As always, I have no idea whether I'm doing something the most efficient or practical way, or if I'm reinventing the wheel, but it works for me and I'm proud of it.
•
u/AutoModerator 8h 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.
2
u/hieuphung97 7h ago
The tricky part is concurrent session-wraps. If two instances try committing state updates at the same moment, git index locks fail fast. Serializing commits through an orchestration lock file saved us hours of corrupted handover diffs.
1
u/calunicornia 7h ago
have you used work trees?
1
u/Agile_Stomach9020 5h ago
how are you handling the lock mechanism between the instances? file locks in a shared temp directory work well for this, unless youre already routing it through a local database.
1
u/shetritr 5h ago
the hook reading his texts and emails is the part i'd watch. a random thought from the client filed straight onto a board is an instruction nobody approved. file them as "suggested" and let an instance act only after you tick it