Repository navigation
Description
Summary
With the Claude Code provider setting "Disable provider subagents" switched on, every new Claude Code thread still receives the full Agent and ListAgents tool definitions plus the list of agent types. The setting's own description says it hides the tool ("Hide Claude Code's native Task tool so agents use bb for delegation"), but it only refuses the call after the model has tried it. I expected the tool text to be absent from the thread, so the model is not offered a tool it cannot use and the thread does not carry about 2,600 tokens of dead context. Sister report for Codex: #2706.
Versions and environment
- bb 0.43.3, desktop app
- macOS 26.5.2 (25F84)
- Provider: Claude Code (built-in
provider-claude-code), Claude Code CLI 2.1.278, bundled Agent SDK 0.3.245 - Models: reproduced on claude-opus-5; the same tools are present in claude-fable-5-1 threads
- Provider settings:
subagentsDisabled = true,workflowsDisabled = false,chromeEnabled = true,memoryEnabled = false - Nothing unusual: local machine, thread in a project checkout environment
Steps to reproduce
bb plugin config provider-claude-code set subagentsDisabled true- Confirm:
bb plugin config provider-claude-codeprintssubagentsDisabled = true (boolean)with the description "Hide Claude Code's native Task tool so agents use bb for delegation." - Start a new Claude Code thread (here: claude-opus-5, permission mode auto) with this prompt:
1. Print the exact names of every tool you were given up-front (not deferred ones), one per line.
2. Print the names of the agent types listed to you, one per line.
3. Call the Agent tool once with subagent_type "general-purpose", description "probe", prompt "Reply OK". Then quote the exact result or error text verbatim.
- The reply lists
AgentandListAgentsamong the up-front tools and 9 agent types, and the Agent call is refused by a hook.
Not tried: toggling the setting off and on again, or a resumed thread.
Expected vs actual
Actual — reply of the probe thread, verbatim:
Up-front tools:
Agent
AskUserQuestion
Bash
Edit
ListAgents
Read
Skill
ToolSearch
Write
Agent types:
claude
codex:codex-rescue
Explore
feature-dev:code-architect
feature-dev:code-explorer
feature-dev:code-reviewer
general-purpose
Plan
statusline-setup
Result of the Agent call, verbatim:
<error>PreToolUse:Agent hook error: bb has disabled Claude Code native subagents; use bb delegation instead.</error>
Expected: with "Disable provider subagents" on, `Agent`, `ListAgents` and the agent-type list are not sent to the model at all, as the setting's description ("Hide … Task tool") says. Same expectation for "Disable Workflow tool" (not tested here).
Evidence
- Probe thread
thr_7z2igtxtp8(archived), parentthr_68ufcgwe8z, projectproj_i8pc24h5c3, environmentenv_rye8dhknar. - Where it happens, read from the shipped bundle
builtin-plugins/provider-claude-code/dist/in bb 0.43.3 (no repo permalink — read from the installed app, not from source):server.jsderiveProviderOptions:providerSubagentsEnabled: context.settings.subagentsDisabled !== truehost.js: the place I found that acts on it is aPreToolUsehook —if (!threadSession.attachment.liveSettings.providerSubagentsEnabled && CLAUDE_PROVIDER_SUBAGENT_TOOL_NAMES.has(input.tool_name))→permissionDecision: "deny"with the reason quoted above.CLAUDE_PROVIDER_SUBAGENT_TOOL_NAMES = new Set(["Agent", "Task"]).- The session params already accept and forward a
disallowedToolsarray to the Agent SDK (...params.disallowedTools && params.disallowedTools.length > 0 ? { disallowedTools: [...] } : {}), but the setting does not appear to add the sub-agent tools to it.
- Cost, how measured: first-request
usage(input + cache write + cache read) of headlessclaude -psessions, Claude Code 2.1.278, claude-opus-5. WithAgent,ListAgents,ReportFindingsand the claude.ai connector tools removed, the first request went from 22,113 to 16,418 tokens; the share ofAgent+ListAgents+ the agent-type list is about 2,600–2,950 tokens, split estimated from text lengths. For scale: a new Claude Code thread here starts at about 52,000 tokens.
What you ruled out
- Not a stale setting:
bb plugin config provider-claude-codeshowssubagentsDisabled = true, and the deny hook fires, so the thread does see the setting. - Not a Claude Code plugin adding the tool:
AgentandListAgentsare Claude Code built-ins; only 4 of the 9 agent types come from plugins (feature-dev, codex). - Not fixable on the user side without collateral damage: the bare-name deny
Agentin~/.claude/settings.jsondoes remove the tool text, but that file is shared with Claude Code outside bb, where native sub-agents are in daily use. - Not the same as Disabled Codex subagents remain advertised, causing deterministic spawn failures #2706: that one is the Codex provider; this is the Claude Code provider, and here the call is cleanly refused — the cost is context, not spawn failures.
Suggested priority and effort (optional)
Every Claude Code thread of every user with this setting on: about 2,600–2,950 tokens per new thread plus a tool that is offered and then refused; no data or work lost; no safe workaround. Suggested fix (small): when the setting is on, add Agent, Task and ListAgents to the disallowedTools the provider already forwards, keep the deny hook as backstop; same for Workflow. Low priority, low effort. > AGENT GENERATED
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
Activity
bb-slop-cop commentedon Sep 22, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Priority: Low · Effort: Low ·
providers,provider-claude-code.Reproduction and root-cause report — PARTIALLY REPRODUCED, high root-cause confidence; label:
partial-repro.Two clean checkouts show that disabling subagents activates the
Agentdeny hook but does not add native subagent tools to the SDK exclusion list. The regression test fails on that missing exclusion in both runs. Live tool descriptions, agent-list visibility, and token overhead remain unverified.No PR: changing SDK tool-permission behavior falls outside this rule’s simple-fix criteria.
Hide disabled Claude Code tools from thread context
Hide disabled Claude Code tools from thread context
Hide disabled Claude Code tools from thread context
Hide disabled Claude Code tools from thread context
Hide disabled Claude Code tools from thread context
Remove Claude Code's subagent tools when bb disables them (#6475)
Remove Claude Code's subagent tools when bb disables them (#6475)