← Claude Code, start to finish
Claude Code

Scaling Claude Code: From One Session to a Whole Team

4 Aug 2026·6 min read

Day 9 covered the advanced side of Claude Code. Today is the last stage of the roadmap — Stage 6, Scaling — where Claude Code leaves the single chat window and starts running across scripts, branches, and teams of agents.

Headless mode: Claude in your scripts and CI

Headless mode means running Claude Code without the chat. You add the -p flag with a prompt, and it runs once and prints the result. It reads stdin and writes stdout like any command, so you can pipe a diff or a log straight in. For CI, add --bare so it gives the same result on every machine.

claude -p "Run the test suite and fix any failures" --allowedTools "Bash,Read,Edit"
Run Claude non-interactively and pre-approve the tools it may use.

Worktrees and parallel sessions

A git worktree is a separate checkout on its own branch. Run claude --worktree feature-auth in one terminal and the same command with another name in a second, and each session gets an isolated checkout so the edits do not collide. To watch many sessions from one screen, open claude agents — each background session runs under a supervisor and keeps going even after you close the terminal.

Agent teams: a lead plus teammates

Subagents report back to your main session. Agent teams go further: one session becomes the lead and spawns teammates that each work in their own context window, coordinate through a shared task list, and message each other directly. This is great for parallel review or competing debugging theories. It is experimental, so turn it on with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, then describe the task and let the lead coordinate. Three to five teammates is a good start.

opusplanSet the model to opusplan so Opus does the planning and Sonnet does the execution — strong reasoning for the plan, a cheaper and faster model for the build.

Next post: the everyday workflow — plan mode, permission modes, and managing your sessions.

Scaling Claude Code: From One Session to a Whole Team · Ali Huzaifa