Bash tool starts in home directory instead of project root on Windows

Resolved 💬 3 comments Opened Feb 20, 2026 by IanVand Closed Feb 24, 2026

Description

On Windows 11 with MSYS2/bash shell, the Bash tool starts in the user's home directory (~) instead of the project root (the directory Claude Code was launched from). Every command requires absolute paths or an explicit cd to reach the project.

Expected behavior

The Bash tool's initial working directory should match the project root (cwd) that Claude Code was invoked from, consistent with behavior on other platforms.

Reproduction steps

  1. Open Claude Code in a project directory (e.g., C:\Users\user\Projects\my-project)
  2. Use the Bash tool to run a command like git status
  3. Observe that the command runs in ~ (home directory), not the project root

Workaround

Prefix commands with cd /path/to/project && or use absolute paths. For git repos, resolving dynamically works:

cd "C:/Users/user/Desktop/Projects/my-project" && git status

Environment

  • OS: Windows 11 Enterprise 10.0.26100
  • Shell: bash (MSYS2)
  • Claude Code: latest

Related

  • #26760 (MSYS2 stdout bug, now resolved) — possibly related Windows shell plumbing

View original on GitHub ↗

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