[BUG] --agent flag in CLI does not allow all internal tools by default; `tools: Task` doesn't work
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?
claude --agent <agent-type> does not have all internal tools on by default. Note that <agent-type> in this case is not specified with tools nor disallowedTools, though the issue seems to persist with disallowedTools: [] (no tools: settings).
Note: This is true regardless of --resume (i.e. --resume <chat-name> --agent <agent-type>)
The session chat seems to only have these tools (note I disabled WebSearch, you'll probably have it in your own list if not disabled):
- Bash
- Glob
- Grep
- Read
- Edit
- Write
- NotebookEdit
- Skill
- TaskCreate
- TaskGet
- TaskList
- TaskUpdate
- ToolSearch
- ListMcpResourcesTool
- ReadMcpResourceTool
- WebFetch
Full tools list from: https://code.claude.com/docs/en/settings.md
- AskUserQuestion
- Bash
- TaskOutput
- Edit
- ExitPlanMode
- Glob
- Grep
- KillShell
- MCPSearch
- NotebookEdit
- Read
- Skill
- Task
- TaskCreate
- TaskGet
- TaskList
- TaskUpdate
- WebFetch
- WebSearch
- Write
- LSP
UPDATE: tools: Task, ... still does not allow --agent session to use Task!
What Should Happen?
~~It's not clear this is a bug, but~~ the language in the docs is a big ambiguous: https://code.claude.com/docs/en/sub-agents
Perhaps, there should be a reliable way of allowing all tools by default, something like:
tools: all
disallowedTools: Edit, Task
Error Messages/Logs
Steps to Reproduce
- Create a
.claude/agents/basic-agent.md:
```md
---
name: basic-agent
description: "Use this basic agent to test weird behavior?"
model: sonnet
---
You are an awesome and disciplined general-purpose AI agent!
```
- Run
claude --agent basic-agent.md - Prompt:
can you 1. tell me which tools are available to you? 2. try spawning a subagent with 'Task' tool?
Claude will likely respond with something about TaskList/etc. and propose to use Bash.
___
Update: Does not work even when specifying tools: Task:
---
name: basic-agent
description: "Use this basic agent to test weird behavior?"
model: sonnet
tools: Task, Read, Bash
---
...
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.29
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗