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.5 $0.00024 $0.00771
Sonnet 5.5 $0.00012 $0.00385
Haiku 4.5 $0.00006 $0.00193

Measured 2mo ago against content hash 0db8e76e63ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 9mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,927 once invoked, about $0.0002 per session on Opus 5.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

specstory-yak compared with skills from other repositories

specstory-yak next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
specstory-yakspecstoryai/agent-skillsSkill359mo agoApache-2.0A61Claude Code, Codex
invest-backuplongsizhuo/openInvestSkill139yesterdayMITA202Claude Code
smart-rebasesd0xdev/sd0x-harnessSkill1941mo agoMITA133Claude Code
test-reviewsd0xdev/sd0x-harnessSkill1941mo agoMITA56Claude Code
debugsd0xdev/sd0x-harnessSkill1941mo agoMITA67Claude Code
recap-docsd0xdev/sd0x-harnessSkill1941mo agoMITA114Claude Code
runbooksd0xdev/sd0x-harnessSkill1941mo agoMITA59Claude Code