Claude Code for VS Code can hide where a file really is
The permission prompt in Anthropic's Claude Code extension for Visual Studio Code shows the path the agent asked for. It does not show where that path leads. If a folder inside the project is a symbolic link pointing somewhere else on the disk, a developer can approve a read or write that looks local and lands outside the workspace. The issue was confirmed in extension version 2.1.322, the latest release when the issue became public this month. Anthropic does not treat it as a security bug, and no CVE has been assigned.
What happened
The problem shows up with a workspace that contained a folder called ./helpdocs. That folder was a symlink to a directory outside the project. When the agent asked to write a file named test.txt into it, the approval dialog showed only the in-workspace path. Nothing in the prompt said the file would end up somewhere else.
The same display problem was shown in the Claude Code command-line tool, and in several other AI coding agents, by separate research published in May 2026. Anthropic changed the CLI afterwards. The entry in the official Claude Code changelog for version 2.1.280 says writes through a symlinked path are no longer judged by their in-tree spelling and that the prompt now names where the write lands. That change did not carry over to the VS Code extension, which still shows the unresolved path. Up to version 2.1.326, the changelog has no entry that addresses this in the extension.
The issue was reported through Anthropic's HackerOne programme and was closed as informative. The company's position is that the prompt itself is the safeguard, the text shown inside it is not part of the security control, and symlinks sit outside the permission threat model. The published programme guidelines do not appear to list that exclusion.
Who is affected
Anyone using the Claude Code extension for VS Code, which has about 30 million installs on the Visual Studio Marketplace. Version 2.1.322 is confirmed affected. The terminal version of Claude Code from 2.1.280 onward resolves the link before asking.
The risk is highest for teams that share repositories. Git stores symlinks, so one bad commit can put a link into every developer's checkout on the next pull. Two scenarios stand out:
- A teammate's account is compromised and used to push a commit with a symlink that points at a sensitive location, such as the home directory.
- Depending on the permission mode, the extension can rename files without asking, so a link the user already knows about could be given an innocent name.
In both cases, an agent steered by planted instructions could then ask for access that looks harmless. A link to the home folder, for example, would put SSH keys in ~/.ssh/ within reach. There are no reports of this being used in real attacks.
How it works
A symlink is a file that points to another file or folder. Tools that check paths by their text see ./helpdocs/test.txt and decide it is inside the project. The operating system follows the link and writes to the real target. A prompt that shows only the first version gives the user nothing to catch.
What to do now
- Before you approve a file operation in the extension, copy the path from the prompt and run
realpath <path>in a terminal. If the result is outside your workspace, deny the request. - Check your repositories for symlinks after every pull.
git ls-files -s | awk '$1=="120000"'lists every tracked symlink.find . -type l -exec ls -l {} +shows where each one points. - Add deny rules for sensitive locations such as
Read(~/.ssh/**). Anthropic's permissions documentation says a deny rule applies when either the requested path or the file it resolves to matches. - Consider running the terminal version of Claude Code, at 2.1.280 or later, for work in repositories you do not fully control. Keep an eye on the changelog for an extension update.
- Treat new symlinks in pull requests as something that needs a review, and add a CI check for them.
Bad symlinks usually arrive in a commit long before an agent follows them. Our AI-assisted code review flags tracked symlinks that point out of a repository or towards credentials and configuration files, so they can be dealt with at merge time.
