Bug Report: History capture hooks deleted but not migrated in v2.1.1
Summary
The v2.1.1 release retired pai-history-system and claims that "Core installation now provides complete memory/history functionality out of the box." However, the history capture hooks were deleted from pai-history-system but never added to pai-core-install, leaving the MEMORY system without automatic event capture.
Version
- PAI Version: v2.1.1
- Affected commit:
45bb441(2026-01-09)
Expected Behavior
According to the v2.1.1 changelog:
History System Retired
- Removed standalone pai-history-system pack
- History/context-tracking functionality is now part of pai-core-install as the MEMORY System
- Core installation now provides complete memory/history functionality out of the box
Users installing pai-core-install should have working history capture without needing pai-history-system.
Actual Behavior
-
The
pai-core-installREADME still listspai-history-systemas an optional dependency (line 12-13):dependencies: - pai-hook-system (required) - pai-history-system (optional) - History capture for skill usage and learnings -
The
pai-core-installREADME states "Hooks registered: 0" (line 224) -
The
settings.json.templateinpai-core-installreferences hooks that no longer exist:"command": "bun run $PAI_DIR/hooks/capture-all-events.ts --event-type SessionStart" "command": "bun run $PAI_DIR/hooks/capture-session-summary.ts" "command": "bun run $PAI_DIR/hooks/stop-hook.ts" "command": "bun run $PAI_DIR/hooks/subagent-stop-hook.ts" -
These hooks were deleted in commit
45bb441:Packs/pai-history-system/src/capture-all-events.ts | 130 ------ Packs/pai-history-system/src/capture-session-summary.ts | 159 -------- Packs/pai-history-system/src/stop-hook.ts | 190 --------- Packs/pai-history-system/src/subagent-stop-hook.ts | 233 ----------- -
No corresponding files were added to
pai-core-installorpai-hook-system
Impact
- Users following the documentation will have a non-functional MEMORY system
- The
settings.json.templatewill reference non-existent hooks, causing errors - The MEMORY directories exist but never get populated with data
Suggested Fix
Either:
Option A: Add hooks to pai-core-install
- Move the 4 deleted hooks to
Packs/pai-core-install/src/hooks/ - Move
lib/metadata-extraction.tstoPacks/pai-core-install/src/hooks/lib/ - Update INSTALL.md to copy hooks during installation
- Update paths from
history/toMEMORY/in the hooks
Option B: Add hooks to pai-hook-system
- Move the 4 deleted hooks to
Packs/pai-hook-system/src/ - Move
lib/metadata-extraction.tstoPacks/pai-hook-system/src/lib/ - The
settings.json.templatein pai-core-install already expects them in$PAI_DIR/hooks/
Files That Need the Hooks
The hooks can be recovered from git history:
git show 45bb441^:Packs/pai-history-system/src/capture-all-events.ts
git show 45bb441^:Packs/pai-history-system/src/capture-session-summary.ts
git show 45bb441^:Packs/pai-history-system/src/stop-hook.ts
git show 45bb441^:Packs/pai-history-system/src/subagent-stop-hook.ts
The metadata-extraction.ts library still exists in pai-observability-server:
Packs/pai-observability-server/src/hooks/lib/metadata-extraction.ts
Additional Notes
- The hooks need path updates:
history/→MEMORY/to match the v2.1.1 structure - The default PAI_DIR should be
~/.claudenot~/.config/paito match Claude Code's default
Workaround
Users can manually recover the hooks from git history and install them:
cd ~/PAI
git show 45bb441^:Packs/pai-history-system/src/capture-all-events.ts > ~/.claude/hooks/capture-all-events.ts
# ... etc, then update paths from 'history' to 'MEMORY'
Found while installing PAI v2.1.1 on a fresh system.
Fix Available in PR #411
I've submitted a PR that restores all 4 deleted memory hooks:
- capture-all-events.ts
- capture-session-summary.ts
- stop-hook.ts
- subagent-stop-hook.ts
The hooks were recovered from git history (commit 45bb441^) and updated for the MEMORY/ structure.
PR: https://github.com/danielmiessler/Personal_AI_Infrastructure/pull/411
Testing: Verified working locally with 59 events captured and 4 sessions summarized.
Would appreciate review when you have a chance. This should restore full memory capture functionality.
cc @danielmiessler
Thanks for the detailed report! History hooks were replaced by the new MEMORY and LEARNING systems in v3.0 (now released). Session capture works differently in the new architecture. Please upgrade to v3.0.