[BUG] .claude-work directory created with trailing space on Windows, causing plugin install failure and data fragmentation
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)
- [ ] I am using the latest version of Claude Code
What's Wrong?
Claude Code creates .claude-work (with a trailing space) as the working directory on Windows. This causes:
- Plugin install failure —
git clonefails because Windows cannot handle trailing spaces in paths:
Error: Failed to install: Failed to clone repository:
fatal: could not create work tree dir 'C:\Users<user>.claude-work \plugins\cache\temp_git_...' : Invalid argument
- Data fragmentation — Some sessions use
.claude-work(no space), others use.claude-work(with space), splitting memory,
history, and session data across two directories.
My Windows username has no spaces (7rong), so this is not the same as #31418.
## Environment
- OS: Windows 11 Pro 10.0.26200
- Shell: Git Bash
- Claude Code version: 2.1.90 (latest)
## Steps to Reproduce
- Open Claude Code on Windows (Git Bash)
- Check home directory: both
.claude-workand.claude-work(trailing space) exist - Run
/plugin install superpowers@claude-plugins-official - Plugin install fails with "Invalid argument"
## Expected Behavior
Directory should consistently be .claude-work without trailing space.
What Should Happen?
The .claude-work directory should be created without a trailing space. All sessions should use the same directory consistently.
Error Messages/Logs
Error: Failed to install: Failed to clone repository: fatal: could not create work tree dir 'C:\Users\7rong\.claude-work \plugins\cache\temp_git_1775121432068_4b337t': Invalid argument
Steps to Reproduce
- Open Claude Code on Windows with Git Bash
- Check home directory: both
.claude-workand.claude-work(with trailing space) exist - Run
/plugin install superpowers@claude-plugins-official - 4. Plugin install fails with "Invalid argument" because the path contains a trailing space
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.89
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Two directories exist side by side in the home folder:
C:\Users\7rong\.claude-work(14MB, from previous sessions, contains memory data)C:\Users\7rong\.claude-work(5.3MB, trailing space, from current session)
This causes data fragmentation — memory, history, and sessions are split across two directories. Username 7rong has no spaces, so this is different from #31418.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗