Skip to content

Commit 4352799

Browse files
Robins163claude
andcommitted
docs: add hook return contract to CLAUDE.md and AGENTS.md
Document the hook return value rules that caused the PreCompact deadlock (MemPalace#863, MemPalace#856, MemPalace#858) and the undocumented "allow" value (MemPalace#872). AGENTS.md picks this up automatically via symlink. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 95a5fdb commit 4352799

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ These are non-negotiable. Every PR, every feature, every refactor must honor the
2727
- **Privacy by architecture** — The system physically cannot send your data because it never leaves your machine. No telemetry, no phone-home, no external service dependencies for core operations.
2828
- **Background everything** — Filing, indexing, timestamps, and pipeline work happen via hooks in the background. Nothing interrupts the user's conversation. Zero tokens spent on bookkeeping in the chat window.
2929

30+
## Hook Return Contract
31+
32+
Claude Code recognizes exactly one top-level `decision` value: `"block"`. Anything else is a pass-through by accident — `{"decision": "allow"}` is NOT a recognized value (see [#872](https://github.com/MemPalace/mempalace/issues/872)). To not block, return `{}`.
33+
34+
**PreCompact hooks must never block**: Claude Code cancels compaction and re-fires the hook, causing a deadlock (see [#863](https://github.com/MemPalace/mempalace/issues/863), [#856](https://github.com/MemPalace/mempalace/issues/856), [#858](https://github.com/MemPalace/mempalace/issues/858)). Mine synchronously, then return `{}`.
35+
3036
## Contributing
3137

3238
We welcome bug fixes, performance improvements, new language support, better entity disambiguation, documentation, and test coverage.

0 commit comments

Comments
 (0)