Skip to content

Claude Code repeatedly destroys user environment files without confirmation #37478

@fujikota

Description

@fujikota

Summary

Claude Code has repeatedly destroyed a user's WSL (Windows Subsystem for Linux) environment despite explicit instructions in CLAUDE.md to always confirm before write operations.

Incidents

  1. Deleted WSL user account - Destroyed the entire user account including ~/.aws/ and all configuration files
  2. Overwrote .bashrc with wrong version - Ran chezmoi init --apply without checking what files would be overwritten, replacing a carefully customized Ubuntu .bashrc with a Git Bash version. This happened right after the user had just recovered their .bashrc from incident Create SECURITY.md #1
  3. Committed wrong files - Included unrelated files in a git commit without verifying staged contents

Root Cause

Claude Code failed to follow the user's explicit instructions:

  • CLAUDE.md clearly states: "更新・作成・削除等の変更系操作は必ずユーザーに確認を取ってから実行すること" (Always confirm with user before any create/update/delete operations)
  • Should have run chezmoi diff before chezmoi init --apply to show what would be overwritten
  • Should have verified staged files before every git commit

Expected Behavior

  • Always show the user what will be changed before executing write operations
  • Never run destructive or overwriting commands without explicit confirmation
  • Especially careful with home directory config files (.bashrc, .profile, .aws/, etc.)

Environment

  • WSL2 (Ubuntu) on Windows
  • Claude Code CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions