Claude Code skill: finds bugs from your session and opens GitHub issues automatically
SaferSkills independently audited session-bug-hunter (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Scans the current Claude Code session (conversation + changed files) for bugs and potential issues, presents a prioritized list for user approval, then creates GitHub issues automatically.
Before anything else, run:
gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/nullIf this fails:
gh issue create calls.Also check gh auth:
gh auth status 2>&1Parse the output carefully:
Logged in to AND Active account: true → auth is OK, proceed silently.Logged in to but no active account → run gh auth switch to activate.Logged in to at all → tell the user:"GitHub CLI is not authenticated. Run gh auth login first, then retry." Stop here — do not proceed.Important: Multiple accounts (e.g. github.com + github.company.cloud) is normal and valid. Do NOT treat multiple accounts as an error. Only fail if there is truly no authenticated account. Always use the account where Active account: true appears.
Read the entire conversation from top to bottom. Extract signals of problems:
Hard signals (almost certainly a bug):
"this will break if...", "edge case we're ignoring", "not handling X"
Soft signals (potential issues worth flagging):
Run:
git diff --name-only HEAD 2>/dev/null || git status --short 2>/dev/nullFor each changed file, read it and look for:
TODO, FIXME, HACK, XXX, BUG, TEMP commentscatch {}, except: passconsole.log / print / debugger statements left inFor each detected issue, create a structured entry:
ID: BUG-001
Title: [concise, actionable — verb + noun, e.g. "UserService crashes on empty email input"]
Type: bug | tech-debt | regression | performance
Severity: critical | high | medium | low
Source: conversation | code | both
File: path/to/file.ts (line N) — if applicable
Description: 2-3 sentences. What is the problem, where does it occur,
what is the risk or impact if left unfixed.
Reproduction: Step-by-step if inferable from context. "Unknown" if not.
Suggested fix: One sentence if obvious from context. "Needs investigation" if not.Severity rules:
critical — data loss, security vulnerability, auth bypass, crash on common pathhigh — feature broken, workaround applied, error swallowed silentlymedium — edge case unhandled, tech debt with clear risk, degraded performancelow — TODO comments, code style issues, minor optimizations, debug logs left inDeduplication: If the same issue appears in both conversation and code, merge into one entry with Source: both.
Display the full list clearly before opening anything:
🔍 Session Bug Hunter — Found N potential issues
═══════════════════════════════════════════════
[CRITICAL] BUG-001 · bug
UserService crashes on empty email input
📁 src/services/user.ts:47
Seen in: conversation + code
─────────────────────────────────────────
The validateUser() function does not guard against null/empty email before
calling .toLowerCase(), causing a TypeError in production when email is
omitted from the request body. A workaround was applied during this session
but the root cause was not fixed.
[HIGH] BUG-002 · tech-debt
JWT secret hardcoded in auth middleware
📁 src/middleware/auth.ts:12
Seen in: code
─────────────────────────────────────────
...
[MEDIUM] BUG-003 · performance
...
───────────────────────────────────────────────────────
Which issues should I open as GitHub issues?
Type: "all", "1,2,3", "critical only", "high and above", or "none"Wait for the user's response before proceeding.
For each approved bug, create a GitHub issue using this exact template:
Issue title:
[{TYPE}] {Title}Issue body:
## 🐛 Description
{Description}
## 📍 Location
{File and line if available, otherwise "See session context"}
## 🔁 Steps to Reproduce
{Reproduction steps or "Needs investigation"}
## 💡 Suggested Fix
{Suggested fix}
## 📊 Metadata
- **Severity**: {severity}
- **Type**: {type}
- **Detected by**: session-bug-hunter skill
- **Session date**: {YYYY-MM-DD}
- **Source**: {conversation | code | both}
---
*Auto-generated from Claude Code session analysis*Labels to apply (use --label flag, create if missing):
critical, high, medium, lowbug, tech-debt, regression, performanceRun for each approved issue:
gh issue create \
--repo {owner/repo} \
--title "[{TYPE}] {Title}" \
--body "{body}" \
--label "{severity},{type}"If a label doesn't exist yet, create it first:
gh label create "{label}" --color "{color}" --repo {owner/repo}Label colors:
critical → #d73a4ahigh → #e4e669medium → #0075calow → #cfd3d7bug → #d73a4atech-debt → #e4e669regression → #d93f0bperformance → #0075caAfter all issues are created, output:
✅ Session Bug Hunter — Done
Opened N GitHub issues in {owner/repo}:
#142 [CRITICAL] UserService crashes on empty email input
#143 [HIGH] JWT secret hardcoded in auth middleware
#144 [MEDIUM] Missing pagination on /api/users endpoint
Skipped: BUG-003 (user declined)
No issues found for: BUG-005 (duplicate of existing #138)
Run `gh issue list --label bug` to view all open bugs.The session looks clean! 🎉" — do not open any issues.
brew install gh orhttps://cli.github.com and retry.
gh issue list --search "{title}" --state open --json number,titleIf a near-identical issue exists, flag it and ask the user whether to open a new one or skip.
ask user to check repo access with gh repo view.
| User says | Action |
|---|---|
| "find bugs from this session" | Run full flow |
| "open github issues for what we found" | Run full flow |
| "what bugs did we introduce?" | Run full flow |
| "create issues for the TODOs we left" | Run full flow, focus on TODOs |
| "just critical bugs to github" | Run flow, pre-filter to critical only |
| "bug report" | Run full flow |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.