AI Coding Workflow Guides
Practical guides and tutorials on running AI coding agents in parallel, reviewing AI-generated code, and using git worktrees for isolated development workflows. Whether you use Claude Code, Codex CLI, or Gemini CLI, these tutorials help you get more done with less waiting.
Parallel Code runs multiple agents in separate git worktrees. These guides cover how to choose independent tasks, set up working copies, and review the results before integration.
Start here
- Run multiple AI agents on one repo
Split tasks, isolate sessions, review output, and integrate changes in order.
- Understand Git worktrees
Create a working copy, understand shared state, troubleshoot, and clean up safely.
Codex Shell Environment Policy: Exclude Secrets
Configure Codex CLI environment filters, understand exclusion order, and reduce the risk of shell startup files restoring filtered secrets.
Gemini CLI: Read Gitignored Files
Learn how to let Gemini CLI read gitignored files, diagnose failed .geminiignore exceptions, and change file filters without editing Git rules.
Claude Code: Stop Background Tasks in One Session
Learn how to identify and stop Claude Code background agents and shell tasks in one session while leaving other sessions running.
Claude Code: Deny Reading .env Files—Setup and Scope
Configure Claude Code to deny reading .env files, check path matching, and learn which file reads need sandbox enforcement across shell commands.
Claude Code Stop Hook: Run Tests Without an Infinite Loop
Configure a Claude Code Stop hook to run tests in the active worktree, return actionable failures, and prevent repeated automatic repair attempts.
Codex Project Config Disabled in a Worktree
Fix ignored Codex CLI project configuration in Git worktrees by finding the correct repository trust path and updating your user-level config.
Codex Exec --output-schema: JSON Reports
Use codex exec --output-schema for structured JSON reports, save the final response, and capture JSONL events separately.
Git Detected Dubious Ownership in Containers
Diagnose Git ownership mismatches inside agent containers, add a specific safe.directory exception, and keep repository trust narrowly scoped.
Claude Code --max-turns: Headless Limits
Learn to cap Claude Code headless runs with --max-turns, detect limit errors in JSON, and decide when to review, retry, or resume.
Gemini CLI FatalUntrustedWorkspaceError: Headless Fix
Learn why Gemini CLI rejects an untrusted worktree in headless mode and how to trust the intended directory permanently or for one invocation.
Git Revert a Merge Commit Already Pushed
Undo an agent branch already merged into a shared branch, choose the correct git revert mainline parent, and restore corrected work safely.
Codex CLI Profiles for Parallel Sessions
Give parallel Codex CLI sessions different model, reasoning, and sandbox settings with profile files, launch commands, and override rules.
git restore Single File From Another Branch
Learn how to copy one committed file from an agent branch with git restore, protect local edits, review the diff, and commit it separately.
Codex Review: Base Branch vs Uncommitted
Compare Codex review base branch versus uncommitted changes, learn when to use --commit, and preview the intended agent diff.
Claude Code Worktree Permissions Missing?
Learn why Claude Code permissions differ between worktrees, where settings.local.json lives, and how to share rules across sessions safely.
Playwright MCP Browser Already in Use: Parallel Agents
Fix Playwright MCP browser profile conflicts between parallel coding agents using isolated sessions, separate user data directories, and saved login state.
Claude Code Compaction Hook: Keep Task Context
Keep task instructions and saved progress after Claude Code compaction with a SessionStart hook, durable checkpoint files, and verification steps.
Git range-diff: Review Changes After Rebase
Use git range-diff to review changes after a rebase, recover the right commit tips, and investigate dropped work or altered conflict resolutions.
Codex CLI npm install: Sandbox Network Fix
Diagnose npm install failures in Codex CLI, enable sandbox network access, and fix cache or registry issues while keeping filesystem limits.
Git: Recover Commits After Deleting a Worktree and Branch
Find and rescue agent commits after deleting a Git worktree and branch, using reflogs and fsck, and understand when recovery is no longer possible.
Claude Code Fork Session Into a New Worktree
Fork a Claude Code conversation into a separate Git worktree, choose the starting commit, and keep conversation history and file changes independent.
Claude Code Using API Credits Instead of Pro or Max
Learn how to check Claude Code authentication, remove an API key override, restore Pro or Max billing, and prevent unexpected API credit charges.
Claude Code Notification When Waiting for Approval
Set up Claude Code approval notifications on macOS and Linux, with worktree paths and session IDs to identify the parallel session needing attention.
Claude Code Rewind Not Undoing Changes?
Learn which edits Claude Code /rewind restores, why shell commands and external changes remain, and how to recover remaining changes with Git.
Git Worktree in Docker: Fix “Not a Git Repository”
Fix Git worktree errors in Docker by mounting the working tree, private Git directory and shared repository metadata at the correct paths.
Is Claude Code Auto Memory Shared Between Worktrees?
Learn why Claude Code shares auto memory across Git worktrees, how to isolate each task's notes, and which settings can undo that isolation.
Git Worktree Repair After Moving a Directory
Use git worktree repair after moving a directory or main repository, verify both administrative links, and avoid pruning a worktree you still need.
Git Status Shows Worktree Folders as Untracked
If git status shows worktree folders as untracked, learn how nested paths cause it and how to fix the layout or apply local or shared ignore rules.
Git Config Per Worktree: Set User Email for One Agent
Learn how to set user.name and user.email for one Git worktree, verify the commit identity, and avoid changing sibling worktrees.
Git rerere for Repeated Agent Branch Conflicts
Use git rerere to reuse resolutions for repeated merge conflicts across agent branches, then review and stage each result before merging.
Codex Max Concurrent Subagents Config: Set a Limit
Learn the Codex config key that caps subagents per session, where to set it, how to override it for one run, and what the limit counts.
How to Push a Git Worktree Branch to a Remote
Learn how to publish a Git worktree branch, set its upstream, verify the remote target, and handle missing commits or rejected pushes.
Git Worktree: Track an Existing Remote Branch
Create a Git worktree from an existing remote branch, set its upstream, verify tracking, and avoid detached HEAD and branch conflicts.
Codex Worktree Detached HEAD: Create a Branch
Learn how to put a detached Codex worktree on a named Git branch, preserve its commits, handle branch conflicts, and merge or push the result.
Claude Code Project Skills Missing in Worktrees
Find why Claude Code project skills disappear in git worktrees, check tracked files and skill scope, and choose a reliable fix for each session.
Coding Agent Prompt Injection in Pull Requests
Learn how to inspect untrusted PR text and repository files, limit agent permissions, and review changes before allowing code or CI to run.
Claude Code Max Budget USD for Headless Runs
Use Claude Code --max-budget-usd for headless runs, see what estimated API spend the cap covers, and understand why billing may differ.
GitHub Actions Concurrency for Agent Pull Requests
Learn how to cancel obsolete GitHub Actions runs per agent pull request, keep other branches' checks running, and avoid concurrency key mistakes.
Fix Git config.lock Errors in Parallel Worktrees
Learn why concurrent agent worktrees can hit Git config.lock, how to inspect partial results, and how to retry creation without losing work.
Resolve package-lock.json Merge Conflicts Between Agents
Resolve a package-lock.json merge conflict between parallel agent branches: combine dependency changes, regenerate the lockfile, and validate with npm ci.
gh issue develop: Checkout a GitHub Issue Worktree
Use gh issue develop to create an issue-linked agent worktree, verify the branch, handle existing branches, review changes, and clean up safely.
gh pr create --draft From a Git Worktree
Learn to use `gh pr create --draft` from a Git worktree: inspect the agent branch and push remote, review the diff, then open a draft PR.
Git Diff Two Worktrees' Uncommitted Changes
Learn how to compare two agent worktrees before either commits, including staged files, untracked files, different starting commits, and diff exit codes.
Run AI Coding Agents Non-Interactively in Parallel Worktrees
Learn to run Claude Code, Codex CLI, Gemini CLI, and Copilot CLI non-interactively in parallel Git worktrees, then review and merge their changes.
Running Ten Agents Was the Easy Part
Parallel Code started as a way to run coding agents side by side. Version 4 is about the harder part: understanding and checking their work before you merge.
Claude Code Worktree Git LFS Pointer Files: How to Fix Them
Learn why Claude Code worktrees can contain Git LFS pointer files, how to fetch the real content, and which settings to check when pointers persist.
Claude Code Worktree From a Pull Request
Learn how to open an existing pull request in an isolated Claude Code worktree, inspect its changes, make fixes, and avoid updating the wrong branch.
Prevent AI Coding Agents Pushing to Main on GitHub
Set GitHub branch rules that require pull requests, passing CI checks, and review before an AI coding agent’s changes can reach main.
Git Sparse Checkout Per Worktree for AI Agents
Set distinct sparse checkout directories for each Git worktree, verify each agent's view, and handle shared files, dependencies, and config safely.
Copilot CLI: New Conversation in a Worktree
Learn how to start a second Copilot CLI conversation in a new Git worktree, keep the first session running, and review and merge the results.
Verify an Agent Is in the Correct Git Worktree
Learn the Git commands that confirm an AI agent's worktree path, checked-out branch, repository identity, and pending changes before edits or commits.
Is Git Stash Shared Between Worktrees?
Learn why Git stash is shared across worktrees, how one agent can apply another's changes, and how to keep unfinished work separate.
AI Agent Worktree index.lock Permission Denied
Learn why an agent can edit a Git worktree but cannot stage or commit, how to locate the blocked index.lock, and which fixes preserve sandboxing.
Git Worktree Submodules Not Initialized: How to Fix It
Learn why submodule directories are empty in a new agent worktree, how to initialize them, and what to check when files are still missing.
Claude Code Worktree From Current Branch
Learn why Claude Code worktrees can start from main, how to inherit your feature branch’s commits, verify the base, and fix an existing worktree.
Git Hooks Not Running in a Worktree? Fix the Path
Find why Git hooks stop running in agent worktrees, inspect the effective hooks path, and configure shared or per-worktree hooks safely.
Parallel Coding Agents and Duplicate MCP Servers
Learn why parallel agent sessions launch duplicate MCP server processes and how to disable unneeded servers in Claude Code, Codex CLI, and Gemini CLI.
How to Detect When Codex Exec or Claude Code Finishes
Learn to distinguish completed, failed, and stalled Codex exec or Claude Code headless runs using process status, JSON events, time limits, and review checks.
Cherry-Pick a Commit Between Git Worktrees
Learn how to cherry-pick one completed fix between Git worktrees, resolve conflicts, check dependencies, and keep both agents' branches separate.
How to Update a Git Worktree Branch From Main
Learn to update a Git worktree branch from main during an active agent task, protect unfinished edits, resolve conflicts, and review the result.
Git Worktree Branch Already Checked Out: Safe Fixes
Fix the Git worktree branch already checked out error: find the owning worktree, inspect agent edits, and safely reuse or release the branch.
Why AI Agent Worktrees Miss Uncommitted Changes
Learn why AI agent worktrees miss edits in your main checkout, then use a commit, stash, or patch to give an agent the changes it needs.
Gemini CLI --worktree for Parallel Sessions
Enable Gemini CLI worktrees, launch concurrent sessions in separate directories, and review, merge, resume, and clean up their changes.
Resume a Coding Agent Session in the Right Git Worktree
Learn how to find the right Git worktree, check its branch and pending changes, then resume a Claude Code, Codex, or Gemini CLI session safely.
Parallel AI Coding Agents: Handle 429 Rate Limits
Handle 429 rate limits in parallel AI coding agents: identify shared quotas, stagger sessions, and retry temporary errors without wasting requests.
Clean Up Stale AI Agent Git Worktrees Safely
Learn to clean up stale AI agent Git worktrees by auditing files and commits, preserving unfinished work, and removing worktrees and branches safely.
Parallel AI Agents: Stop Sharing a Test Database
Learn how to give each parallel AI agent its own test database, run migrations safely, isolate Compose stacks, and verify connections before tests.
AGENTS.md and CLAUDE.md: One Context File for Every Agent
Claude Code, Codex, Gemini CLI, and Copilot CLI read different instruction files. How to keep one source of truth without duplicating it four ways.
Is It Safe to Run AI Coding Agents With Permissions Off?
Skipping approval prompts is not the same as sandboxing. What each agent's permission and sandbox settings actually enforce, and what parallel runs change.
How to Merge Work From Parallel AI Agents
Parallel agents finish on separate branches. A practical integration workflow: test the merges before you run them, pick an order, and keep main releasable.
How to Run Multiple Claude Code Agents in Parallel
Run multiple Claude Code agents with worktrees, agent view, subagents, cloud sessions, or Parallel Code—and know when to choose each approach.
How to Use Claude Code and Codex Together: 4 Practical Workflows
Use Claude Code and Codex together for parallel tasks, cross-review, handoffs, and races—with isolated working copies when both agents write.
How to Run Multiple Codex Agents in Parallel
Run multiple Codex agents using the desktop app, CLI worktrees, subagents, cloud tasks, or Parallel Code—and know when to choose each approach.
How to Write Better Prompts for AI Coding Agents
A practical AI coding agent prompt template for clearer scope, focused diffs, stronger verification, and fewer avoidable retries.
AI Coding Agent Best Practices: A Practical Workflow
Use AI coding agents without losing control. These 10 best practices cover task scope, worktree isolation, tests, review, security, cost, and merging.
What Does Running Multiple AI Agents in Parallel Actually Cost?
Learn how subscriptions, metered APIs, repeated context, and redundant races affect the real cost of running multiple AI coding agents.
Running AI Coding Agents on Linux: Your Real Options
Choose and install AI coding agents on Linux. Compare native apps, Claude Desktop's Ubuntu and Debian beta, Vibe Kanban, and terminal workflows.
Racing AI Agents: Run Claude, Codex, and Gemini on the Same Task
Stop guessing which agent is best. Run several on the same task in parallel, then keep the winning diff. How to race AI coding agents and judge the results.
How to Split a Feature Into Parallel AI Agent Tasks
Parallel agents only save time when tasks don't overlap. A practical guide to splitting a feature into independent tasks you can run at the same time.
Multi-Agent Coding Tools in 2026: Manual, Interactive, and Unattended Workflows
Choose how to run multiple coding agents, from manual worktrees and interactive sessions to unattended workflows that produce pull requests.
How to Use Multiple AI Coding Agents on One Repo
A practical guide to running Claude Code, Codex CLI, and Gemini CLI on one codebase without working-copy collisions or merge chaos.
Claude Code vs Codex vs Gemini CLI Compared
A practitioner's comparison of the three major AI coding agents — code quality, cost, and speed — with guidance on when to use each.
AI Agent Isolation: Separate Working Copies for Concurrent Tasks
Why every parallel AI coding agent needs its own git worktree, branch, and working directory before you scale beyond one session.
Git Worktrees: Why AI Agents Need Them
Git worktrees let you check out multiple branches simultaneously from one repo. Here's how they work and why they matter for parallel development.
How to Review AI-Generated Code Efficiently
AI agents write code fast, but reviewing it is the real bottleneck. A practical checklist and workflow for staying in control.