From deep-kiss
Use when the user invokes /afterglow to retrospectively scan the current project's past Claude Code sessions for repeated user corrections or workflow patterns. afterglow is an analyst: it surfaces patterns with verbatim evidence and offers to hand selected candidates to aftercare for capture. afterglow itself does NOT decide bucket, draft skills, or write files. Project-scoped. User-explicit invocation only; do NOT trigger automatically.
How this skill is triggered — by the user, by Claude, or both
Slash command
/deep-kiss:afterglowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`aftercare` and `afterglow` are two entry points to the same goal — capturing reusable learning from the project — and differ only in *discovery*:
aftercare and afterglow are two entry points to the same goal — capturing reusable learning from the project — and differ only in discovery:
afterglow finds candidates and presents them with evidence. It then asks whether to hand the selected ones to aftercare, which owns the judgment (skill / memory-file / drop) and the drafting. afterglow itself never drafts and never writes files.
/afterglow. Never auto-trigger.aftercare instead.pwd./ with -. Example: /Users/x/y → -Users-x-y.${CLAUDE_CONFIG_DIR:-$HOME/.claude}.SESSIONS_DIR = ${BASE}/projects/${ENCODED}.CACHE_DIR = ${BASE}/afterglow/${ENCODED}. Create it if absent: mkdir -p.If SESSIONS_DIR does not exist, print "No prior sessions found for this project." and exit.
Call the bundled helper script in a single Bash invocation (path is relative to this skill's root):
bash scripts/list-substantive-sessions.sh "${SESSIONS_DIR}"
The script sorts by mtime descending, drops sessions with user_message_count < 2 OR size < 4096 bytes, and caps the output at the most recent 50 by default. Override with --limit N (or --limit 0 for unlimited) only when the user explicitly asks for a wider scan.
Do NOT inline this as a shell loop (cd ~/.claude/projects/<encoded> && for f in *.jsonl ... or any for/while over the sessions directory with grep/wc substitutions). Auto-mode permission classifier blocks those patterns. Always go through the helper.
If the output is empty, print "No substantive sessions found for this project." and exit.
For each session path, with session_id = <filename without .jsonl>:
${CACHE_DIR}/<session_id>.txt..jsonl, mark as cached — skip compression.bash scripts/compress-session.sh <jsonl_path> ${CACHE_DIR}/<session_id>.txt. The script writes [User]: ... / [Assistant]: ... / [Tool: NAME] lines (typical reduction 40–50×).Print a one-line summary: "Compressed N new (M cached)."
Dispatch a single subagent (one Agent tool use):
analyst-prompt.md.(session_id, transcript_path) pairs covering the substantive set. The subagent will Read each .txt itself — the main context never reads transcript content.sessions_scanned, candidates, also_seen).Parse the YAML. On parse failure, re-dispatch once with a structure-correction note. If it still fails, print the raw output and ask the user how to proceed.
candidates: [] → "No repeated patterns found across N sessions." Print also_seen topics as a one-liner if any (for transparency). Exit.
Otherwise, for each candidate, render the kind field and its suggested bucket so the user (and downstream aftercare) sees the analyst's tag:
N. [×<count>] <topic>
Kind: <kind> → suggested bucket: <skill | CLAUDE.md>
Evidence:
• "<verbatim quote>" (session <id[:8]>)
• "<verbatim quote>" (session <id[:8]>)
Pattern: <detail>
Bucket-hint mapping:
repeated_task_kickoff → skillmulti_step_procedure → skillconvention_correction → CLAUDE.mdThe hint is a suggestion, not a decision. aftercare's 4-criteria judge still owns the final routing (skill / memory-file / drop).
After the list, if also_seen is non-empty, append one line: "Also seen once each: <topic>, <topic>, ..." (truncate to ~5).
Ask the user:
"캡처할 패턴이 있나요? aftercare를 트리거하면 메모리/스킬로 만들 수 있습니다. 선택: (숫자 / all / no)"
Branches:
no or cancel → "OK. /aftercare 직접 호출하셔도 됩니다." Exit cleanly. No files written.all → Echo the selection back in plain text so it becomes part of the conversation context: "선택된 패턴: 1, 3 — aftercare로 넘깁니다." Then invoke Skill(aftercare) so its stage-1 judge picks up the presented candidates from the conversation. afterglow's job ends here; the rest is aftercare's flow.Skill(aftercare) unavailable or fails → Fall back to printing "/aftercare 를 다음 메시지로 호출해주세요." while keeping the candidate list on screen. Same destination either way.| Situation | Handling |
|---|---|
SESSIONS_DIR missing | Step 1: "No prior sessions found for this project." Exit. |
| Substantive set empty | Step 2: "No substantive sessions found for this project." Exit. |
| Single compression failure | Log a one-line warning, continue with the remaining sessions. |
| Analyst YAML parse failure | Re-dispatch once with a correction note. If still bad: show raw output, ask user. |
| Zero candidates | Step 5: clean exit, with also_seen summary if any. |
| User rejects hand-off | Step 6: clean exit, no writes. |
Skill(aftercare) chaining unsupported | Step 6: fall back to "type /aftercare next". |
.claude/skills/, AGENTS.md, CLAUDE.md, or ~/.claude/MEMORY.md. That work belongs to aftercare..txt cache is append-only; do not delete on failure. Stale .yaml files from previous afterglow versions in the cache directory are harmless — leave them.npx claudepluginhub tgoddessana/deep-kiss --plugin deep-kissGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.