Claude Code's Newest Trick: Branch Your AI Session Like a Git Repo
Anthropic has given its coding tool a feature that sounds small and changes the workflow more than its size suggests. During the same week Microsoft was running its Build 2026 conference, Anthropic introduced a `/fork` command and a new command-line interface for Claude Code. The addition follows a string of updates to the tool tracked on Releasebot's Anthropic changelog, including nested sub-agents, smarter model and region handling, and a new plugin search interface.
For developers, the news is not a flashy capability so much as a quality-of-life shift that maps AI coding onto a habit every engineer already has. And it matters more broadly because Claude Code is not a side project — it is the fastest-growing product in Anthropic's history and a major reason the company's enterprise adoption has surged this year.
What `/fork` Actually Does
The `/fork` command lets a developer branch an existing Claude Code session into a parallel variant. In practice, that means you can take a session — where the model already has the full context of your problem, your files, your earlier instructions — and split off a copy to try a different approach without destroying the original. If the new direction works, you keep it; if it does not, the original session is untouched and you continue from there.
The pattern is borrowed directly from version control. Anyone who uses git branches to develop a feature without disturbing the main codebase will recognize the mental model instantly, which is the point. By matching a workflow developers already trust, Anthropic lowers the learning curve and makes experimentation cheap.
The new command-line interface that ships alongside it extends that philosophy further. Developers can now invoke and manage Claude Code sessions, including forking them, directly from their terminal in a more structured way, without having to context-switch into a separate interface. The combined effect is a developer experience that fits into existing shell scripts, CI pipelines, and editor integrations rather than sitting beside them.
How It Fits with Nested Sub-Agents
The `/fork` command is more useful read alongside the feature that preceded it. Earlier this year, Anthropic introduced nested sub-agents: a primary Claude Code session can now spawn coordinated sub-agents that work on portions of a task in parallel. Rather than a single agent plodding through a long sequential list, the primary session decomposes the job and delegates.
Where sub-agents divide one approach into parallel sub-tasks, forking creates parallel approaches. Together they give Claude Code a session-management model that starts to resemble how engineering teams actually operate: branch to explore alternatives, delegate sub-tasks, then converge on the best result. That is a meaningfully different way of working than the single linear chat thread that defined the first generation of AI coding assistants.
"Most Claude Code users face the same problem: two possible approaches, no way to know which one Claude will execute better, so they pick one and hope," one developer noted in a widely-shared Medium post following the announcement. "If it's wrong, they rewind and try the other — but now they're comparing from memory, and the second attempt always looks better just because it's fresh." The `/fork` command is a direct answer to that frustration.
Agentic Coding Converges on Git-Like Thinking
Step back and the feature is a data point in a larger trend: agentic coding tools are converging on the mental models that version control established decades ago. Branching, parallel workstreams, and the ability to roll back a bad path without losing everything else — these ideas are native to git and now being rebuilt into AI session management.
That convergence is not accidental. The core weakness of AI coding agents over long, multi-step work is compounding risk: as tasks get longer, the chance that an agent goes down a wrong path grows, and once it does, salvaging a single linear session is painful. Forking turns that risk into a bounded experiment. Branch, try the risky approach, and discard the branch if it fails — the original context is preserved. Sub-agents let work proceed in parallel instead of as one fragile sequence. The result is a workflow where a developer can let the agent attempt more ambitious tasks because the cost of a wrong turn is bounded.
One estimate put roughly 4 percent of all public commits on GitHub as being authored by Claude Code at a recent measurement point — a striking figure for a single tool that did not exist two years ago. Session-management features like `/fork` and sub-agents are how Anthropic deepens that foothold, by making agentic coding more controllable and less of a leap of faith.
What to Watch
The feature set is moving fast. Claude Code's changelog on Releasebot logged 343 tracked updates across 13 sources as of mid-June, with version numbers ticking up on a near-daily cadence. A few things are worth watching in the weeks ahead.
First, whether `/fork` gets combined with output comparison tooling — right now, developers branch and compare manually, but a structured diff between session branches would be a natural next step. Second, how deeply the new CLI gets integrated into popular editor extensions and CI/CD pipelines; the real unlock for these features is when they slot into existing automation rather than requiring a separate invocation. Third, and perhaps most important, whether competitors respond: similar branching primitives are a logical addition to any agentic coding tool, and the competitive pressure in this space is high. Anthropic's move sets a new baseline for what "session management" means in AI-assisted development, and the rest of the field will have to respond.
"Most Claude Code users face the same problem: two possible approaches, no way to know which one Claude will execute better, so they pick one and hope."- Developer post on Medium, Claude Code user