﻿# What should survive when Claude Code stops one workflow agent?

Define the stopped branch’s output contract and verify that independent agents keep running.

Author: Retrivium editorial team
Updated: 2026-12-01
Canonical URL: https://retrivium.ai/journal/daily-20261201-agents-claude-selective-cancellation/
Language: en

Claude Code v2.1.333, published November 30, added the ability to stop one running agent while other agents in the workflow continue. This is useful when one branch is no longer needed or has been assigned erroneous input. The release establishes the availability of selective cancellation. Each workflow still has to define what stopping means for its outputs and dependencies.

## Track each branch’s state

Distinguish an agent that is still running, one that finished successfully, and one that stopped. An artifact the stopped agent wrote earlier may still exist. Require a completion record tied to the correct branch before a later step consumes an output. A stop request alone cannot tell the workflow whether a tool call committed a change before cancellation took effect.

## Give downstream steps a clear rule

A step that depends on the stopped agent should wait for a replacement or report a missing input. An independent sibling should finish under its original deadline. Aggregation should make the distinction visible, for example by showing which planned inputs were used. Without this bookkeeping, a partial run can be mistaken for full coverage.

## Rehearse on a small workflow

Run two read-only tasks and stop one while both are active. Confirm that the other finishes and that the combined result records the canceled branch. Repeat with a harmless intermediate file and verify whether it remains. Adopt selective cancellation when the workflow can account for both results and unfinished work.

## Make restarts explicit

Give a replacement run its own identifier and keep a reference to the branch it replaces. If a stopped worker created a draft file, the successor can choose to inspect it, archive it or generate a clean result according to the workflow. Put finished artifacts in a predictable location and record who produced them. Teams that publish results can place the actual publication step outside the set of workers, behind a check for required inputs. That model lets one worker stop without implying that unfinished output became ready or that a previously completed action was reversed.

## Sources

- [Primary source · code.claude.com](https://code.claude.com/docs/en/workflows)
- [Primary source · claude-code v2.1.333](https://github.com/anthropics/claude-code/releases/tag/v2.1.333)

## Related reading

- [How Claude Code gives a subagent a separate context](/journal/learn-claude-subagent-context/)
- [Qwen Code bounds cancellation settlement on its event-bus loop](/journal/week46-agent-qwen-event-loop-cancel-settlement/)
