⛔️ Auto-save Feature Deletes .claude/ Directory Contents
Bug Description
CRITICAL BUG: Auto-save feature systematically deletes .claude/ directory contents
SEVERITY: CRITICAL - Data loss bug affecting user work
DESCRIPTION:
Claude Code's "Auto-save before task work" feature is systematically deleting entire .claude/ directory contents, causing permanent loss of user work including custom commands, hooks, and configurations.
EVIDENCE:
- Git commit c9a6774: "WIP before TASK-SIP-182: Auto-save before task work - 2025-08-08 11:03" deleted 1,594 lines
- Files deleted: ALL .claude/commands/ (10 custom command files), ALL .claude/hooks/ files
- Pattern: Multiple "Auto-save before task work" commits show repeated deletions
- User lost significant work: custom Claude commands (plan.md, backup.md, kb.md, etc.)
REPRODUCTION:
- Create custom files in .claude/commands/ directory
- Have .claude/ in .gitignore but files accidentally committed to git
- Start new task work - auto-save triggers
- Entire .claude/ directory contents get deleted
EXPECTED: Auto-save should preserve user's .claude/ configurations and commands
ACTUAL: Auto-save deletes all user work in .claude/ directory
GIT EVIDENCE:
D .claude/commands/backup.md
D .claude/commands/commit.mdD .claude/commands/kb.md
D .claude/commands/merge.md
D .claude/commands/plan.md
[...all .claude/ files deleted]
IMPACT:
- Complete loss of custom Claude commands representing hours of work
- Repeated data loss - happens on every task
- User productivity severely impacted
- Files must be manually recovered from git history
WORKAROUND: Manually restore files from git history after each deletion
REQUEST: Fix auto-save to NOT delete .claude/ directory contents, especially user-created commands and configurations.
Copy this entire text and use /bug to report it to Anthropic. This should get their attention on this critical data loss issue!
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.67
- Feedback ID: e3d8348d-5647-4eca-82eb-461f5ed94234
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:892:11)\n at execSync (node:child_process:964:15)\n at t7 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:867:5214)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:776:48453\n at Q (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:674:14418)\n at lJ (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:776:45891)\n at yz (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:776:44758)\n at W9 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:776:51079)","timestamp":"2025-08-03T10:45:01.628Z"},{"error":"Error: Request was aborted.\n at l71._createMessage (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1327:7955)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-08-07T04:30:36.905Z"},{"error":"Error: Agent type 'production-server' not found. Available agents: general-purpose, database-guardian, aws-infrastructure-specialist, docker-ops, code-quality-enforcer, security-scanner, tracking-specialist, api-tester, git-task-recorder\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2641:1971)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async XK8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2546:10157)\n at async xf1 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2546:6576)\n at async PNB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1867:1384)\n at async JK8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2546:5720)\n at async IK8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2546:5205)\n at async ES (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2546:3667)\n at async ZA (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3018:2603)","timestamp":"2025-08-07T04:32:25.918Z"},{"error":"Error: Agent type 'production-server' not found. Available agents: general-purpose, database-guardian, aws-infrastructure-specialist, docker-ops, code-quality-enforcer, security-scanner, tracking-specialist, api-tester, git-task-recorder\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2641:1971)\n at proces
Note: Error logs were truncated.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗