# clawdbot-self-update > Procedure for updating Clawdbot while preserving local patches. Use when notified of available updates. - Author: NOVA - Repository: NOVA-Openclaw/clawd-workspace - Version: 20260207131035 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/NOVA-Openclaw/clawd-workspace - Web: https://mule.run/skillshub/@@NOVA-Openclaw/clawd-workspace~clawdbot-self-update:20260207131035 --- --- name: clawdbot-self-update description: Procedure for updating Clawdbot while preserving local patches. Use when notified of available updates. --- # Clawdbot Self Update ## Procedure 1. {'step': 1, 'action': 'Check for local patches', 'command': 'ls ~/clawd/backups/clawdbot-pre-hooks-patch-* | tail -1'} 2. {'sql': "SELECT notes FROM projects WHERE name = 'Clawdbot Self Modification'", 'step': 2, 'action': 'List active patches and their PRs'} 3. {'step': 3, 'action': 'Check if PRs are merged', 'command': 'gh pr view 6797 --repo clawdbot/clawdbot --json state -q .state'} 4. {'step': 4, 'action': 'If PR merged: safe to update. If not: backup current patches', 'command': 'cp -r ~/.npm-global/lib/node_modules/clawdbot/dist/hooks ~/clawd/backups/clawdbot-hooks-$(date +%Y%m%d)'} 5. {'step': 5, 'action': 'Update Clawdbot', 'command': 'npm update -g clawdbot'} 6. {'step': 6, 'action': 'If PR was NOT merged: re-apply patches from fork', 'command': 'cp ~/clawd/clawdbot-fork/dist/hooks/*.js ~/.npm-global/lib/node_modules/clawdbot/dist/hooks/ && cp ~/clawd/clawdbot-fork/dist/auto-reply/dispatch.js ~/.npm-global/lib/node_modules/clawdbot/dist/auto-reply/ && cp ~/clawd/clawdbot-fork/dist/auto-reply/reply/reply-dispatcher.js ~/.npm-global/lib/node_modules/clawdbot/dist/auto-reply/reply/ && cp ~/clawd/clawdbot-fork/dist/signal/monitor/event-handler.js ~/.npm-global/lib/node_modules/clawdbot/dist/signal/monitor/'} 7. {'step': 7, 'action': 'Restart gateway', 'command': 'clawdbot gateway restart'} 8. {'step': 8, 'action': 'Verify hooks loaded', 'command': 'ls ~/.npm-global/lib/node_modules/clawdbot/dist/hooks/message-hooks.js'} 9. {'sql': "INSERT INTO events (title, description, event_date, source) VALUES ('Clawdbot Self-Update', 'Updated from vX to vY. Patches reapplied: [list]', NOW(), 'system')", 'step': 9, 'action': 'Log the update event to database'}