Claude Code Adds a '/fork' Command: Anthropic Brings Git-Style Branching to AI Coding Sessions
Resumo
Anthropic lançou comando '/fork' no Claude Code, permitindo ramificação de sessões de IA como no Git, elevando a ferramenta de codificação mais rápida em crescimento da empresa.
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, as covered in a Build 2026 roundup by Geeky Gadgets. 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: forking a session to compare two prompt strategies or two implementation paths is now a single command rather than a careful manual juggle of context.
How it fits with nested sub-agents
The "/fork" command is more useful read alongside the feature that preceded it. Claude Code's nested sub-agents let a primary session spawn coordinated sub-agents that work on parts of a task in parallel, a way to decompose a large job into pieces that run concurrently. Where sub-agents divide one approach into parallel work, 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 merge 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.
Why this is a developer-adoption story
Step back and the feature is a data point in a larger trend. Claude Code has become Anthropic's growth engine, and the adoption is bottom-up: developers pick it up, and the spend follows. One analysis cited by industry coverage estimated that around 4 percent of all public commits on GitHub worldwide were being authored by Claude Code at a recent measurement, a striking figure for a single tool. Session-management features like forking and sub-agents are how Anthropic deepens that foothold, by making agentic coding more controllable and less of a leap of faith.
The technical significance is that these features attack the core weakness of AI coding agents: trust over long, multi-step work. As tasks get longer, the chance that an agent goes down a wrong path compounds, and once it does, salvaging a single linear session is painful. Forking turns that risk into a cheap experiment, branch, try the risky approach, and discard the branch if it fails, while sub-agents let work proceed in parallel instead of 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. That is the kind of unglamorous reliability improvement that determines whether teams trust an AI tool with real work.
What developers can do with it now
The practical workflow shift is straightforward. A developer can fork a session to A/B two different prompting strategies or implementation approaches against the same context, compare the results, and keep the better one without re-establishing context from scratch. Combined with sub-agents, a single developer can run a primary session that delegates parallel sub-tasks while keeping experimental branches isolated. As with any fast-moving tool, the exact command syntax and behavior are best confirmed against Anthropic's official documentation, since Claude Code's feature set has been changing on a near-weekly cadence.
Frequently Asked Questions
What does the Claude Code /fork command do?
It branches an existing Claude Code session into a parallel variant, letting a developer test an alternative approach to the same problem without losing the original session's state and context. If the new branch does not pan out, the original session remains intact.
How is /fork different from nested sub-agents?
Sub-agents split one approach into parallel sub-tasks that a primary session coordinates. Forking creates parallel approaches by copying a session so you can try different strategies independently. Used together, they let developers decompose work and explore alternatives at the same time.
Why is Claude Code significant for Anthropic?
Claude Code is the fastest-growing product in Anthropic's history and a key driver of its enterprise adoption. One estimate put about 4 percent of all public GitHub commits as authored by Claude Code, and bottom-up developer adoption has helped Anthropic's business standing rise sharply in 2026.
Where can I confirm the exact /fork syntax?
In Anthropic's official Claude Code documentation. The tool's features have been updating frequently, so the official docs are the authoritative source for current command syntax and behavior.