hooks-session-end-issue-hook
Configure a Stop hook that surfaces unfinished todos at session end. Use when you want deferred work automatically flagged for GitHub issue creation.
What this skill does
# /hooks:session-end-issue-hook
Configure a `Stop` hook that checks for unfinished `TodoWrite` todos at the end of each Claude response. If any pending or in-progress todos exist when you try to end the session, Claude is prompted to create GitHub issues for them before the conversation closes.
## When to Use This Skill
| Use this skill when... | Use `/hooks:hooks-configuration` instead when... |
|---|---|
| You want unfinished todos deferred to GitHub issues | Configuring other hook types (PreToolUse, SessionEnd, etc.) |
| Preventing tasks from being forgotten at session end | Need general hooks knowledge or debugging |
| Projects with active issue trackers on GitHub | Understanding hook lifecycle events |
| Teams that rely on GitHub issues for work tracking | Writing custom hook logic from scratch |
## Context
Detect current state:
- Settings file: !`find .claude -maxdepth 1 -name 'settings.json'`
- Existing Stop hooks: !`jq -r '.hooks.Stop // empty' .claude/settings.json`
- gh auth: !`gh auth status`
- jq available: !`jq --version`
## Parameters
| Flag | Default | Description |
|---|---|---|
| `--no-verify` | off | Skip checking `gh` authentication status |
## Execution
### Step 1: Check prerequisites
Verify that `jq` is installed — the hook requires it to parse the session transcript. Report if missing.
Unless `--no-verify` is passed: verify `gh` is installed and authenticated (`gh auth status`). Report the auth state so the user knows whether GitHub issue creation will work when the hook fires.
### Step 2: Locate hook script
The hook script ships with the hooks-plugin. Determine its path:
- If `${CLAUDE_PLUGIN_ROOT}` is set: use `${CLAUDE_PLUGIN_ROOT}/hooks/session-end-issue-hook.sh`
- Otherwise: look for the script relative to this skill's location (`../../hooks/session-end-issue-hook.sh`)
- Last resort: ask the user for the absolute path to the installed hooks-plugin
Report the resolved path to the user.
### Step 3: Configure `.claude/settings.json`
Read existing `.claude/settings.json` if it exists. **Merge** the Stop hook — preserve all existing configuration.
If a `Stop` hook pointing to `session-end-issue-hook.sh` already exists, report that the hook is already configured and skip to Step 4.
If other Stop hooks exist, add alongside them (both will run).
Configuration to merge under the `hooks` key:
```json
{
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-end-issue-hook.sh\"",
"timeout": 15
}
]
}
]
}
```
Use `timeout: 15` (15 seconds) — transcript parsing is fast. Create `.claude/` directory if it does not exist.
### Step 4: Finalize
Report a summary of what was configured, including:
- Path to the hook script
- Location of `.claude/settings.json`
- Whether `gh` auth is ready
## Post-Actions
After configuring the hook:
1. Suggest committing `.claude/settings.json` to share the hook with the team
2. Remind the user that the hook fires at the end of **every** Claude response — it is silent when all todos are completed and only blocks when pending todos exist
3. If `gh` is not authenticated, remind the user to run `gh auth login` so GitHub issue creation works when the hook fires
## How the Hook Works
When the hook fires at the end of a Claude response:
1. It reads the session transcript from `transcript_path`
2. Finds the **last `TodoWrite` call** — the final state of the todo list
3. Extracts any todos with `status: "pending"` or `status: "in_progress"`
4. If none exist → silently exits (no interruption)
5. If any exist → outputs a block decision with the list of pending todos and suggested `gh issue create` commands
Claude then has the opportunity to create the issues or ask the user what to do with the deferred work.
## Agentic Optimizations
| Context | Approach |
|---|---|
| Quick setup, skip auth check | `/hooks:session-end-issue-hook --no-verify` |
| Full setup with auth verification | `/hooks:session-end-issue-hook` |
| Test the hook manually | `echo '{"transcript_path":"/path/to/transcript","cwd":"."}' \| bash hooks/session-end-issue-hook.sh` |
## Quick Reference
| Item | Value |
|---|---|
| Hook event | `Stop` (fires after each Claude response) |
| Settings location | `.claude/settings.json` |
| Timeout | 15 seconds |
| Trigger condition | Pending or in-progress todos in last TodoWrite call |
| Silent when | All todos completed or no TodoWrite calls in transcript |
| Issue label | `claude-deferred` (suggested in output, not auto-applied) |
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.