-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
Description
Context
Part of the Native Analysis via Claude Code Hooks feature (Phase 12, v4.8.0).
Plan: docs/plans/2026-03-28-native-analysis-hooks.md
Issue 4 of 6 — Depends on #240 (insights command must exist).
Problem
Today code-insights install-hook only installs a Stop hook for auto-sync. To enable native analysis, we also need a SessionEnd hook that triggers code-insights insights --hook --native -q.
Solution
Update installHookCommand() to install both hooks by default:
{
"hooks": {
"Stop": [
{ "hooks": [{ "type": "command", "command": "node <cli> sync -q" }] }
],
"SessionEnd": [
{ "hooks": [{ "type": "command", "command": "node <cli> insights --hook --native -q", "timeout": 120000 }] }
]
}
}New Flags
--sync-only— install only the Stop (sync) hook--analysis-only— install only the SessionEnd (analysis) hook
Updated Uninstall
uninstallHookCommand() cleans both Stop and SessionEnd hooks.
Updated Messaging
Install Code Insights Hooks
This will add two Claude Code hooks:
Stop hook — Syncs sessions after each response
SessionEnd hook — Analyzes sessions using your Claude subscription
No API key needed. (~15-30s per session)
Install both hooks? [Y/n]
Acceptance Criteria
- Default
install-hookinstalls both Stop + SessionEnd hooks -
--sync-onlyinstalls only Stop hook -
--analysis-onlyinstalls only SessionEnd hook - Duplicate detection works for both hook types
-
uninstall-hookremoves both hook types - SessionEnd hook has 120s timeout configured
- Updated CLI output messaging explains both hooks
- Telemetry tracks which hook types were installed
Reactions are currently unavailable