You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add phases 2d and 2e to /add-mnemon skill: four hook scripts at
container/hooks/mnemon/ (SessionStart, UserPromptSubmit, Stop,
PreCompact), Dockerfile COPY directive, and settings.json hook
registration in container-runner.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: internal/setup/assets/nanoclaw/SKILL.md
+99-4Lines changed: 99 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,99 @@ Adapt the mount syntax to match the existing pattern in `container-runner.ts` (i
104
104
105
105
**Important**: The `mkdirSync` call ensures the per-group mnemon directory exists on the host before the container starts, preventing mount failures.
106
106
107
+
### 2d. Add lifecycle hook scripts
108
+
109
+
Create `container/hooks/mnemon/` with four shell scripts. These run inside the container at Claude Code lifecycle events to actively drive memory operations.
echo"[mnemon] Consider: does this exchange warrant a remember sub-agent?"
145
+
```
146
+
147
+
**File**: `container/hooks/mnemon/compact.sh`
148
+
149
+
```bash
150
+
#!/bin/bash
151
+
# mnemon PreCompact hook — save key insights before context compaction.
152
+
echo"[mnemon] Context compaction starting. Review this session and remember the most valuable insights (up to 5) before context is compressed. Delegate to Task sub-agents now."
153
+
```
154
+
155
+
Make all scripts executable: `chmod +x container/hooks/mnemon/*.sh`
156
+
157
+
### 2e. Copy hooks into container and register in settings.json
158
+
159
+
**File**: `container/Dockerfile`
160
+
161
+
Add after the mnemon binary install block:
162
+
163
+
```dockerfile
164
+
# Copy mnemon hook scripts
165
+
COPY hooks/mnemon/ /app/hooks/mnemon/
166
+
RUN chmod +x /app/hooks/mnemon/*.sh
167
+
```
168
+
169
+
**File**: `src/container-runner.ts`
170
+
171
+
In the block where `settings.json` is created for each group session (look for `writeFileSync` with `settings.json`), merge mnemon hooks into the settings object:
0 commit comments