[BUG] Claude Code cannot find Git branch refs in packed-refs
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)
- [x] I am using the latest version of Claude Code
What's Wrong?
In several of my Git repo folders, Claude Code hangs during startup prior to the "trusted folder" question. It did not do so before today, so this is likely new in Claude Code 2.1.69.
I am running Claude Code in a Command Prompt terminal in Windows Terminal under Windows 11 Enterprise version 23H2.
Using Process Monitor, I noted that it was repeatedly performing this operation:CreateFile C:\{repo path}\.git\refs\heads\develop NAME NOT FOUND
The branch exists, and I confirmed that it is stored as a packed ref using the git command:git -C C:\{repo path} pack-refs --unpack
I created a loose ref file using the commit hash, and that allowed me to reach the trusted folder prompt.
What Should Happen?
Claude Code should be able to handle Git repos where the branch refs are stored in packed-refs. In addition, if it cannot reach the Git branch ref, it should give up, report the error to the user, and proceed with startup.
Error Messages/Logs
Output from Process Monitor (repeated in a loop)
4:40:48.3731889 PM claude.exe 28096 CreateFile C:\{repo path}\.git\HEAD SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
4:40:48.3732196 PM claude.exe 28096 QueryAllInformationFile C:\{repo path}\.git\HEAD BUFFER OVERFLOW CreationTime: 3/5/2026 2:32:34 PM, LastAccessTime: 3/5/2026 4:40:34 PM, LastWriteTime: 3/5/2026 2:32:34 PM, ChangeTime: 3/5/2026 2:32:34 PM, FileAttributes: A, AllocationSize: 24, EndOfFile: 24
4:40:48.3732271 PM claude.exe 28096 QueryInformationVolume C:\{repo path}\.git\HEAD SUCCESS VolumeCreationTime: 4/22/2024 2:29:23 PM, VolumeSerialNumber: 30C3-7410, SupportsObjects: True, VolumeLabel: Win
4:40:48.3732334 PM claude.exe 28096 CloseFile C:\{repo path}\.git\HEAD SUCCESS
4:40:48.3732846 PM claude.exe 28096 CreateFile C:\{repo path}\.git\config SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
4:40:48.3733050 PM claude.exe 28096 QueryAllInformationFile C:\{repo path}\.git\config BUFFER OVERFLOW CreationTime: 2/26/2026 4:12:25 PM, LastAccessTime: 3/5/2026 4:40:34 PM, LastWriteTime: 2/26/2026 4:12:25 PM, ChangeTime: 2/26/2026 4:12:25 PM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 619
4:40:48.3733107 PM claude.exe 28096 QueryInformationVolume C:\{repo path}\.git\config SUCCESS VolumeCreationTime: 4/22/2024 2:29:23 PM, VolumeSerialNumber: 30C3-7410, SupportsObjects: True, VolumeLabel: Win
4:40:48.3733155 PM claude.exe 28096 CloseFile C:\{repo path}\.git\config SUCCESS
4:40:48.3733585 PM claude.exe 28096 CreateFile C:\{repo path}\.git\refs\heads\develop NAME NOT FOUND Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
Steps to Reproduce
- Prepare a folder with a Git repository.
- See that the branch ref is stored in
packed-refsrather than a loose file. (I don't know how to do this.) - Run Claude Code 2.1.69 in the folder.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.68, probably
Claude Code Version
2.1.69
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗