You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Port reflection-3 to Claude Code as Stop-hook plugin #137
Parent: #131 (portability verdict — Claude Code adapter declared viable).
In long CC sessions, the agent forgets project-level skill guidance (e.g. /take-ownership) and back-delegates to the user prematurely. reflection-3.ts already solves the equivalent problem in OpenCode via session.idle hook. This issue tracks porting that pattern to Claude Code.
Goal
A CC plugin that, on the Stop event:
Grades whether the assistant actually finished the task (re-uses reflection-3 evaluator).
If incomplete, injects a follow-up prompt via decision: "block" + additionalContext to keep the agent driving.
Honors stop_hook_active to prevent infinite loops.
Detects planning/action loops and back-delegation to the user as failure modes.
Success Metric
Manual smoke: open a fresh CC session in this repo, give a multi-step coding task, observe at least one Stop→inject→continue cycle where the plugin successfully re-prompts the agent. Plugin must NOT loop more than 3 times on same failure mode, and must not fire when stop_hook_active=true.
Scope
New: claude/ directory containing the plugin (manifest + hook + bin script)
Reuse: import core grading/loop-detection from a shared module extracted from reflection-3.ts (or, speed path, copy + adapt)
Plugin installed globally on dev machine via ~/.claude/settings.json (settings-based path is authoritative for CC v2.1.150 — --plugin-dir does not enable Stop hooks in -p mode; see follow-up note in #139).
Real CC session (claude -p headless, fresh /tmp dir) → Stop hook fired → classifier ran (Haiku 4.5 via OAuth) → category=complete confidence=0.99 → no inject (correct, trivial Q&A). Hook latency ~870ms.
Activity
fix(claude): address PR review findings (#137)
ci: run claude/ plugin unit tests in CI (#137)
test(claude): replace stubbed unit tests with real E2E (#137)
docs(claude): update install + testing sections for v2.1.150 reality (#…
Claude Code reflection plugin + 907-stop classification baseline (#139)
dzianisv commentedon May 26, 2026
Shipped in #139 as 28d1aa0.
Post-merge prod verify: PASS
Plugin installed globally on dev machine via
~/.claude/settings.json(settings-based path is authoritative for CC v2.1.150 —--plugin-dirdoes not enable Stop hooks in-pmode; see follow-up note in #139).Real CC session (
claude -pheadless, fresh /tmp dir) → Stop hook fired → classifier ran (Haiku 4.5 via OAuth) →category=complete confidence=0.99→ no inject (correct, trivial Q&A). Hook latency ~870ms.Evidence:
.tasks/131-cc-reflection/smoke-evidence/prod-verify/Follow-ups
workingover-assigned 374/907,tool_available_puntunder-assigned 0/907).--plugin-dirnot enabling Stop hooks in-pmode (likely upstream CC behavior).feat(claude): Claude Code reflection plugin E2E tests and CI (#137) (#…