Claude Code v2.1.183: Auto Mode Safety Guards for Destructive Git and Infrastructure Commands

Anthropic

Tools official 1 src. ~1 min

Claude Code v2.1.183 (June 19, 2026) adds guardrails to auto mode that block destructive git operations — `git reset --hard`, `git checkout -- .`, `git clean -fd`, `git stash drop` — when the user did not explicitly ask to discard local work. `git commit --amend` is blocked for commits not made by the agent this session, and infrastructure-destroy commands (`terraform destroy`, `pulumi destroy`, `cdk destroy`) are blocked unless a specific stack was named. New `attribution.sessionUrl` setting omits claude.ai session links from commits and PRs.

Why it matters

Prevents agentic sessions from silently destroying local work or cloud infrastructure, raising the safety floor for unattended runs.

Importance: 2/5

Minor version with targeted safety improvements for agentic auto mode; addresses a real risk rather than just adding features.

Sources