[Bug] Incorrect Environment Variable Handling in Command Execution

Resolved 💬 3 comments Opened Sep 25, 2025 by mattgodbolt Closed Sep 26, 2025

Bug Description
Claude keeps running bash commands as if it can set env vars like BOB=blah COMMAND but then gets BOB=blah: command not found

Environment Info

  • Platform: linux
  • Terminal: gnome-terminal
  • Version: 1.0.124
  • Feedback ID: 5dac5bea-855d-4571-b310-e2de90467726

Errors

[{"error":"Error: Request was aborted.\n    at Xu._createMessage (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1049:7952)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-25T20:23:55.117Z"},{"error":"MaxFileReadTokenExceededError: File content (25241 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at uP2 (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1743:1010)\n    at async gM (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:2939)\n    at async file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1829:1401","timestamp":"2025-09-25T20:28:53.928Z"},{"error":"MaxFileReadTokenExceededError: File content (43872 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at uP2 (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1743:1010)\n    at async gM (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:2939)\n    at async file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1829:1401","timestamp":"2025-09-25T20:28:54.143Z"},{"error":"MaxFileReadTokenExceededError: File content (25249 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at uP2 (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1743:1010)\n    at async gM (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:2939)\n    at async file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1829:1401","timestamp":"2025-09-25T20:36:54.136Z"},{"error":"MaxFileReadTokenExceededError: File content (43872 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at uP2 (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1743:1010)\n    at async gM (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:2939)\n    at async file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1829:1401","timestamp":"2025-09-25T20:36:54.350Z"},{"error":"MaxFileReadTokenExceededError: File content (25249 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at uP2 (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1743:1010)\n    at async gM (file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1748:2939)\n    at async file:///home/matthew/.local/share/nvm/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1829:1401","timestamp":"2025-09-25T20:37:07.152Z"},{"error":"MaxFileReadTokenExceededError: File content (43872 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or

Note: Error logs were truncated.

View original on GitHub ↗

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