specstory-yak

specstory-yak is a skill for Claude Code, Codex from specstoryai/agent-skills. It costs 61 tokens per session (1,927 once invoked), scanned A, original, Apache-2.0.

A tool that analyses SpecStory records of AI coding sessions to detect yak shaving: starting with one goal and getting pulled into a chain of unrelated setup tasks. It tracks changes in files, tools, and goals and gives sessions a focus score from 0 to 100.

In plain words
What is it for?
It is for analysing recent or dated sessions, finding the biggest rabbit holes, and reviewing the sessions with the highest yak-shaving scores.
Why use it?
It shows when a coding session drifted away from its original purpose and highlights recurring distraction patterns. This can help identify where time was spent on side issues.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for analysing recent or dated sessions, finding the biggest rabbit holes, and reviewing the sessions with the highest yak-shaving scores.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/specstoryai/agent-skills/specstory-yak
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add specstoryai/agent-skills --skill specstory-yak
Clone the repo
git clone --depth 1 https://github.com/specstoryai/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for specstory-yak

README.md
[![agentmods](https://agentmods.dev/badge/skills/specstoryai/agent-skills/specstory-yak/github.svg)](https://agentmods.dev/skills/specstoryai/agent-skills/specstory-yak)
Your own site
<a href="https://agentmods.dev/skills/specstoryai/agent-skills/specstory-yak"><img src="https://agentmods.dev/badge/skills/specstoryai/agent-skills/specstory-yak/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for specstory-yak

Your own site · 80×15
<a href="https://agentmods.dev/skills/specstoryai/agent-skills/specstory-yak"><img src="https://agentmods.dev/badge/skills/specstoryai/agent-skills/specstory-yak.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,927 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00061 $0.01927
Opus 5 $0.00030 $0.00963
Sonnet 5 $0.00012 $0.00385
Haiku 4.5 $0.00006 $0.00193

Measured 12d ago against content hash 0db8e76e63ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

specstory-yak scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/analyze.py, scripts/lib/__init__.py, scripts/lib/models.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/specstory-yak/SKILL.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Specstory Yak Shave Analyzer

Analyzes your .specstory/history to detect when coding sessions drifted off track from their original goal. Produces a "yak shave score" for each session.

How It Works

  1. Parses specstory history files from a date range (or all recent sessions)
  2. Extracts the initial user intent from the first message
  3. Tracks domain shifts: file references, tool call patterns, goal changes
  4. Scores each session from 0 (laser focused) to 100 (maximum yak shave)
  5. Summarizes your worst offenders and patterns

What Is Yak Shaving?

"I need to deploy my app, but first I need to fix CI, but first I need to update Node, but first I need to fix my shell config..."

Yak shaving is when you start with Goal A but end up deep in unrelated Task Z. This skill detects that pattern in your AI coding sessions.

Usage

Slash Command

When invoked via /specstory-yak, interpret the user's natural language:

User says Script args
/specstory-yak --days 7 (default)
/specstory-yak last 30 days --days 30
/specstory-yak this week --days 7
/specstory-yak top 10 --top 10
/specstory-yak january --from 2026-01-01 --to 2026-01-31
/specstory-yak from jan 15 to jan 20 --from 2026-01-15 --to 2026-01-20
/specstory-yak by modification time --by-mtime
/specstory-yak last 14 days as json --days 14 --json
/specstory-yak save to yak-report.md -o yak-report.md
/specstory-yak last 90 days output to report --days 90 -o report.md

Direct Script Usage

python /path/to/skills/specstory-yak/scripts/analyze.py [options]

Arguments:

  • --days N - Analyze last N days (default: 7)
  • --from DATE - Start date (YYYY-MM-DD)
  • --to DATE - End date (YYYY-MM-DD)
  • --path PATH - Path to .specstory/history (auto-detects if not specified)
  • --top N - Show top N worst yak shaves (default: 5)
  • --json - Output as JSON
  • --verbose - Show detailed analysis
  • --by-mtime - Filter by file modification time instead of filename date
  • -o, --output FILE - Write report to file (auto-adds .md or .json extension)

Read the full file on GitHub · 197 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 197 lines · 61 tokens per session scan A 0db8e76e63ac

Subscribe to this mod's changes

specstory-yak is a skill published in the GitHub repository specstoryai/agent-skills (35 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,927 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

codex-setup

Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.

sd0xdev/sd0x-harness · 65 tokens

smart-rebase

Smart partial rebase for squash-merge repositories. Auto-detect which commits to keep/drop when base branch was squash-merged into target. Use when: user says 'rebase', 'partial rebase', 'base already merged', 'smart rebase', or /smart-rebase. Not for: simple git rebase (the developer runs it — Claude never executes…

sd0xdev/sd0x-harness · 131 tokens

recap-doc

Post-development recap document generator. Use when: AI/Codex has implemented a feature and the user needs a guided walkthrough of what changed and why, with blind-spot detection and anticipated questions. Not for: Q&A follow-up (use /recap-ask), technical share-out for teammates (use /tech-brief), or generic code…

sd0xdev/sd0x-harness · 114 tokens

test-review

Test coverage review via Codex exec. Use when: reviewing test sufficiency, identifying coverage gaps, test quality audit. Not for: generating tests (use codex-test-gen), code review (use codex-code-review). Output: coverage analysis + gap report.

sd0xdev/sd0x-harness · 56 tokens

debug

Interactive debugging workflow with hypothesis-driven probe loop. Use when: unknown bugs, script errors, silent failures, troubleshooting. Not for: known bugs (use bug-fix), GitHub issue analysis (use issue-analyze), code understanding (use code-explore). Output: debug report with probe journal + root cause + fix.

sd0xdev/sd0x-harness · 67 tokens

runbook

Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).

sd0xdev/sd0x-harness · 59 tokens