Repository navigation
Remove Claude Code's subagent tools when bb disables them - #6475
Merged
Merged
Conversation
"Disable provider subagents" only denied Agent/Task calls in a PreToolUse hook, so every thread still carried the tool definition and agent list (~2.6k tokens) and the model kept trying a tool it could not use. The session now starts with disallowedTools [Agent, Task], which removes them from the model's context, and flipping the setting restarts the resident session before the next turn. The deny hook is gone. Fixes #3959 Co-Authored-By: Claude Opus 5.5 <[email protected]>
lukes-clanker Bot
pushed a commit
to banjerluke/bb
that referenced
this pull request
Oct 29, 2026
AskUserQuestion, ScheduleWakeup and ReportFindings only pay off when a human is watching, or drive a host-side loop bb does not run, yet every Claude Code thread carries their schemas. ScheduleWakeup alone is the largest schema in the array once Workflow is off, bigger than Bash, Read, Edit and Write combined. "Disable interactive tools" removes them from the model's context through the SDK's disallowedTools, the same launch option upstream now uses for "Disable provider subagents" (get-bb#6475). Both settings feed one disallowed list, so toggling either restarts Claude before the next turn without dropping the other's tools. Off by default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lukes-clanker Bot
pushed a commit
to banjerluke/bb
that referenced
this pull request
Nov 4, 2026
AskUserQuestion, ScheduleWakeup and ReportFindings only pay off when a human is watching, or drive a host-side loop bb does not run, yet every Claude Code thread carries their schemas. ScheduleWakeup alone is the largest schema in the array once Workflow is off, bigger than Bash, Read, Edit and Write combined. "Disable interactive tools" removes them from the model's context through the SDK's disallowedTools, the same launch option upstream now uses for "Disable provider subagents" (get-bb#6475). Both settings feed one disallowed list, so toggling either restarts Claude before the next turn without dropping the other's tools. Off by default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lukes-clanker Bot
pushed a commit
to banjerluke/bb
that referenced
this pull request
Nov 12, 2026
AskUserQuestion, ScheduleWakeup and ReportFindings only pay off when a human is watching, or drive a host-side loop bb does not run, yet every Claude Code thread carries their schemas. ScheduleWakeup alone is the largest schema in the array once Workflow is off, bigger than Bash, Read, Edit and Write combined. "Disable interactive tools" removes them from the model's context through the SDK's disallowedTools, the same launch option upstream now uses for "Disable provider subagents" (get-bb#6475). Both settings feed one disallowed list, so toggling either restarts Claude before the next turn without dropping the other's tools. Off by default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lukes-clanker Bot
pushed a commit
to banjerluke/bb
that referenced
this pull request
Dec 1, 2026
AskUserQuestion, ScheduleWakeup and ReportFindings only pay off when a human is watching, or drive a host-side loop bb does not run, yet every Claude Code thread carries their schemas. ScheduleWakeup alone is the largest schema in the array once Workflow is off, bigger than Bash, Read, Edit and Write combined. "Disable interactive tools" removes them from the model's context through the SDK's disallowedTools, the same launch option upstream now uses for "Disable provider subagents" (get-bb#6475). Both settings feed one disallowed list, so toggling either restarts Claude before the next turn without dropping the other's tools. Off by default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Issue #3959 remains reproducible in main's provider boundary: disabling subagents only registers a PreToolUse deny hook, so no disallowedTools reaches Claude. The supplied commit removes Agent/Task but leaves ListAgents visible. A real Claude Code 2.1.312 process against a local mock Messages API confirmed ListAgents remains with only Agent/Task disallowed.
What changed
Disabled sessions pass Agent, Task, and ListAgents as disallowedTools, removing their tool definitions and embedded agent catalog from the model's offered tools. Retained the hook as a backstop, including ListAgents, for settings changed through steering during an active turn. Unchanged settings keep the process; changed settings restart it before the next new turn and resume the same provider session ID. The default remains false. The setting description, provider overview, skill and configuration reference document this behavior. Workflow behavior is unchanged and is not claimed fixed.
Why toggling restarts Claude (visible change):
SDK 0.3.245 exposes disallowedTools only as a query construction option. Its live applyFlagSettings({permissions: {deny: [Agent, Task, ListAgents]}}) call succeeds but leaves the tools in the next model request. Captured actual HTTP requests for enabled → disabled → enabled in a single process. Tested both installed Claude Code 2.1.312 and the SDK's bundled CLI: live deny settings do not change the offered tool definitions; launch-time disallowedTools does. No supported live tool-list replacement API exists in the installed Query contract. setMcpServers changes MCP tools, not built-in tools.
The process restart may add latency and clears process-local/background work, but resumes the persisted conversation. Steering does not interrupt the current turn: the deny backstop applies immediately when disabling, with tool-list replacement deferred to the next new turn. Re-enabling similarly restores the offered tools on the next new turn.
How you verified
pnpm exec turbo run test lint typecheck --filter=bb-plugin-provider-claude-code: 410 tests in 28 files pass, lint and typecheck pass.pnpm parity --old /tmp/bb3959-main --new . --provider claude-code --allowlist /tmp/bb3959-empty-allowlist.json: 13 passed, 0 failed, 1 process-scoped recording skipped. Empty allowlist intentionally used because the repository's default historical allowlist reports stale entries when comparing two current revisions; no event/row differences are suppressed.Fixes #3959
🤖 Generated with Claude Code