agentleFS
ccomkhjccomkhj/skills/scan-sessions-and-learn/SKILL.md

scan-sessions-and-learn

Skill10 starsChanged 19 days agoMITView on GitHub

Retrospective over recent Claude Code sessions — find the workflows you repeat and where they stall, check each lesson against what your skills and AGENTS.md already say, and hand it to the one place that owns the fix (improve-skills, skill-flow, agents-md-improver, or a proposed edit). `--new-skills` narrows it to routines you still do by hand that a new skill should carry. Proposes only; never edits. Looks at work habits, not beliefs (socrates) or context cost (manage-context).

The file

Files
SKILL.md

scan-sessions-and-learn

Inside one session you can't see your own habits: the rule you re-explain every few days, the chain you always run in the same order, the step where you keep rewinding. Across sessions they become counts. This skill turns those counts into a few lessons and hands each one to whatever owns the fix. It proposes and never edits, because the owners already have their own approval gates.

--new-skills asks a narrower question: which routine do you keep carrying by hand? Edits to existing skills fix friction; only a new skill removes a routine. Same steps, but with the window, sources, confidence tiers and proposal shape from references/new-skill.md.

  1. Scan. Run python3 -I ${CLAUDE_SKILL_DIR}/scripts/scan.py --part summary with the user's window flags (default: last 7 days, all repos; --min-turns N drops short sessions; headless runs, scratchpads, this session and earlier runs of this skill are left out). The summary says whether to read the session blocks yourself or prints a batch plan; for a plan, launch one subagent per batch in one message with references/batch.md. If the last handoff's scope already covered this window, read only the sessions active since it, by the summary's plan for them: the rest were judged, and its findings carry them. Done when you hold the summary plus every session or batch result you need, and know how far back the data reaches.
  2. Name the workflows. 3–6 that actually recur: trigger, usual chain, how many sessions, typical agent time. Read them from the recurring chains and flows, not from any single session. Done when each workflow cites its sessions (ids in the handoff: labels renumber with every window).
  3. Judge the friction. The digest marks candidates, not verdicts: ↺ a prompt the user rewound and rewrote, ⏹ the prompt after an interrupt, ✗ a rejection with the user's reason, » an accepted suggestion (Claude's wording, not the user's), plus recurring phrases and repeated tool failures. The digest shows only the user's side, so when a prompt alone can't tell a correction from a habit, pull what stood behind it — the error, the denied call, Claude's previous reply — with --grep REGEX (also matches the user's prompts across sessions) or --errors, narrowed by --ids S12,S40 (same window flags; prints redacted snippets). Batch results are another model's paraphrase and can invert what the user said, so check each batch claim you'd build a finding on — or drop — inside the sessions it cites (--ids), not with a pattern guessing the user's wording. Decide what each cost and whether it is a correction, a re-explanation, a detour or just a habit. Done when every finding meets the evidence floor in references/routing.md or is moved to watch.
  4. Check what already exists. Start from the last handoff the digest names: its findings are proposals the user may not have acted on yet, and re-deriving them buys nothing. Run each one's check line and carry it forward as applied, pending or stale; if no session is newer than it, there is little else to find. Then, before proposing anything new, read the target — the repo's AGENTS.md, ~/.claude/CLAUDE.md, the SKILL.md, memory — and label the finding missing, ignored, or covered. Date the rule with git log first: only occurrences after it landed show it ignored, and with none yet it is untested, so watch it. Drop covered; an ignored rule needs a hook or sharper wording, not another line. Done when every earlier finding has a status and every new one names the file checked and its label.
  5. Route and report. One sink per finding per references/routing.md, ranked by sessions × cost × fixability. Report in chat: workflows, findings, watch list, dropped. "Nothing worth changing" is a valid result. Done when every finding has exactly one sink and one concrete change.
  6. Hand off. Update the one handoff file in place per references/handoff.md: pending findings keep their numbers and run lines, so nothing an owner was pointed at moves, and a narrower run never drops one it didn't re-check. End with its run lines. Offer (never automatic) to save 1–3 durable facts as WikiBrain memories per ~/personal/WikiBrain/GUIDELINES.md. Done when the file exists and nothing else was written.

Prompts carry client names, pasted data and query results. Quote at most a short phrase in chat; the handoff file and memory get paraphrase only.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.