prior-analysis

A command that searches saved analyses of PolicyEngine policy changes. PolicyEngine is a tool for estimating how proposed tax and benefit rules affect people and government costs.

In plain words
What is it for?
Search by country, state, policy area, result, similarity, or archive file to review previous policy-analysis runs.
Why use it?
It helps you find earlier work before repeating an analysis or deciding which past results need to be checked after a policy change.

Command

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/policyengine/policyengine-claude/prior-analysis
Clone the repo
git clone --depth 1 https://github.com/PolicyEngine/policyengine-claude
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 565 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.00024 $0.00565
Opus 5 $0.00012 $0.00282
Sonnet 5 $0.00005 $0.00113
Haiku 4.5 $0.00002 $0.00056

Measured 2d ago against content hash fb859a1360b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prior-analysis 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 2d ago.

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.

commands/prior-analysis.md · 46 lines

How it starts

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

Prior analysis lookup

Search the analyses/ archive without invoking the full pipeline. Answers "have we already analyzed this?" and "what did we find?"

When to use

  • Before running /analyze-policy — check whether this reform has been scored recently. Datasets and models evolve, but if a near-identical analysis exists from days ago the archived numbers may be reusable.
  • After deploying a policy change to PE-US: find every archived analysis that touched the parameter family, so the team can flag which ones need re-running.
  • Exploring "what does PE think about SALT reforms?" as a research question.

Arguments

$ARGUMENTS — a natural-language query. The command parses it into filters for scripts/analyses_kb.py search.

Flags:

  • --country {us|uk|ca} — filter by jurisdiction
  • --state <code> — filter by US state / UK country
  • --family <tag> — filter by parameter-family tag (salt, ctc, eitc, cdcc, standard-deduction, etc.)
  • --verdict <verdict> — filter by verdict (PASS, PASS-WITH-NOTES, PASS-WITH-CORROBORATION, INVESTIGATE, structural, not-possible, deployed-model-lag, BLOCKED)
  • --similar-to <archive-file> — find analyses similar to an existing archive (jaccard over tags + jurisdiction)
  • --duplicates — surface near-duplicate archived runs

What this command does

Under the hood: python3 scripts/analyses_kb.py search|similar|duplicates with the parsed filter.

For each hit, surfaces:

  • Date, verdict, title
  • File path (relative to repo)
  • Headline numbers if the frontmatter has them (year-1 cost, 10-year cost, poverty change, Gini change)
  • Any GitHub issues opened by the analysis (issues_opened in frontmatter)

Output

Ranked list of matching archived analyses. For each, a link to the file + a one-line summary. If --duplicates, pairs with jaccard scores.

  • /analyze-policy — run a NEW analysis. This command is the "check first" step you should reflex to before running one.
  • scripts/analyses_kb.py — the underlying CLI. This command is a thin wrapper so it appears in the slash-command catalog.
  • analyses/README.md — canonical frontmatter schema.

Read the full file on GitHub · 46 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. 2d ago First seen · 46 lines · 24 tokens per session scan A fb859a1360b6

Subscribe to this mod's changes

prior-analysis is a command published in the GitHub repository PolicyEngine/policyengine-claude (31 stars, last pushed 8d ago), licensed MIT. It adds 24 tokens to every session and 565 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-30.