Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.227 Home All releases olderv2.1.226 v2.1.228newer
Claude Code v2.1.227

Spawned agents can be clamped to a fixed set of shell commands

Use it now
Useful3 Signal2
Subagents not in their notes

Spawning an agent with a bad command clamp list now fails immediately instead of running unclamped.

bashCommandClamp
What

The agent() spawn API gained a bashCommandClamp option: a list of Bash(...) permission rules that limits which shell commands the spawned agent may run. It is checked strictly at spawn time, so a malformed list, an entry that does not parse as a Bash rule, or one with empty or space-padded contents aborts the spawn instead of quietly running the agent with no clamp.

Details
  • Entries take the form Bash(<command or prefix>), matching the usual permission rule syntax.
  • Rejection message when the option is not a list of non-empty strings: agent() opts.bashCommandClamp must be an array of non-empty strings; got .
  • The option is now part of the serialized list of spawn options, alongside disallowedTools.
Usage
agent("audit the build", { bashCommandClamp: ["Bash(npm test)", "Bash(git log:*)"] })
Evidence

agent() opts.bashCommandClamp must be an array of non-empty strings; got

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.227 →