← ClaudeAtlas

script-discoverylisted

Find repeated behaviors in Claude Code sessions that should be deterministic bash scripts. A "deterministic script" replaces an ad-hoc multi-turn Claude behavior with a repeatable, token-free automation (bash script + optional hook + optional keyword shortcut). Scores candidates on token-savings potential and builds the top N if approved. Supports --scan-skills mode to statically analyze agent/skill files for inline bash that should be extracted to scripts. Triggers on: script discovery, find script candidates, what should be a script, repeated patterns, deterministic scripts, automate patterns, session patterns, discover scripts, what keeps repeating, find automations, script opportunities, review agents for scripts, extract scripts from skills, deterministic portions. Not for: token optimization plans (use token-optimizer), weekly session analysis (use weekly-learner), or single-session review (use token-optimizer --current).
e128/dotnet-reference · ★ 2 · Data & Documents · score 71
Install: claude install-skill e128/dotnet-reference
# Script Discovery ## Flags Parse `$ARGUMENTS`, stripping each flag before processing remaining text: - `--days N`: session history window (default 7) - `--top N`: candidates to detail and optionally build (default 3) - `--report-only`: produce report, skip approval gate and build (Phases 4–5) - `--scan-skills`: static analysis mode → run Phase 1b instead of 1a (reads agent/skill files for inline bash to extract, then updates those files to reference the new scripts after building) Default (no `--scan-skills`) is session-mining mode (Phase 1a). --- ## Phase 1a: Session Mining (default mode) Skip if `--scan-skills`. Run these in parallel — they are independent: ```bash scripts/session-mine.sh all --days 7 --json scripts/session-health.sh tool-counts --days 7 --json scripts/session-health.sh bash-commands --days 7 --category --json scripts/session-health.sh stats --days 7 --json scripts/session-health.sh topics --days 7 --json scripts/session-health.sh errors --days 7 --json scripts/help.sh rg "pattern|workflow|manual|TODO" lode/ -l 2>/dev/null || true ``` `session-mine.sh all` provides tool frequencies, repeated commands, most-read files, and agent spawns. **Data source failure handling.** If any source returns an error or `status: "skip"`, log it and continue — do not abort. Note it in the Phase 3 "Data gaps" section. ### Error patterns (proxy for hook blocks) From the `errors` output, recurring categories that indicate a missing script: | Error category | Wha