Synopsis
Description
Theuninstall
command removes claude-mem integration:
- Hook Removal - Removes all three hook types from settings
- Settings Backup - Creates backup before modification
- Data Preservation - Keeps all memories and archives intact
- Multiple Locations - Handles both global and project settings
Uninstalling removes integration but preserves compressed transcripts and memory data. Reinstall anytime without losing data.
Options
Option | Description | Default |
---|---|---|
--all | Remove from both global and project settings | false |
--project | Remove only from project settings | false |
Examples
Basic Uninstall
Remove from global settings:Project-Only Uninstall
Remove only from current project:./.claude/settings.json
while leaving global settings intact.
Complete Uninstall
Remove from all locations:What Gets Removed
Hook Types
Removes all three hook types:PreCompact Hooks
Triggered before/compact
command:
SessionStart Hooks
Triggered at session startup:SessionEnd Hooks
Triggered at session end:Settings Locations
Target different settings files:Target | File Location | Command |
---|---|---|
Global | ~/.claude/claude_code_settings.json | uninstall |
Project | ./.claude/settings.json | uninstall --project |
Both | Both files | uninstall --all |
Safety Features
Automatic Backups
Creates timestamped backup before modifying settings:- Original filename +
.backup.
+ Unix timestamp - Contains exact copy of original settings
- Can be manually restored if needed
Data Preservation
Uninstalling preserves all your data:Hook Detection
Detects claude-mem hooks by:- Exact path matches - Direct hook script paths
- Filename patterns - Scripts containing
pre-compact.js
,session-start.js
,session-end.js
- Command patterns - Commands containing
claude-mem
Selective Removal
Filtering Other Hooks
If your settings contain multiple hooks:Clean-up Behavior
Performs thorough cleanup:- Remove claude-mem hooks from hook arrays
- Remove empty arrays if no hooks remain
- Remove empty hook types if all arrays are empty
- Remove hooks section if no hook types remain
Status Messages
Success Cases
Hooks Found and Removed
No Hooks Found
Settings File Missing
Error Cases
Permission Issues
Corrupted Settings
Post-Uninstall
Immediate Effects
After uninstalling:- New sessions won’t load claude-mem context automatically
/compact
command won’t trigger memory compression- Session end won’t save context automatically
- Claude Code functions normally without claude-mem features
Data Access
Data remains accessible:Reinstallation
Reinstall at any time:Troubleshooting
Permission Denied
If uninstall fails due to permissions:Backup Restoration
To restore a backup manually:Incomplete Uninstall
If some hooks remain:Settings Corruption
If settings become corrupted:Verification
Confirm Uninstall
Verify removal after uninstalling:Test Claude Code
- Restart Claude Code completely
- Start new session - No automatic context loading
- Try
/compact
- Should work but no memory compression - Check session end - No automatic context saving
Related Commands
See Also
install
- Initial setup and reinstallationstatus
- Verify uninstall completion- Installation Guide - Complete setup process