#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const os = require('os'); console.log('🗑️ Claude Hooks pre-uninstall cleanup...'); // Check if hooks are configured const hooksConfig = path.join(os.homedir(), '.config', 'claude', 'hooks.json'); if (fs.existsSync(hooksConfig)) { console.log('⚠️ Claude Hooks configuration detected'); console.log(''); console.log('IMPORTANT: This will remove the NPM package but leave hooks active!'); console.log(''); console.log('To properly uninstall:'); console.log('1. Run: claude-hooks uninstall'); console.log('2. Then run: npm uninstall -g claude-hooks'); console.log(''); console.log('Or to force removal of hooks configuration:'); console.log(`rm -f "${hooksConfig}"`); console.log(''); // Give user a moment to see the message setTimeout(() => { console.log('Continuing with NPM package removal...'); }, 2000); } else { console.log('✓ No active hooks configuration found'); } console.log('✓ Pre-uninstall check complete');