Claude Code 2.1.327: four data-loss fixes to take, and auto mode drops more allow rules
Claude Code 2.1.327 fixes four ways the CLI could delete or overwrite files, and auto mode now drops more package-manager allow rules.
Claude Code 2.1.327 was published to npm on 17 November 2026 at 20:33 UTC, and the dated changelog feed timestamps the same entry at 23:17 UTC that evening. Take it, and take it for the fixes: 100 of its 173 bullets begin with the word Fixed, and four of those close ways the tool could delete or overwrite a file nobody asked it to touch, including one that removed a running session's .env. Before you upgrade an unattended setup, read the allow rule changes below, because auto mode now ignores more of the package-manager rules it used to honour.
#What is in 2.1.327?
It is a maintenance release, and an unusually lopsided one. The entry carries 173 bullets against 367 for 2.1.326, 139 for 2.1.325 and 294 for 2.1.323.
| Opening word | Bullets |
|---|---|
| Fixed | 100 |
| Changed | 36 |
| Improved | 26 |
| Added | 9 |
| Removed | 1 |
| "Bug fixes and reliability improvements" | 1 |
Nine new features against 100 fixes is the shape of a release that is catching up rather than shipping, which is worth knowing before you budget time for it. Nothing here changes a session's default permission mode, which is what made its predecessor worth reading twice.
No bullet in the entry names a security issue, a CVE or an advisory. That is a narrower statement than it sounds: the only bullet containing the word "security" describes a false crash report "where a Linux security policy blocks a process from signalling itself", which is a reliability fix. Several other entries tighten path checks, symbolic link handling and permission rules without saying whether they close anything that was reported, so the absence of a labelled security fix is not evidence that none of this matters for security.
#Which four fixes stop Claude Code removing your files?
These are the reason to upgrade. All four are cases where the tool deleted or overwrote something on its own, and each is quoted from the changelog entry.
| Fix | What the changelog says | Who was affected |
|---|---|---|
| Remote Control in worktree mode | "Remote Control: Fixed stopping the server in worktree mode deleting a running session's git-ignored files, such as .env" | Anyone stopping a Remote Control server while a worktree session was running |
.mcp.json top-level keys | "Fixed claude mcp add and claude mcp remove with project scope deleting other top-level keys from .mcp.json, such as $schema or another tool's servers" | Projects whose .mcp.json holds keys besides mcpServers |
/export over an existing file | "Fixed /export overwriting an existing file without asking: the dialog now asks, and /export <name> keeps the file and says to run /export" | Anyone exporting a transcript to a path that already existed |
Self-hosted runners and GIT_CONFIG_GLOBAL | "Fixed self-hosted runners with --use-anthropic-git-proxy deleting a non-empty directory named by GIT_CONFIG_GLOBAL at startup: the runner now keeps it, ignores the variable and warns" | Self-hosted runners where GIT_CONFIG_GLOBAL names a directory |
The first row is the one to act on fastest, because a git-ignored file is exactly the file with no copy in version control. If a worktree session held credentials in .env, stopping the server removed them and git had nothing to restore.
A fifth change belongs beside these, and it is a Changed rather than a Fixed: ExitWorktree now asks before removing a worktree that may hold unsaved work. Read the condition attached to it, because it is not a blanket protection. The entry says the removal is "refused in don't-ask mode or with nobody to answer, unless an allow rule, auto or bypass permissions mode allows it". An unattended session in auto or bypass permissions mode is covered by that last clause, so it can still remove the worktree without asking anyone.
Want step-by-step guides for this and more?
ClawDocx Pro includes 500+ curated prompts, setup guides, SKILL.md files, and templates — everything to make your AI agent unstoppable.
See plans & pricing#Which changes can break a working setup?
These eight entries are a selection rather than the whole: seven of the 36 Changed bullets, and one Fixed whose fix also changes behaviour. The first two are the ones most likely to stop an unattended run that worked yesterday.
| Change | What the changelog says | Who should act |
|---|---|---|
| Package-runner allow rules | "Changed auto mode to ignore more allow rules that run any package, like Bash(pnpm dlx *), and path or version forms of ones it already ignored (/usr/bin/npm run:*); the safety check decides those" | Anyone whose auto mode allow rules name a package runner |
| Reads outside the working directory | "Changed permissions.blockReadsOutsideWorkingDirectories to ask about more Bash commands in bypass and auto modes, and to deny some in auto mode" | Anyone who sets that option and runs unattended |
| Deny-rule paths in Bash | "Changed permissions.blockReadsOutsideWorkingDirectories to refuse more Bash commands that name a path under a Read or Edit deny rule, where it used to ask" | Setups that relied on being asked rather than refused |
| Symbolic links | "Changed path checks to refuse some symbolic links" | Projects that reach files through symlinks |
| What counts as inside a working directory | "Changed what counts as inside a working directory, so some paths now ask for permission" | Anyone with paths near the edge of their working directories |
| PowerShell | "Changed the PowerShell tool to ask before one more command, even under a rule naming it; if nothing answers, it's refused unless a whole-tool rule, auto mode or bypass permissions mode allows it" | Windows setups driving PowerShell unattended |
| Long variable expansions | "Changed Bash commands whose variables expand to very long text to be denied, with a message that says to use shorter values or a file" | Scripts that pass large values through environment variables |
Nested claude and OAuth scopes | "commands that don't get the session's token no longer get its CLAUDE_CODE_OAUTH_SCOPES; set it on any that need it" | Anyone running a nested claude with its own token under forceLoginOrgUUID |
WebFetch also gained a hard limit in this release: it "refuses a URL over 2,000 characters before any permission prompt". That is a stall fix rather than a policy change, but a pipeline that builds long query strings into a fetch URL will now be refused outright instead of hanging.
Why would a pnpm dlx allow rule stop working?
Because the category it falls into was already being dropped, and this release widens what the tool recognises as belonging to it. The documented behaviour is that auto mode discards broad permissions on entry. The permission modes documentation lists what goes:
On entering auto mode, broad allow rules that grant arbitrary code execution are dropped, including:
- Blanket
Bash(*)orPowerShell(*)- Wildcarded interpreters like
Bash(python*)- A wrapper followed only by a wildcard, like
Bash(timeout *)- Shell rules that start with a wildcard, like
Bash(* --version)- Some wildcarded paths, like
Bash($HOME/bin/*)orPowerShell(C:\tools\x.exe *)- Package-manager run commands
Agentallow rulesMonitorallow rules, because Claude Code runs Monitor commands through the shell
The same page adds that "narrow rules like Bash(npm test) stay in effect" and that "Claude Code restores the dropped rules when you leave auto mode". So the rule is not deleted from your settings; it stops applying while auto mode is on.
What 2.1.327 changes is the matching, in two directions. It catches more runners, naming Bash(pnpm dlx *) as an example, and it catches rules written in a path or version form that previously slipped through, such as /usr/bin/npm run:*. If you had worked around the earlier behaviour by spelling a rule with an absolute path, that workaround is now closed.
The fix is to narrow the rule to the command you actually want, in the shape the documentation says survives, rather than to broaden it again. A rule naming an exact command keeps its allow; a rule that can run any package goes to the safety check, which decides each call on its own. For the wider set of mode changes this follows on from, see the notes on 2.1.326 and the hardening checklist in our security guide.
#Is the billed classifier fallback going away?
It is, but not in this release, and the wording matters. What 2.1.327 changed is the warning, not the behaviour: "Changed auto mode's notice about falling back to billed classifier requests to say that an upcoming release removes the fallback; each action it would have checked will be asked about or denied."
So today the fallback still works. The permission modes documentation still describes it, saying that when the server "doesn't review this session", Claude Code "falls back to its own classifier requests", and showing a notice about classifier request charges on accounts where those requests are billed. That page does not mention the fallback being removed, which is the expected state of affairs for a change the release notes describe as upcoming rather than shipped.
The consequence is worth planning for now rather than on the day. An unattended auto-mode session on a billed account currently leans on that fallback when the server does not review it. After the release that removes it, each action the classifier would have checked is "asked about or denied", and a session with nobody to answer gets the second of those. That turns a cost into a stall, which is a different failure to budget for.
#Does your shell profile run before you approve a command?
Now it can, including on a command you refuse. The entry is explicit about the trade:
Improved the speed of a session's first Bash command: shell start-up files may now run before it's approved, even if it's refused; set
CLAUDE_CODE_DISABLE_SHELL_HEAD_START=1to turn this off
For most people this is a faster first command and nothing else. It is worth a second look if your .bashrc, .zshrc or profile does anything beyond setting variables: starting an agent, unlocking a keychain, fetching credentials, writing a log line or calling out to the network. Those side effects now happen when the session starts its shell, which is before you have said yes, and they still happen if you say no.
CLAUDE_CODE_DISABLE_SHELL_HEAD_START=1Set that in the environment the session starts in to keep the old ordering.
#How do you keep an MCP server token out of your shell history?
With the stdin form this release adds. The entry reads: "Added claude mcp add-json <name> - to read the server's JSON from stdin, so tokens can stay off the command line; not available inside a Claude Code session."
claude mcp add-json <name> -Two caveats come with it, and both are documented. The first is in the entry itself: the stdin form does not work inside a Claude Code session, so it is a command for your own terminal. The second is a version floor, which the MCP documentation page states alongside the form: "To pipe the JSON in, pass - in its place: cat server.json | claude mcp add-json <name> -. Run the command outside a Claude Code session. Requires Claude Code v2.1.327 or later."
cat server.json | claude mcp add-json <name> -That is the docs' own piping example, so the release notes and the documentation agree on the form and on the restriction. What the same page still shows beside it is the reason to prefer stdin: its quoted-argument examples put a bearer token straight on the command line.
claude mcp add-json weather-api '{"type":"http","url":"https://api.weather.com/mcp","headers":{"Authorization":"Bearer token"}}'Anything typed that way reaches your shell history and the process list. Piping the same JSON from a file keeps it out of both.
#What else is worth a look?
Four smaller additions earn their keep after an upgrade:
/statusnow lists "broken agent, skill, command and output style files, keybinding errors, an unavailable sandbox, ignored permission settings and hook matchers that never match". That makes it the first command to run after upgrading, because several of this release's permission changes show up there as an ignored setting rather than as an error./confignow adds "a note in/configwhen other settings override a row", which answers the question of why a setting you changed did not take./install-github-appnow asks for confirmation before it changes a repository./tui classicis the new name for the non-fullscreen renderer, and/tui defaultstill works.
For organisations on a Claude apps gateway, the release also added support for "naming a session's billing group with the attributionProject setting, for Claude apps gateways that set admin.billing_group_tag".
#How do you get it?
Check the dist-tag before you check the version number. A plain npm install follows latest, and latest has already moved past this release: as of 21 November 2026 both latest and next point at 2.1.330. The tag to watch is stable, which points at 2.1.323, published on 12 November 2026, with seven versions published since. An install pinned to stable therefore picks up none of the four data-loss fixes above, and none of the permission changes either, because 2.1.327 came later.
That gap has stayed open across every later release we have written up, so if your deployment pins to stable deliberately, it is worth confirming that is still the decision you meant to make. The platform notes at Claude Code track the current release line.
Frequently asked questions
- Should I upgrade to Claude Code 2.1.327?
- Yes, and the reason is the fixes rather than the features. Of the 173 bullets in the entry, 100 begin with Fixed, and four of those close ways the tool could delete or overwrite a file nobody asked it to touch, including one that removed a running session's git-ignored files. If you run Claude Code unattended in auto mode, check your allow rules before you upgrade, because the release widens the set of package-manager rules auto mode ignores.
- Why did my pnpm dlx allow rule stop working in auto mode?
- Because auto mode now ignores more rules that can run any package. The changelog entry reads: Changed auto mode to ignore more allow rules that run any package, like Bash(pnpm dlx *), and path or version forms of ones it already ignored (/usr/bin/npm run:*); the safety check decides those. The documented behaviour it extends is that auto mode drops broad allow rules granting arbitrary code execution on entry, while narrow rules such as Bash(npm test) stay in effect.
- Did Claude Code 2.1.327 fix a security issue?
- No bullet in the entry names a security issue, a CVE or an advisory, unlike 2.1.325, whose entry named a security issue in how zstd-compressed responses are decoded. The only bullet in 2.1.327 containing the word security describes a false crash report where a Linux security policy blocks a process from signalling itself. That is not the same as nothing security-relevant being in the release, because several entries tighten path checks, symbolic link handling and permission rules without saying whether they close a reported problem.
- Does stopping Remote Control still delete my .env file?
- Not after this release. The changelog records it as fixed: Remote Control: Fixed stopping the server in worktree mode deleting a running session's git-ignored files, such as .env. The fix only applies once you upgrade, so a setup still on an earlier version that stops the Remote Control server in worktree mode can still lose those files.
- Can I keep an MCP server token out of my shell history now?
- Yes, with a new stdin form. The release added claude mcp add-json <name> - to read the server's JSON from standard input, so tokens can stay off the command line, and the entry notes it is not available inside a Claude Code session. The MCP documentation page documents the same form, as cat server.json | claude mcp add-json <name> -, and records that it requires Claude Code v2.1.327 or later.
- Why does npm install an older version than 2.1.327?
- Check which dist-tag you are installing. The stable tag points at 2.1.323, published on 12 November 2026, and as of 21 November 2026 seven versions have been published since then, so an install pinned to stable picks up none of the fixes or permission changes described here. The latest and next tags have both moved on to 2.1.330, so neither of them installs 2.1.327 either.