[BUG] Cowork uploads use hard links (fs.link), locking source files even after app is closed
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?
When a file is uploaded to a Cowork session, Claude Desktop creates a hard link (fs.link, not a copy) from the original file into the session's internal upload directory:
~/Library/Application Support/Claude/local-agent-mode-sessions/<session-id>/.../uploads/<filename>
This causes macOS to treat the original file as locked. The user sees: "The document could not be saved. The file is locked."
Closing the app does not fix this. The hard link persists indefinitely in the session directory, so the original file remains locked until the user manually finds and deletes the link.
Reproduction steps
- Open Claude Desktop (macOS), start a Cowork session
- Upload a file (e.g. ~/Documents/product-lens.md)
- Try to save changes to that file in another editor
- Observe the "file is locked" error
- Close Claude Desktop entirely
- Try saving again -- the file is still locked
Root cause
Confirmed via terminal:
$ ls -l ~/Documents/product-lens.md
-rw-------@ 2 keaton staff 4695 18 Apr 14:02 /Users/keaton/Documents/product-lens.md
$ find ~ -inum 116051521
~/Library/Application Support/Claude/local-agent-mode-sessions/.../uploads/product-lens.md
~/Documents/product-lens.md
Hard link count of 2 confirms the session upload directory holds a second reference to the same inode.
Workaround
Manually rm the hard link from the session directory.
Suggested fix
- Use fs.copyFile instead of fs.link when ingesting uploads (same fix suggested in #43197 for cross-device case)
- Clean up session upload directories when a session ends or app closes (see also #30751)
Related issues
- #43197 -- fs.link fails across drives (same root cause)
- #30751 -- Cowork session data never cleaned up
- #35036 -- Session cleanup commands requested, closed without implementation
Environment
- macOS (Apple Silicon)
- Claude Desktop (Cowork mode)
- April 2026 build
What Should Happen?
Uploading a file to Cowork should not lock the original. Use fs.copyFile instead of fs.link so the original file remains fully independent. Session upload directories should be cleaned up when the session ends or the app closes.
Error Messages/Logs
Steps to Reproduce
- Open Claude Desktop on macOS, start a Cowork session
- Upload any file from ~/Documents/
- Try to save changes to that file in another editor (e.g. VS Code, TextEdit)
- Observe the 'file is locked' error dialog
- Quit Claude Desktop completely
- Try saving again -- still locked
- Run: ls -l ~/Documents/<filename> -- note hard link count is 2
- Run: find ~ -inum <inode> -- reveals second path under ~/Library/Application Support/Claude/local-agent-mode-sessions/
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Desktop (Cowork mode) - April 2026 build
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗