[BUG] MCP binary/large results are dropped ("tool-results path refused … is a link") when ~/.claude/projects/<slug> is a symlink

Status Open
Reported on v2.1.263
Maintainer reply None cached
Activity 1 comment · opened Sep 25, 2026

Environment

  • Claude Code 2.1.263 through 2.1.281 (native install and VS Code extension)
  • macOS 26 (Darwin 25.6.0, arm64)

What happens

I keep several long-lived git worktrees of one repo (~/git/repo, ~/git/repo-1, ~/git/repo-2, …). They share one conversation history: each worktree's ~/.claude/projects/<slug> is a symlink to the main worktree's project dir. (Resuming across worktrees natively only covers worktrees created with EnterWorktree, so pre-made worktrees need the symlink.)

In those worktrees, any MCP result that Claude Code saves to disk is dropped. For example, slack_read_file (claude.ai Slack connector) on an audio attachment returns:

[Audio from claude.ai Slack] Binary content (audio/mp4, 731626 bytes) could not be saved to disk: tool-results path refused: /Users/me/.claude/projects/-Users-me-git-repo-3 is a link or not a directory

The model never gets the file, and there's no alternative way to get it. Large MCP text results fail the same way; the error then suggests pagination instead. Across my transcripts I count 56 refused saves in 7 sessions, all from worktrees whose project dir is a symlink. They come from slack_read_file and one Amplitude MCP tool.

The same call from a session whose project dir is a real directory saves the file under <project>/<session>/tool-results/ as expected.

Steps to reproduce

  1. mv ~/.claude/projects/<slug-B> /tmp/ && ln -s <slug-A> ~/.claude/projects/<slug-B>, where A and B are two directories.
  2. Start Claude Code in directory B.
  3. Call any MCP tool that returns binary content (an image or audio file) or a result large enough to be persisted.
  4. The result says could not be saved to disk: tool-results path refused: … is a link or not a directory.

Expected

A project dir under ~/.claude/projects/ that is a symlink to another project dir in the same ~/.claude/projects/ is trusted. For example, resolve it with realpath and check that the target is still inside ~/.claude/projects/, then write there. If the link has to stay refused, fall back to a directory that is not a link (e.g. a temp dir) rather than dropping the content. A setting to allow it would also work.

Related

  • #96690: /resume finds no sessions when ~/.claude/projects/<slug> is a symlink and the repo has 2+ worktrees. It mentions this refusal in passing.
  • #51488: claude -r stopped following symlinks in ~/.claude/projects.
  • #67571: suspicious-path prompt for symlinked project directories.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗