Skip to content

fix: register 11 dormant hooks + SmartApprover in v5.0.0 settings.json#1200

Closed
brycemagera wants to merge 4 commits into
danielmiessler:mainfrom
brycemagera:fix/register-dormant-hooks
Closed

fix: register 11 dormant hooks + SmartApprover in v5.0.0 settings.json#1200
brycemagera wants to merge 4 commits into
danielmiessler:mainfrom
brycemagera:fix/register-dormant-hooks

Conversation

@brycemagera

Copy link
Copy Markdown

Problem

The Releases/v5.0.0/.claude/settings.json had hook files deployed to hooks/ but no corresponding settings.json entry — making them permanently dormant. The hooks existed, the code worked, but Claude Code never fired them.

An audit found 13 hooks in this state (plus SmartApprover from PR #1136 not yet reflected in the release file).

Changes

New event type registrations

These hook event types were added to Claude Code but never wired up in the release settings:

  • PostToolUseFailureToolFailureTracker.hook.ts
  • ElicitationElicitationHandler.hook.ts
  • InstructionsLoadedInstructionsLoadedHandler.hook.ts
  • PostCompactRestoreContext.hook.ts
  • TaskCreatedTaskGovernance.hook.ts
  • StopFailureStopFailureHandler.hook.ts
  • ConfigChangeConfigAudit.hook.ts
  • FileChangedFileChanged.hook.ts
  • TeammateIdleTeammateIdle.hook.ts

Existing event type updates

  • PostToolUse Write+Edit → ISASync.hook.ts added before TelosSummarySync
  • PreToolUse Agent → AgentInvocation.hook.ts added alongside existing agent-guard HTTP hook
  • PostToolUse Agent → AgentInvocation.hook.ts new matcher entry for stop-side duration tracking

Also includes

SmartApprover.hook.ts on PermissionRequest (Write|Edit|MultiEdit|Bash) — carried over from PR #1136 which was not yet reflected in the release file.

Testing

Verified against a live PAI 5.0 install. All hooks fire on their respective events after registration.

observability.ts imports 'yaml' at the top level but it was not
declared in package.json or bun.lock. On every cold start Bun
cannot resolve it, the observability module silently fails to load,
and the Pulse dashboard returns 404 on all routes.

Add yaml@^2.8.3 as a runtime dependency and update bun.lock.
PULSE/modules/wiki.ts imports minisearch and PULSE/modules/observability.ts
imports yaml, but neither was declared in any package.json. smol-toml is
used by pulse.ts and lib.ts to parse PULSE.toml.

On cold start Bun cannot resolve these packages, the wiki and observability
modules fail to load silently, and all /api/wiki/* routes return 404
(breaking the /knowledge, /docs, /skills, and /hooks Pulse pages).

Create PULSE/package.json with all three runtime deps and add its bun.lock.
Update .gitignore to carve out PAI/PULSE/bun.lock alongside the existing
Observability/bun.lock exception.
The following hooks were deployed in the hooks/ directory but had no
settings.json entry, making them dormant:

New event type registrations:
- PostToolUseFailure → ToolFailureTracker.hook.ts
- Elicitation        → ElicitationHandler.hook.ts
- InstructionsLoaded → InstructionsLoadedHandler.hook.ts
- PostCompact        → RestoreContext.hook.ts
- TaskCreated        → TaskGovernance.hook.ts
- StopFailure        → StopFailureHandler.hook.ts
- ConfigChange       → ConfigAudit.hook.ts
- FileChanged        → FileChanged.hook.ts
- TeammateIdle       → TeammateIdle.hook.ts

Existing event type updates:
- PostToolUse Write|Edit → ISASync.hook.ts (before TelosSummarySync)
- PreToolUse Agent       → AgentInvocation.hook.ts (alongside agent-guard)
- PostToolUse Agent      → AgentInvocation.hook.ts (new matcher entry)

Also adds SmartApprover (PermissionRequest) from PR danielmiessler#1136 which was
not yet reflected in the release settings.json.
CheckpointPerISC was deployed in hooks/ but had no settings.json entry
and no HookSystem.md documentation, leaving it dormant and undiscoverable.

This commit:
- Registers CheckpointPerISC.hook.ts on PostToolUse Write|Edit (alongside
  ISASync and TelosSummarySync)
- Adds full documentation entry to HookSystem.md covering its trigger,
  opt-in allowlist mechanism (~/.claude/checkpoint-repos.txt), commit
  format, idempotency via sidecar state file, and fail-closed semantics

Registering the hook is safe without the allowlist — it's a no-op when
the allowlist file is missing or empty.
@danielmiessler

Copy link
Copy Markdown
Owner

Hey @brycemagera, thank you for the PR and the work that went into it.

We're changing how LifeOS ships: from a full ~/.claude directory you run as-is, to a skill installed by an agentic installer that has your own AI integrate the pieces into your setup. That reworks the parts of the codebase this change touches, so it won't apply cleanly to where we're headed.

We're closing it for that reason, not because the idea was wrong. If the need still stands against the new model, we'd love a fresh PR once it lands. Thanks again for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants