[BUG] Bash tool cwd set to local plugin marketplace directory instead of invocation directory

Resolved 💬 1 comment Opened May 21, 2026 by sdt-achan Closed Jun 21, 2026

Bug Description

When a local directory plugin marketplace is configured in ~/.claude/settings.json via extraKnownMarketplaces, the Bash tool's shell session starts with its cwd set to that marketplace directory instead of the directory where claude was invoked.

Steps to Reproduce

  1. Configure a local plugin marketplace in ~/.claude/settings.json:

``json
{
"extraKnownMarketplaces": {
"my-marketplace": {
"source": {
"path": "C:\some-other-directory",
"source": "directory"
}
}
}
}
``

  1. Open a terminal and cd C:\dev (or any directory)
  2. Run claude from that directory
  3. In the session, run the Bash tool with pwd

Expected Behavior

pwd should return /c/dev (the directory where claude was invoked).

Actual Behavior

pwd returns /c/some-other-directory (the local plugin marketplace path). The marketplace directory also appears as an "Additional working directory" in the session environment.

Impact

  • Any git commands run early in the session operate on the wrong repository
  • File paths are resolved relative to the wrong directory
  • The system prompt says "Primary working directory: C:\dev" but the shell is actually in the marketplace directory, creating a confusing inconsistency

Environment

  • Claude Code CLI (terminal invocation)
  • Windows 11
  • Shell: Git Bash (bash)
  • The marketplace directory (C:\axiomclaudemarket) is a git repo, which may be relevant to why it gets selected as cwd

Workaround

Running cd /c/dev in the first Bash call corrects the session, but it's easy to miss that the cwd is wrong since the system prompt lists the correct primary working directory.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗