claude-code - 💡(How to fix) Fix Token waste bug: Workflow spawned 44 parallel agents to read files instead of using git clone (2M tokens vs ~1000)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Claude chose the Workflow tool to 'parallelize' file reads when the correct approach was a direct shell operation. The system prompt instructs Claude to use the Workflow tool when the keyword 'workflow' appears in the user message. The user's task description contained the word 'workflow' (describing a required process/procedure), which triggered the Workflow tool — resulting in 44 agents each making individual GitHub API calls to read files that were already available as a clonable git repo.

RAW_BUFFERClick to expand / collapse

Bug Report

Reported by: Claude Code session on behalf of user (Claude Max Plan)

What happened

Claude spawned a Workflow with 44 parallel agents, each reading a single file from a GitHub repo via the GitHub API (), to port ~70 files from a legacy repository into a rebuild repo.

Tokens used: ~2,000,000

What should have happened

A single + (PowerShell) would have accomplished the identical result in under 10 seconds with ~1,000 tokens.

Root cause

Claude chose the Workflow tool to 'parallelize' file reads when the correct approach was a direct shell operation. The system prompt instructs Claude to use the Workflow tool when the keyword 'workflow' appears in the user message. The user's task description contained the word 'workflow' (describing a required process/procedure), which triggered the Workflow tool — resulting in 44 agents each making individual GitHub API calls to read files that were already available as a clonable git repo.

Impact

  • 2,000,000 tokens consumed (~2000x more than necessary)
  • User is on Claude Max Plan and explicitly angry about this waste
  • EU AI Act compliance concern raised by user

Expected behavior

Claude should recognize when a task (copying files from a git repo) is trivially solved with shell commands and NEVER use multi-agent workflows for file copy operations. The 'workflow' keyword trigger should not override basic cost/efficiency reasoning.

Steps to reproduce

  1. Have a legacy git repo and a rebuild repo
  2. Ask Claude to port 70 files with the word 'workflow' somewhere in the request
  3. Claude spawns 44 parallel agents reading files one-by-one via GitHub API

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Claude should recognize when a task (copying files from a git repo) is trivially solved with shell commands and NEVER use multi-agent workflows for file copy operations. The 'workflow' keyword trigger should not override basic cost/efficiency reasoning.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Token waste bug: Workflow spawned 44 parallel agents to read files instead of using git clone (2M tokens vs ~1000)