.pi/agent/skills/context-scan/SKILL.md
Scan recent Claude session logs for missed insights (fallback when Stop hook fails). This skill should be used when the user says "context scan", "scan sessions", "check old sessions", "find missed insights", or wants to recover insights from sessions where the Stop hook did not fire. Also used by hourly cron to automatically sweep for uncaptured knowledge.
npx skillsauth add popoffvg/dotfiles context-scanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scan recent Claude Code session logs for insights the Stop hook may have missed.
/context scan — last hour
/context scan 3h — last 3 hours
/context scan 1d — last day
Read insights_root from ~/.claude/memory-keeper.local.md YAML frontmatter.
~/.claude/projects/ subdirectories*.jsonl files modified within the time windowsessionId from first record)<insights_root>/.scanned_sessionsFor each unscanned JSONL:
type is "user" or "assistant"message.content string, skip <command, <system, <local prefixesmessage.content array (block.type == "text")For each session, identify distinct topics worth remembering. For each:
insight | agent_edit | task | none~/.claude/projects/<encoded-path>/ last path segmentClassifications:
insight: completed work — how things work, patterns, gotchas, decisionsagent_edit: AI behavior changes — hooks, prompts, skills, plugin configtask: ONLY unstarted intentions (not completed work)none: routine, skip## <Keyword-rich title, 3-7 words> — YYYY-MM-DD HH:MM
<Lead: direct statement of what this is and why it matters. 1-3 sentences.
Include concrete identifiers: file paths, function names, config keys.
No preamble. Write for someone with zero memory of this session.>
### Subsection (only when topic has multiple distinct aspects)
<Details>
Heading = the search key. Must be findable months later:
RocksDB WAL mode: disable for unit test speedDatabase optimization, Fixed performance issueLead = complete picture. Self-contained, no preamble:
RocksDB in WAL journal mode acquires a file lock that prevents parallel test processes from opening the same DB. Disable WAL with \db.pragma("journal_mode = DELETE")` in test setup.`We found that the database was causing issues because...Before saving each entry, read the target file:
Save locations:
insight → <insights_root>/<repo>/insights.md (or _tasks/<slug>/notes.md if active task in _tasks/pending.md)agent_edit → <insights_root>/claude-config/behavior.mdtask → <insights_root>/_tasks/pending.mdAppend each processed session filename to <insights_root>/.scanned_sessions.
Eval checklist:
Test inputs:
Can change: log parsing strategy, time window parsing, insight extraction criteria, deduplication Cannot change: insights_root config requirement, session log location, fallback nature (supplements Stop hook) Min sessions before eval: 5 Runs per experiment: 3
testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.