← ClaudeAtlas

mine-skillslisted

Mine your past agent sessions (Claude Code, Codex) for recurring failures and re-explained procedures, then distill the best candidates into reusable skills that land in the central library via `agentstack lib add`. Local and read-only until you approve a draft.
Tarekkharsa/agentstack · ★ 2 · AI & Automation · score 75
Install: claude install-skill Tarekkharsa/agentstack
# Mine skills from your sessions Use when you want to turn *what kept going wrong* into *skills that stop it going wrong* — analyze the last week/month of agent sessions, find the moments worth teaching, and draft skills from them. A one-off mistake is not a skill. A mistake you corrected twice — or a procedure you re-explained in three different sessions — is the definition of one. ## Where the data is - **Claude Code:** `~/.claude/projects/<project-hash>/<session-id>.jsonl` — one event per line; assistant turns carry `message.usage` token counts, tool-use events name the tool/skill invoked, user turns hold corrections. - **Codex:** `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` — lines are `{timestamp, type, payload}`; payload types include `user_message`, `message` (roles user/assistant/developer), `function_call` / `function_call_output`, `token_count`, `task_started` / `task_complete`. Both formats are undocumented and drift — tolerate unknown lines, never assume a fixed schema. Use python for the parsing, not shell one-liners. ## The loop 1. **Harvest** — walk both transcript trees, scoped by date (e.g. last 30 days). Note which agents you could actually see; coverage is uneven. 2. **Detect** skill-worthy moments (signals below). 3. **Cluster & rank** — group recurrences of the same failure across sessions; rank by `frequency × wasted tokens`. Two strong clusters beat twenty weak ones — propose few, high-signal candidates. 4. **Draft** — for ea