PTENES
Skip to content
TRACK 4

🤖 Subagents and Git

Scale Claude Code with parallel subagents and master the Git workflow with AI. Here you’ll learn to orchestrate multiple agents, use worktrees for isolation, and integrate everything into a professional version control and CI/CD pipeline.

Orchestrator Task tool Agent: tests Agent: refactor Agent: docs Agent: lint Agent: feature Git merge PR + CI/CD
6
Modules
36
Topics
~4.5h
Duration
Inter.
Level
Path progress: 0% 0 of 36

Learning path map

Detailed content

4.1~40 min

Subagents — Concepts

What subagents are, the Task tool, and when to use parallelism.

What is:

Subagents are Claude Code instances launched by the main agent to perform isolated tasks.

Why learn:

Allows you to scale work without cluttering the main agent's context.

Key concepts:

Parent-child; context isolation; delegation.

What is:

Claude Code's internal tool for creating subagents with their own prompt and context.

Why learn:

It's the primary interface for orchestrating parallel work.

Key concepts:

Task(prompt); result returned; limited scope.

What is:

Subagents can have different permission levels: read, write, or background.

Why learn:

Choosing the right type avoids conflicts and reduces risk.

Key concepts:

Principle of least privilege; specialized agents.

What is:

The parent sends instructions and context; the child returns a text result when it finishes.

Why learn:

Understanding the workflow prevents information loss between agents.

Key concepts:

Input prompt; structured output; no shared state.

What is:

Git worktrees let each subagent work on files without conflicting with others.

Why learn:

Without isolation, parallel agents step on each other’s toes.

Key concepts:

git worktree; temporary branch; merge later.

What is:

Subagents have context overhead and cost. Not every task warrants parallelism.

Why learn:

Avoid wasting tokens on simple tasks.

Key concepts:

Overhead vs. gains; independent tasks; minimal complexity.

4.2~45 min

True Parallelism

Launch multiple agents, collect results, and handle errors in parallel.

What is:

Trigger multiple Task tools simultaneously for independent tasks.

What is:

Identify tasks that don't depend on one another so they can run simultaneously.

What is:

Use git worktree add to create isolated workspaces for each agent.

What is:

Run long tasks in the background while the main agent continues working.

What is:

Gather the outputs from all subagents and consolidate them into a final result.

What is:

Strategies for handling partial failure: retry, skip, or abort.

4.3~50 min

Multi-Agent Patterns

Architectural patterns: fan-out/in, pipelines, specialists, and cost control.

What is:

Distribute work to N agents and bring the results together in one place.

What is:

Chain agents so that one agent’s output feeds the next.

What is:

One agent explores the codebase, another plans, and another executes. Separation of concerns.

What is:

Agents with specific prompts for tests, docs, lint, or security.

What is:

Retry, fallback, and circuit-breaker patterns adapted for AI agents.

What is:

Limit tokens per subagent, use smaller models for simple tasks, measure ROI.

4.4~40 min

Git with AI — Version Control

Semantic commits, smart staging, and merge conflicts with Claude.

What is:

Claude analyzes the diff and generates commit messages following the conventional commits standard.

What is:

Claude selects logically related files for atomic commits.

What is:

Ask Claude to review the diff before committing, catching bugs and inconsistencies.

What is:

Claude understands the context on both sides and resolves conflicts semantically.

What is:

Use short, focused branches that make it easier for the agent to work.

What is:

Protect secrets (.env, keys) and prevent the agent from committing sensitive files.

4.5~45 min

Pull Requests and Code Review

Automated PRs with gh CLI, AI review, and best practices.

What is:

Claude uses gh pr create to open PRs with automatic titles, descriptions, and labels.

What is:

Use Claude to review colleagues' PRs or the agent's own PRs before merging.

What is:

Integrate CI checks into the workflow so Claude only merges when everything is green.

What is:

Claude reads review comments and automatically makes the requested changes.

What is:

Maintain a linear, readable history with squash merges and interactive rebase.

What is:

Small, focused, well-described PRs with passing tests: the recipe for a fast merge.

4.6~50 min

CI/CD and GitHub Actions

Automate deployment, testing, and security with GitHub Actions and Claude.

What is:

GitHub event-based automations: push, PR, schedule.

What is:

Use Claude Code in GitHub Actions for automatic review, fixes, and deployment.

What is:

Run test suites on every push and block merges if they fail.

What is:

Automatic deployments after merge: Vercel, Railway, Docker, etc.

What is:

Dependabot, CodeQL, and secret scanning integrated into the pipeline.

What is:

Failure notifications, health checks, and automatic rollback.