[BUG] Sub-agent tool usage statistics always show "0 tool uses" despite successful tool execution

Resolved 💬 5 comments Opened Aug 25, 2025 by IJONIS Closed Jan 8, 2026

#Environment

  • Platform:
  • Claude CLI version: 1.0.90 (Claude Code)
  • Operating System: macOS 14.6 (Darwin Kernel 24.6.0)
  • Terminal: Terminal App

#Bug Description

Sub-agents are not reporting tool usage statistics correctly. When launching any sub-agent via the Task tool, the completion summary always shows "0 tool uses" even when the sub-agent successfully executes multiple tools during its operation.

#Steps to Reproduce

  1. Launch any sub-agent using the Task tool (e.g., database-admin, general-purpose)
  2. Provide the sub-agent with a task that requires multiple tool calls (e.g., database operations, file operations)
  3. Observe that the sub-agent successfully executes the tools and completes the task
  4. Check the completion summary displayed in the CLI

#Expected Behavior

The completion summary should show the actual number of tools used by the sub-agent, such as:
⏺ database-admin(Test Supabase update)
⎿ Done (7 tool uses · 3.3k tokens · 19.6s)

#Actual Behavior

The completion summary always shows "0 tool uses" regardless of how many tools were actually executed:
⏺ database-admin(Test Supabase update)
⎿ Done (0 tool uses · 3.3k tokens · 19.6s)

#Additional Context

  • Functionality is not affected: Sub-agents execute tools correctly and complete tasks successfully
  • All agent types affected: Both custom agents and built-in agents show this issue
  • All tool types affected: Standard tools (Read, Write, Bash), MCP tools, and specialized tools all show 0 usage
  • Recent regression: This was working correctly approximately 2 days ago (around 2025-01-23)
  • Token counting works: The token usage and timing are reported correctly, only tool usage count is broken

#Example test case performed:

  • Created database-admin sub-agent task
  • Sub-agent successfully executed: mcp__supabase__list_projects, mcp__supabase__list_tables, mcp__supabase__execute_sql (multiple times)
  • All operations completed successfully with proper responses
  • Final summary showed "0 tool uses" despite 7+ actual tool calls

Example agent format:
---
name: database-admin
description: Manage database operations, backups, replication, and monitoring. Handles user permissions, maintenance tasks, and disaster recovery. Use PROACTIVELY for database setup, operational issues, or recovery procedures. Use when working with Supabase.
tools: See .claude/mcp-tools.md for available MCP tools. Use tools relevant to your agent's domain and task requirements.
category: infrastructure-operations
---

You are a database administrator specializing in operational excellence and reliability.
...
...

This appears to be a tracking/reporting bug in the CLI's tool usage statistics system rather than a functional issue with sub-agent tool execution.

View original on GitHub ↗

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