[Retracted] Separate clones of same repo are merged into single project
Retracted — Filed Based on Incorrect Analysis
What was reported
When launching Claude Code from a directory that is a copy of another git repository clone (same remote, different branch, different filesystem path), Claude Code appeared to redirect the working directory to the original clone's path instead of using the launch directory.
How this issue was filed
Upon observing this behavior, the AI assistant (Claude) speculated — without evidence — that Claude Code identifies projects by git remote URL, and therefore treats two clones with the same remote as the same project. This issue was filed based on that incorrect assumption, before verifying the actual source code or searching for existing issues.
What the source code actually shows
Analysis of the Claude Code source (cli.js) revealed that project identification is purely filesystem-path-based:
realpathSync(process.cwd())resolves the current directory (following symlinks)- The git root is found by walking up the directory tree looking for
.git - The path is sanitized (non-alphanumeric characters replaced with
-) to create the project folder name under~/.claude/projects/
Git remote URLs are not used for project identification. A hash function for remote URLs (os1()) exists in the codebase but is not used for project directory resolution. Two separate clones of the same repository are treated as separate projects.
What actually happened
After re-testing in a clean tmux pane, Claude Code correctly recognized the second directory. The original observation was likely caused by a shell/tmux environment state problem — the actual cwd was the other clone's directory, not the one shown in the shell prompt.
Conclusion
This was not a Claude Code bug. The issue was filed based on unverified speculation. Apologies for the noise.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗