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

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.

codex-cli security tutorial ai-coding

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.

gemini-cli tutorial ai-coding

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 workflow multi-agent ai-coding

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 security tutorial ai-coding

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.

claude-code tutorial git-worktrees ai-coding

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-cli git-worktrees tutorial ai-coding

Codex Exec --output-schema: JSON Reports

Use codex exec --output-schema for structured JSON reports, save the final response, and capture JSONL events separately.

codex-cli tutorial workflow ai-coding

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.

git-worktrees security tutorial ai-coding

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.

claude-code tutorial workflow ai-coding

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.

gemini-cli git-worktrees security tutorial ai-coding

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.

git-worktrees tutorial code-review ai-coding

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.

codex-cli parallel-development tutorial ai-coding

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.

git-worktrees tutorial code-review ai-coding

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.

codex-cli code-review git-worktrees ai-coding

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.

claude-code git-worktrees workflow ai-coding

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.

multi-agent tutorial ai-coding

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.

claude-code tutorial workflow ai-coding

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.

code-review git-worktrees workflow ai-coding

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.

codex-cli tutorial security ai-coding

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.

git-worktrees tutorial ai-coding

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 git-worktrees tutorial ai-coding

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 cost tutorial ai-coding

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 tutorial multi-agent ai-coding

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.

claude-code workflow git-worktrees ai-coding

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.

git-worktrees tutorial ai-coding

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.

claude-code git-worktrees parallel-development ai-coding

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-worktrees tutorial ai-coding

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-worktrees workflow ai-coding

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-worktrees workflow ai-coding

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.

git-worktrees code-review multi-agent ai-coding

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.

codex-cli multi-agent workflow ai-coding

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-worktrees workflow code-review ai-coding

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.

git-worktrees tutorial ai-coding

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.

codex-cli git-worktrees tutorial ai-coding

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.

claude-code git-worktrees tutorial ai-coding

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.

security code-review best-practices ai-coding

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.

claude-code cost workflow ai-coding

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.

parallel-development workflow ai-coding

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.

git-worktrees multi-agent workflow ai-coding

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.

git-worktrees tutorial multi-agent ai-coding

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.

git-worktrees workflow tutorial ai-coding

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-worktrees code-review workflow ai-coding

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.

git-worktrees code-review ai-coding

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.

git-worktrees multi-agent workflow ai-coding

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.

release code-review ai-coding parallel-development

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 git-worktrees ai-coding

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.

claude-code git-worktrees code-review ai-coding

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.

security code-review ai-coding

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.

git-worktrees multi-agent workflow ai-coding

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.

git-worktrees parallel-development ai-coding

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.

git-worktrees best-practices ai-coding

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.

git-worktrees multi-agent workflow ai-coding

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-worktrees security ai-coding

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.

git-worktrees tutorial ai-coding

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.

claude-code git-worktrees ai-coding

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.

git-worktrees workflow ai-coding

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.

multi-agent workflow ai-coding

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.

codex-cli claude-code workflow ai-coding

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.

git-worktrees multi-agent workflow ai-coding

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-worktrees parallel-development workflow ai-coding

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.

git-worktrees workflow ai-coding

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.

git-worktrees workflow ai-coding

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.

gemini-cli git-worktrees parallel-development ai-coding

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.

git-worktrees claude-code codex-cli gemini-cli ai-coding

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.

best-practices multi-agent cost ai-coding

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.

git-worktrees code-review ai-coding

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.

multi-agent git-worktrees best-practices ai-coding

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.

ai-coding claude-code codex-cli multi-agent workflow best-practices

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.

ai-coding security multi-agent claude-code codex-cli best-practices

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.

ai-coding multi-agent git-worktrees workflow tutorial

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.

ai-coding claude-code multi-agent git-worktrees tutorial

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.

ai-coding claude-code codex-cli multi-agent workflow tutorial

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.

ai-coding codex-cli multi-agent git-worktrees tutorial

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 prompt-engineering workflow best-practices tutorial

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.

ai-coding workflow best-practices multi-agent tutorial

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.

ai-coding multi-agent cost workflow developer-tools

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.

ai-coding linux multi-agent developer-tools comparison

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.

ai-coding multi-agent claude-code codex-cli gemini-cli workflow

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.

ai-coding multi-agent parallel-development workflow tutorial

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.

ai-coding multi-agent comparison developer-tools workflow

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.

ai-coding multi-agent git-worktrees workflow tutorial

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-coding claude-code codex-cli gemini-cli comparison

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.

ai-coding git-worktrees parallel-development claude-code

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.

git git-worktrees developer-tools tutorial

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.

ai-coding code-review workflow best-practices