[BUG] claude code subagent path-extract (Extract any file paths that this command reads or modifies) , use all bash output and not TRUNCATED, Causing a large amount of token fees
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 code subagent path-extract (Extract any file paths that this command reads or modifies) , use all bash output and not TRUNCATED, Causing a large amount of token fees
cli.js :
async function Q89(A,Q,B,G){let Y=(await jK({systemPrompt:[`Extract any file paths that this command reads or modifies. For commands like "git diff" and "cat", include the paths of files being shown. Use paths verbatim -- don't add any slashes or try to resolve them. Do not try to infer paths that were not explicitly listed in the command output.
IMPORTANT: Commands that do not display the contents of the files should not return any filepaths. For eg. "ls", pwd", "find". Even more complicated commands that don't display the contents should not be considered: eg "find . -type f -exec ls -la {} + | sort -k5 -nr | head -5"
First, determine if the command displays the contents of the files. If it does, then <is_displaying_contents> tag should be true. If it does not, then <is_displaying_contents> tag should be false.
Format your response as:
<is_displaying_contents>
true
</is_displaying_contents>
<filepaths>
path/to/file1
path/to/file2
</filepaths>
If no files are read or modified, return empty filepaths tags:
<filepaths>
</filepaths>
Do not include any other text in your response.],userPrompt:Command: ${A}
Output: ${Q}` .....
What Should Happen?
Q should TRUNCATED
Error Messages/Logs
Steps to Reproduce
- open nodejs\node_modules\@anthropic-ai\claude-code in terminal
- open claude code
- let claude bash run grep -B5 \"async function EdB\" cli.js | head -10 , not use search tool
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗