Skip to content

feat: broaden hook + common-field coverage (v0.22.4) - #97

Merged
minarc merged 4 commits into
mainfrom
feat/more-hooks-fields
Jul 9, 2026
Merged

minarc merged 4 commits into
mainfrom
feat/more-hooks-fields

Conversation

@minarc

@minarc minarc commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Maximize hook-event and common-input-field coverage against the current Claude Code hook schema.

New hook events (via the data-driven dispatcher)

Event Captured
Setup setup_type
CwdChanged path (HMAC-hashed)
Elicitation server, tool_name, tool_input
ElicitationResult server, tool_name (raw user_response omitted — user PII)

Full common-input-field coverage (central data)

All 9 documented common fields are now captured on every event:
session_id, hook_event_name, prompt_id, transcript_path, cwd, permission_mode, effort_level, agent_id, agent_type.

  • Re-added effort_level — the effort capture was lost during feat: capture prompt_id + reasoning-effort level (v0.22.3) #96's rebase and never reached main.
  • Added agent_id / agent_type centrally so subagent context is recorded on every event fired inside a subagent (not just the Subagent* lifecycle events).
  • SessionStart also now captures session_title.

Field-name corrections (were silently capturing undefined)

StopFailure (error_type/error_message), TeammateIdle (agent_type), TaskCreated (task_metadata), TaskCompleted (completion_status), ConfigChange (config_source), WorktreeCreate (worktree_name/worktree_path); dropped nonexistent Notification.title / InstructionsLoaded.memory_type.

MessageDisplay — deliberately NOT captured

It fires per streaming delta (hundreds of node-process spawns per turn), and its turn_id/message_id have no documented, stable join to the transcript (docs warn the JSONL format is internal/unstable). Turn-level correlation is already provided by the documented common field prompt_id; full message content lives in the uploaded transcript.

Verification

  • node --test → 57/57 pass; claude plugin validate ✔.
  • Smoke: new events, CwdChanged.path hashed, all 9 common fields captured on one event.
  • Bump 0.22.3 → 0.22.4.

🤖 Generated with Claude Code

minarc and others added 2 commits July 9, 2026 20:08
New observation-only hook events (via the dispatcher — registry + hooks.json):
- Setup (setup_type), CwdChanged (path, hashed), MessageDisplay (message_length
  only — content lives in the transcript), Elicitation (server/tool_name/
  tool_input), ElicitationResult (server/tool_name; raw user_response omitted
  for privacy).

Field-name corrections to match the current hook input schema — these events
were previously capturing undefined:
- StopFailure: error_type/error_message (was error/error_details)
- TeammateIdle: agent_type
- TaskCreated: task_metadata; TaskCompleted: completion_status
- ConfigChange: config_source; WorktreeCreate: worktree_name/worktree_path
- Notification: dropped nonexistent title; InstructionsLoaded: dropped memory_type

Also: SessionStart now captures session_title. Coverage/field tests added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 279ad327-b9ea-4499-9d00-c3c55a915506

📥 Commits

Reviewing files that changed from the base of the PR and between 332f4c3 and 9aad2a6.

📒 Files selected for processing (6)
  • skillmeter/.claude-plugin/plugin.json
  • skillmeter/hooks/hooks.json
  • skillmeter/scripts/lib/hook-registry.js
  • skillmeter/scripts/logger.js
  • skillmeter/scripts/session_start.js
  • skillmeter/test/lib.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/more-hooks-fields

Comment @coderabbitai help to get the list of available commands.

minarc and others added 2 commits July 9, 2026 20:16
…k-only

MessageDisplay fires per streaming delta, so capture no content and log only
the final chunk:
- add turn_id to the central event fields (all events get turn-level correlation,
  free — like prompt_id)
- MessageDisplay mapper returns { message_id } on final, else null
- runHook now treats a null mapper return as 'skip logging this occurrence'
  (the hook still ran; nothing is written)

Result: one lightweight record per assistant message (turn_id + message_id, no
delta), instead of a content-bearing record per chunk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
MessageDisplay fires per streaming delta (hundreds/turn = a node spawn each)
and its turn_id/message_id have no documented, stable join to the transcript, so
it's removed (registry + hooks.json + the runHook null-skip + central turn_id it
required).

Complete the common-input-fields coverage in the central event data:
- re-add effort_level (the effort capture was lost in #96's rebase and never
  reached main)
- add agent_id / agent_type centrally so subagent context is recorded on EVERY
  event fired inside a subagent (not just the Subagent* lifecycle events)

All 9 documented common fields are now captured: session_id, hook_event_name,
prompt_id, transcript_path, cwd, permission_mode, effort_level, agent_id,
agent_type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
@minarc minarc changed the title feat: add 5 hook events + fix stale field names (v0.22.4) feat: broaden hook + common-field coverage (v0.22.4) Jul 9, 2026
@minarc
minarc merged commit b7dded5 into main Jul 9, 2026
1 check passed
@minarc
minarc deleted the feat/more-hooks-fields branch July 9, 2026 11:36
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.

1 participant