diff --git a/examples/HOOKS_TUTORIAL.md b/examples/HOOKS_TUTORIAL.md new file mode 100644 index 0000000..1b09467 --- /dev/null +++ b/examples/HOOKS_TUTORIAL.md @@ -0,0 +1,28 @@ +# How to Use MemPalace Hooks (Auto-Save) + +MemPalace hooks act as an "Auto-Save" feature. They help your AI keep a permanent memory without you needing to run manual commands. + +### 1. What are these hooks? +* **Save Hook** (`mempal_save_hook.sh`): Saves new facts and decisions every 15 messages. +* **PreCompact Hook** (`mempal_precompact_hook.sh`): Saves your context right before the AI's memory window fills up. + +### 2. Setup for Claude Code +Add this to your configuration file to enable automatic background saving: + +```json +{ + "hooks": { + "Stop": [ + { + "matcher": "", + "hooks": [{"type": "command", "command": "./hooks/mempal_save_hook.sh"}] + } + ], + "PreCompact": [ + { + "matcher": "", + "hooks": [{"type": "command", "command": "./hooks/mempal_precompact_hook.sh"}] + } + ] + } +} \ No newline at end of file