scanning-sessions

Converts eligible session-review candidates into tested hook pull requests.

13|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/yasyf/captain-hook --skill scanning-sessions-yasyf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scanning-sessions
Source: https://github.com/yasyf/captain-hook/tree/main/captain_hook/skills/scanning-sessions
Command: npx skills add https://github.com/yasyf/captain-hook --skill scanning-sessions-yasyf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Repeatedly correcting an AI coding agent wastes effort because the corrections never become permanent rules. This Skill turns mined, judge-accepted correction candidates into typed, tested Python hooks and opens one pull request per candidate with verbatim evidence. ## Core Features & Use Cases - Candidate verification: Enumerates threshold-eligible candidates via the capt-hook review CLI and re-verifies every quoted correction verbatim against session transcripts before acting. - Routing and overlap screening: Screens each create candidate against active repo-local and pack hooks, deciding between a new hook, an EXTEND edit, a FIX amendment, or a duplicate skip, and routes the PR to the correct repository. - Drafting and PR creation: Delegates hook drafting to the authoring-hooks skill, verifies with capt-hook test in a worktree or clone, and opens exactly one PR per candidate with an evidence-backed body. - Use Case: After a session where a user repeatedly corrected force-push behavior, the detached reviewer spawns this Skill, which drafts a block_command hook, proves it with inline tests, and opens a PR citing the verbatim corrections. ## Quick Start Invoke /captain-hook:scanning-sessions --transcript with the path to the ended session's transcript inside the watched repository.

Frequently Asked Questions about scanning-sessions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I turn repeated AI agent corrections into permanent hooks?

Run the scanning-sessions skill with a session transcript path; it enumerates eligible candidates via capt-hook review threshold-check, drafts a typed Python hook per candidate, verifies it with capt-hook test, and opens one pull request per candidate.

How does the skill decide between creating a new hook and editing an existing one?

It screens each create candidate against all active hooks using capt-hook hooks output and repo-local sources. A rule already covered is skipped, a broadening becomes an EXTEND edit of the existing hook, and anything else becomes a new repo-local hook.

Can a fix PR target a hook that lives in a different repository?

Yes. Fix candidates carry a routing line naming the target repo; the skill clones that repo, amends the pack hook there, verifies with the pack-appropriate test command, and opens the PR against the pack's own repository.

What happens if a candidate's quoted correction cannot be found in a transcript?

The candidate is skipped and stays in watching status. Every verbatim quote must appear in a real session transcript before any PR is opened; unverifiable candidates are never PR'd and are re-evaluated on the next scan.

Why does the skill never commit directly to the user's checkout?

All writes happen in a git worktree or temp-dir clone off origin's default branch, so the user's uncommitted work is never touched and each PR is reviewable against the default branch. A denied push to a pack repo is a logged skip, never a local fallback commit.