[BUG] Cowork uploads use hard links (fs.link), locking source files even after app is closed

Resolved 💬 3 comments Opened Apr 18, 2026 by Keaton-tv Closed Jun 3, 2026

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

  1. Open Claude Desktop (macOS), start a Cowork session
  2. Upload a file (e.g. ~/Documents/product-lens.md)
  3. Try to save changes to that file in another editor
  4. Observe the "file is locked" error
  5. Close Claude Desktop entirely
  6. 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

  1. Use fs.copyFile instead of fs.link when ingesting uploads (same fix suggested in #43197 for cross-device case)
  2. 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

  1. Open Claude Desktop on macOS, start a Cowork session
  2. Upload any file from ~/Documents/
  3. Try to save changes to that file in another editor (e.g. VS Code, TextEdit)
  4. Observe the 'file is locked' error dialog
  5. Quit Claude Desktop completely
  6. Try saving again -- still locked
  7. Run: ls -l ~/Documents/<filename> -- note hard link count is 2
  8. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗