[BUG] `tool:` specifications appear to be completely ignored be sub-agents

Resolved 💬 3 comments Opened Jul 30, 2025 by jleibs Closed Aug 15, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.63 (Claude Code)
  • Operating System: Arch
  • Terminal: Kitty

Bug Description

Agents are completely ignoring the tools: specification, wasting tokens and ignoring permission-modeling.
This is inconsistent with the documented specification: https://docs.anthropic.com/en/docs/claude-code/sub-agents#configuration-fields

Steps to Reproduce

Create an agent.
.claude/agents/test-agent.md:

name: test-agent
description: Use the test-agent to test out how sub-agents work.
tools: Read
color: red
---

You are a test agent. Just do what's asked of you and nothing more.

Use the prompt:

Ask the test agent to write all of its tool capabillities to a file named test.txt

Expected Behavior

  • Token usage should be significantly reduced as no tool specifications need to be transmitted to the sub-agent.
  • The agent is unable to Write because it doesn't have access to the Write tool.

Actual Behavior

 Ask the test agent to write all of its tool capabillities to a file named test.txt

● I'll use the test agent to write all of its tool capabilities to a file named test.txt.

● test-agent(Write tool capabilities to file)
  ⎿  Done (1 tool use · 12.7k tokens · 40.1s)                                                                                                     

● The test agent has successfully written all of its tool capabilities to the file test.txt. The file now contains a comprehensive list of all 15
  available tools with their features and usage notes.

The contents of test.txt are now:

Tool Capabilities:

1. Task - Launch a new agent to handle complex, multi-step tasks autonomously
   - Available agent types: general-purpose, test-agent
   - Can execute custom slash commands
   - Launch multiple agents concurrently for maximum performance

2. Bash - Execute bash commands in a persistent shell session
   - Optional timeout up to 600000ms (10 minutes)
   - Default timeout 120000ms (2 minutes)
   - Supports command chaining with ';' or '&&'
   - Output truncated if exceeds 30000 characters

3. Glob - Fast file pattern matching
   - Supports glob patterns like "**/*.js" or "src/**/*.ts"
   - Returns matching file paths sorted by modification time
   - Optional path parameter for search directory

4. Grep - Powerful search tool built on ripgrep
   - Full regex syntax support
   - Filter files with glob or type parameters
   - Output modes: content, files_with_matches, count
   - Context lines support (-A, -B, -C)
   - Multiline matching capability

5. LS - List files and directories
   - Requires absolute path
   - Optional ignore patterns array
   - Prefer Glob/Grep for targeted searches

6. ExitPlanMode - Exit plan mode when ready to code
   - Only for implementation planning tasks
   - Not for research or information gathering

7. Read - Read files from local filesystem
   - Supports text files, images (PNG, JPG), PDFs, notebooks
   - Default 2000 lines limit
   - Optional offset and limit parameters
   - Line numbers in cat -n format

8. Edit - Perform exact string replacements in files
   - Requires reading file first
   - Old string must be unique unless replace_all=true
   - Preserves exact indentation

9. MultiEdit - Multiple edits to single file
   - Array of sequential edit operations
   - Atomic - all succeed or none applied
   - Each edit operates on previous result

10. Write - Write file to local filesystem
    - Overwrites existing files
    - Must read existing files first
    - Prefer editing over creating new files

11. NotebookRead - Read Jupyter notebooks
    - Returns all cells with outputs
    - Optional cell_id parameter
    - Requires absolute path

12. NotebookEdit - Edit Jupyter notebook cells
    - Replace, insert, or delete cells
    - Cell types: code or markdown
    - 0-indexed cell numbers

13. WebFetch - Fetch and process web content
    - Converts HTML to markdown
    - Processes with AI model
    - 15-minute cache
    - Handles redirects

14. TodoWrite - Create and manage task lists
    - States: pending, in_progress, completed
    - Priority levels: high, medium, low
    - Only one task in_progress at a time
    - Use for complex multi-step tasks

15. WebSearch - Search the web
    - Returns up-to-date information
    - Domain filtering support
    - Only available in the US
    - Accounts for current date in searches

Additional Context

 Claude Code Status v1.0.63

 Account • /login
  L Login Method: Claude Max Account

 Memory • /memory
  L user: ~/.claude-personal/CLAUDE.md
  L project: CLAUDE.md

 Model • /model
  L Default Opus 4 for up to 50% of usage limits, then use Sonnet 4 (currently Opus)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗