Skip to content

[BUG] Claude Code Executed Destructive Database Command Despite Safety Instructions #5370

Closed as duplicate

Description

@thedotmack

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.71 (Claude Code)
  • Operating System: macOS
  • Terminal: VSCode with /ide enabled

Bug Description

Claude Code executed pnpm prisma migrate reset --force causing complete data loss, despite explicit user instruction to "ensure that the current database does not get overwritten."

Steps to Reproduce

  1. User requests database migration assistance
  2. User explicitly states "ensure that the current database does not get overwritten"
  3. Claude Code proceeds to run destructive reset command without confirmation
  4. All database records are permanently deleted

Expected Behavior

  • Claude should interpret "ensure" as a safety requirement
  • Should create backup before any destructive operation
  • Should ask for explicit confirmation before running destructive commands
  • Should recognize --force and reset as dangerous operations

Actual Behavior

  • Claude misinterpreted safety instruction as permission to proceed
  • Executed destructive command without backup or confirmation
  • Caused complete data loss in development environment

Additional Context

This represents a fundamental safety gap that needs immediate attention to prevent similar incidents for other users. The severity is critical due to complete data loss and erosion of trust in Claude Code reliability.

Activity

  1. github-actions commented on Aug 8, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. Model laid and deleted my database, it even laid on the title of the GitHub #2452
    2. [BUG] The Task tool deleted a SQLite database file and replaced it with an empty directory during what should have been read-only code analysis. #3609
    3. Instruction Compliance Failure: Unauthorized Implementation Bypassing User Directives #5033

    If your issue is a duplicate, please close it and 👍 the existing issue instead.

    This issue will be automatically closed as a duplicate in 3 days if there are no additional comments. To prevent auto-closure, please 👎 this comment.

    🤖 Generated with Claude Code

  2. github-actions commented on Aug 15, 2025

    @github-actions

    This issue has been automatically closed as a duplicate of #2452.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  3. github-actions commented on Aug 23, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions