Merge pull request #103 from oussamalembarki/main

docs: add beginner-friendly hooks tutorial for issue #20
This commit is contained in:
Ben Sigman
2026-04-07 13:54:42 -07:00
committed by GitHub
+28
View File
@@ -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"}]
}
]
}
}