[BUG] A `context: fork` skill silently loses the Agent tool when backgrounded, with no generic signal that it happened
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Per the docs, a context: fork skill runs in the background by default, and a backgrounded fork's subagent gets a fixed built-in tool set that never includes Agent/Task — only background: false in the skill's own frontmatter restores it. This means any forked skill whose instructions delegate further work to subagents (a fan-out, a verify pass) silently loses that capability the moment it runs backgrounded, unless the skill's own prompt happens to notice and say so in its final output. Nothing in Claude Code itself surfaces this — no warning, no tool-denial message, nothing distinguishing a full run from a degraded one.
Concretely: the bundled /code-review plugin's command file is documented (by its own GitHub Actions usage) to delegate to four parallel reviewers plus one validator per finding via the Agent/Task tool. Run locally via Skill({skill: "code-review", ...}) in a session where Agent was otherwise available and in use, it instead ran as a single pass with no fan-out — and only reported this because its own prompt happens to add a self-report line to that effect. A skill author who didn't think to add that would have no way to detect the degradation, and neither would a user relying on it.
This matters most for a workflow that treats a local skill invocation as equivalent to a CI-configured version of the same plugin (e.g. claude-code-action with --allowedTools including Task) — the two silently diverge in capability with no indication anything changed.
What Should Happen?
Either surface when a forked skill is running with the narrowed background tool set (a note in the transcript, or in the skill's own context), or make Agent/Task availability for a context: fork skill something the skill can declare it needs (similar to allowed-tools) rather than something that silently depends on background: false.
Error Messages/Logs
No error or exception is raised — the degradation is silent. The only trace of it is the skill's own final message, which happens to self-report the loss (this is incidental to `/code-review`'s own prompt, not something Claude Code itself surfaces):
"this was a single-pass review without the Agent tool (no multi-agent fan-out, no subagent verify pass)"
Reproduced twice, worded slightly differently each time:
"Note: this was a single-pass review without the Agent tool (no multi-agent fan-out or subagent verify pass)."
Steps to Reproduce
- In an interactive Claude Code session where the
Agenttool is available and has already been used successfully earlier in the session. - Run
/code-reviewagainst any diff or PR (e.g./code-review <owner>/<repo>/pull/<number> low). - Read the review's own final message.
- Observe it self-reports running as a single pass with no
Agenttool available, instead of the four-parallel-reviewers-plus-one-validator-per-finding fan-out that the same plugin runs when invoked throughclaude-code-actionin CI (whereTaskis explicitly kept in--allowedTools).
This is not specific to any one repository or diff — the root cause (background-forked skills never receiving the Agent/Task tool by default) is generic to how context: fork skills run, per Claude Code's own docs.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Before 2.1.218
Claude Code Version
2.1.238
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Versions tested
- Local Windows install: was 2.1.220, updated to 2.1.238.
- A separate cloud/remote session: 2.1.238 — same version as the local install. Re-tested at this version and the issue still reproduces. The globally installed npm package in that environment is separately listed as
@anthropic-ai/claude-code@2.1.42— that discrepancy is unexplained, noted here rather than resolved by guessing. - Confirmed: the issue reproduces at 2.1.238.
Related issues
Searched existing issues before filing; none describe this exact bug, but three are closely adjacent:
- #87300 — the agent-sdk/subagents doc page never mentions fork mode or the foreground/background precedence list at all. Same underlying area, different gap: that's about the SDK docs page being silent on fork mode's existence, not about the consequence of losing
Agent/Taskonce backgrounded. - #88190 —
/code-review --commentsilently degrades to terminal-only printing when the forked review agent lacks the posting tools (ReportFindings, the GitHub inline-comment tool). Same shape of bug (a forked review agent silently missing tools it needs, no error raised), but about the posting transport, notAgent/Taskand the review's own fan-out. - #86426 — one nested background finder agent's task-notification is silently dropped inside
/code-review, parent returns a fabricated status. Different root cause: that presumes the fan-out already started and a piece got lost; this report is about the fan-out never starting at all.