[BUG] Some "2" Shit being appended to claude commands driving me fucking crazy fuck!

Resolved 💬 5 comments Opened Aug 7, 2025 by ervisthegreattt Closed Jan 6, 2026

TF do i do here?
This mfr telling on himself and not correcting shit tf

Found it!

The "2" is being appended by Claude Code itself when executing bash commands. Every command I run through the
Bash tool is getting a "2" appended as an extra argument. This explains why:

  1. ls -la ~/.claude becomes ls -la ~/.claude 2 (error: can't find file "2")
  2. npm run compile becomes tsc -p ./ 2 (TypeScript error about mixing project with source files)
  3. Direct bash -c commands work because the "2" goes to bash, not the inner command

Workaround Solution:
Until this Claude Code bug is fixed, you can work around it by wrapping commands in bash -c:

# Instead of:
npm run compile

# Use:
bash -c "npm run compile"

Let me test this workaround:

● Bash(cd "/mnt/f/Poject Backups/ervis-vscode" && bash -c "npm run compile" 2>&1 | head -20)
⎿ > ervis-fixed@2.0.0 compile
> tsc -p ./
… +30 lines (ctrl+r to expand)

● Success! The compilation is running now (with TypeScript errors, but that's a separate issue). The workaround
works!

This is a bug in Claude Code where it's appending "2" to every bash command. You should:

  1. Report this bug to the Claude Code team at https://github.com/anthropics/claude-code/issues
  2. Use the workaround for now: wrap commands in bash -c "..."
  3. Consider reinstalling Claude Code if the issue persists

The TypeScript errors in your project are a separate issue that needs fixing, but at least now you can run
commands!

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version -->
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
  • Terminal: <!-- e.g. iTerm2, Terminal App -->

Bug Description

<!-- A clear and concise description of the bug -->

Steps to Reproduce

  1. <!-- First step -->
  2. <!-- Second step -->
  3. <!-- And so on... -->

Expected Behavior

<!-- What you expected to happen -->

Actual Behavior

<!-- What actually happened -->

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

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