[BUG] Default custom agent in VSCode extension is ignoring the "tool" directive
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?
Custom agents can restrict what tools are used when running them using the "tools" setting in the agent frontmatter definition (see https://code.claude.com/docs/en/sub-agents#available-tools).
When specifying a default agent in ~/.claude/settings.json and running this agent in the VSCode extension, the tools definition is ignored and all tools are exposed to the LLM
What Should Happen?
Only the tools listed in the "tools" section of the agent frontmatter should be exposed to the LLM
Error Messages/Logs
Steps to Reproduce
- Create a new custom agent, my-agent.md
---
name: my-agent
description: You are a custom agent
model: inherit
tools: Skill
---
Some description
- In ~/.claude/settings.json add this line:
"agent": "my-agent.md",
- Start the VSCode with the extension
- Type a message in the Claude Code extension and send it
- Observe that the tool definition in the anthropic message definition sent to the LLM contains all tools instead of just the "Skill" tool
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.89
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
This works as expected in the CLI version of Claude Code
We also tried adding the additional line
disallowedTools: Agent, Edit, Write, Read, Grep, Glob
into the frontmatter but that also did not prevent the tools from adding to the context
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗