extract-pdf-features

A command that turns cached text from prospect-guide PDFs into structured JSON records for each player. It can process all cached guides or only filenames matching a filter.

In plain words
What is it for?
Use it to prepare per-player prospect data from PDF guides, including selected guides by filename or all available guides.
Why use it?
It removes the need to manually read each guide and copy player information into a consistent format.

Command for Claude Code

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.

agentmods
npx agentmods add commands/dachhack/stathead/extract-pdf-features
Clone the repo
git clone --depth 1 https://github.com/dachhack/stathead

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,680 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00019 $0.01680
Opus 5 $0.00010 $0.00840
Sonnet 5 $0.00004 $0.00336
Haiku 4.5 $0.00002 $0.00168

Measured yesterday against content hash 38bcdb239505, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

extract-pdf-features 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 yesterday.

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.

.claude/commands/extract-pdf-features.md · 110 lines

How it starts

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

You are running the prospect-guide feature extraction pipeline. This command processes PDF text caches written by scripts/extract_pdf_features.py and turns each guide into structured per-player JSON.

Optional filename filter

The invocation may include an argument string: $ARGUMENTS

  • If $ARGUMENTS is empty / whitespace, process every PDF as normal.
  • Otherwise treat it as a case-insensitive substring. Only process text caches whose stem (the filename without .text.txt) contains this substring. Skip everything else without touching their caches.

Examples: /extract-pdf-features rookie_scouting → only RSP guides. /extract-pdf-features 2025 → only 2025-dated PDFs. /extract-pdf-features → all of them.

Report to the user up-front: "Filter: (N of M PDFs match)" or "Filter: none (processing all N PDFs)".

Step 1: make sure text caches exist

Run python3 scripts/extract_pdf_features.py via Bash. It decrypts every PDF in pdfs/ and writes pdfs/.cache/*.text.txt. If it errors (missing deps, no PDFs, bad password), surface the error to the user and stop.

Step 1.5: load optional extraction context

If pdfs/.extraction-context.md exists and is non-empty, read it. Compute its short SHA-256 hash via Bash:

shasum -a 256 pdfs/.extraction-context.md | cut -c1-8

Hold onto two values for the rest of this run:

  • CONTEXT_TEXT: the file's contents (may be empty if the file doesn't exist)
  • CONTEXT_HASH: the 8-char hash, or the literal string nocontext if the file is missing/empty

The context lets the user inject domain-specific guidance (e.g. "Beast tiers go 1-5, not 1-3"; "treat 'Edge' positions as DL even if listed as LB") without editing this slash command. Including the hash in cache filenames (next step) ensures editing the file invalidates stale features.

Step 2: process each text cache

Use Glob to list pdfs/.cache/*.text.txt. For each text file:

  • Compute the corresponding features path: pdfs/.cache/<stem>.<CONTEXT_HASH>.features.json where <stem> is the filename without .text.txt and <CONTEXT_HASH> is from step 1.5.
  • If that features file already exists, skip this PDF (it's already been processed with the current context). Tell the user "skip : cached".
  • Otherwise:
    1. Read the text file in full (it may be large; chunk via the Read tool's offset/limit if needed).
    2. Extract every distinct NFL draft prospect that gets a real write-up, ranking, or tier — see schema below. If CONTEXT_TEXT is non-empty, treat its contents as additional rules that override or refine the schema rules below.
    3. Write the result as a JSON array (NOT wrapped in {"players": ...}) to pdfs/.cache/<stem>.<CONTEXT_HASH>.features.json using the Write tool.

Read the full file on GitHub · 110 lines

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. yesterday First seen · 110 lines · 19 tokens per session scan A 38bcdb239505

Subscribe to this mod's changes

extract-pdf-features is a command published in the GitHub repository dachhack/stathead (0 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 1,680 once invoked, about $0.0001 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-31.