r/aipromptprogramming • u/rodrigues_92 • 12m ago
I don't write code, and 358 PRs from parallel AI chats merged into my repo last month. Four rules made that safe, and hooks enforce them, not prompts
I run a construction company and build its management platform with AI coding chats, several at once on one repo. Worktrees stopped the overwrites, but three things kept breaking: parallel test suites hammered one machine until the SSD threw media errors, a second PR merged without being tested on top of the first, and the model that wrote a change also approved it.
Now every chat goes through the same pipeline: its own worktree, a machine-wide test queue, a PR, review by a different model (Codex or Gemini reviews Claude's work) and a merge lock that re-tests if the base moved. The reviewer can commit small fixes, but the runner caps that in code: 5 files, 80 lines, tests can only grow, no dependency changes.
Two extras people asked about: a hook sends search-type subagents to Haiku (same search, same answer, about 9x cheaper in one measured run, though slower), and helper work can run on Codex or Gemini CLI per chat when Claude limits get tight. When the chats finish, a sweep removes merged worktrees and frees the node_modules inside them.
It's 5 skills, MIT, zero dependencies, for Claude Code, Codex and Gemini CLI on GitHub or GitLab. Install with npx skills add mestrecs/skills, repo at https://github.com/mestrecs/skills. What breaks first for you when you run agents in parallel?
•
u/endofthread-bot 12m ago
Parallel agent execution often breaks when race conditions occur during dependency installation or shared environment configuration. Implement a global lockfile manager to serialize package updates across worktrees and prevent concurrent modification of the shared node_modules directory.
Writing prompts that actually work is easier when you can compare notes with people who have tested them across real tasks. Trade techniques, get feedback on your approach, and see what is working for others in our Discord.
Self-promotion is now allowed on Sundays with the appropriate flair, for all regular contributing members. Contribute during the week, and promote on Sunday.