analyze-policy

analyze-policy is a command for Claude Code from PolicyEngine/policyengine-claude. It costs 0 tokens per session (6,750 once invoked), scanned A, original, MIT.

A workflow for analysing a proposed tax or benefit policy with PolicyEngine's microsimulation model, which estimates effects across many households.

In plain words
What is it for?
It accepts a bill, URL, or plain-language reform description, then classifies it, finds prior results, runs a one-year or ten-year simulation, and diagnoses mismatches.
Why use it?
It helps determine whether a reform can be modelled, estimate its impact, compare the result with earlier published runs, and investigate differences.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: positional $N argument.

Good fit It accepts a bill, URL, or plain-language reform description, then classifies it, finds prior results, runs a one-year or ten-year simulation, and diagnoses mismatches.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/policyengine/policyengine-claude/analyze-policy
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.

Clone the repo
git clone --depth 1 https://github.com/PolicyEngine/policyengine-claude

Made for: Claude Code.

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 analyze-policy

README.md
[![agentmods](https://agentmods.dev/badge/commands/policyengine/policyengine-claude/analyze-policy/github.svg)](https://agentmods.dev/commands/policyengine/policyengine-claude/analyze-policy)
Your own site
<a href="https://agentmods.dev/commands/policyengine/policyengine-claude/analyze-policy"><img src="https://agentmods.dev/badge/commands/policyengine/policyengine-claude/analyze-policy/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 analyze-policy

Your own site · 80×15
<a href="https://agentmods.dev/commands/policyengine/policyengine-claude/analyze-policy"><img src="https://agentmods.dev/badge/commands/policyengine/policyengine-claude/analyze-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,750 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.00000 $0.06750
Opus 5.5 $0.00000 $0.02700
Sonnet 5.5 $0.00000 $0.01350
Haiku 4.5 $0.00000 $0.00675

Measured 18d ago against content hash 1aeefac89c0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

analyze-policy 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 18d 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/analyze-policy.md · 549 lines

How it starts

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

Analyze Policy

End-to-end policy analysis pipeline. Takes a reform (bill number, URL, or description), classifies whether it's modelable, finds prior PE scores, runs the microsim, compares to priors, and — if the run mismatches — diagnoses which calibration target is likely driving the gap.

The structured analogue of /encode-policy-v2 for the analyst persona: less about implementing new programs, more about running impact analysis on a proposed reform and validating it against PolicyEngine's published baseline.

Arguments

  • $ARGUMENTS — One of:
    • State + bill number: UT SB60, RI H7127
    • Federal bill: US HR1234 or US S5678
    • URL: a direct bill/proposal/order URL
    • Description: natural-language reform ("ARPA-style federal CTC expansion: $3,600/$3,000, full refundability")

Flags:

  • --country {us|uk|ca} (default us)
  • --horizon <spec> — time horizon for the microsim. When omitted, the pipeline prompts the analyst at the start of Phase 4. Accepts:
    • 1 — single-year (default entry: current year), fastest, one API call. Uses /economy/{policy}/over/{baseline}?time_period=YYYY.
    • 10 — full 10-year (2026-2035 for the US; a UK window ends by 2032, the last year /uk/metadata lists). Uses the native /economy/{policy}/over/{baseline}/budget-window?start_year=YYYY&window_size=N endpoint, and microsim-runner falls back to single-year calls if the batch fails or keeps computing past 45 minutes.
    • custom:YYYY[,YYYY...] — specific years (e.g. custom:2026,2029,2030,2035) — submitted as N single-year calls.
    • custom:YYYY-YYYY — year range (e.g. custom:2026-2028) — mapped to budget-window with start_year+window_size.
  • --year YYYY (only used with --horizon 1; default current year)
  • --mode {api|local} (default api for microsim execution)
  • --dataset <name>: run on a named dataset from policyengine.py's bundle, such as populace_us_2024_acs_local or enhanced_frs_2024_25. The API selects data by region and takes no dataset override, so microsim-runner takes the local path for any explicitly named dataset whatever --mode says. Omit the flag to let the API select the region's data.
  • --skip-microsim (process-test mode — stops at Stage 5, predicts from prior anchor)
  • --auto-investigate (if Stage 5 returns INVESTIGATE, auto-run top calibration hypothesis)
  • --write-report PATH (default /tmp/analyze-policy-{policy_id}.md)
  • --log-to <dest>[,<dest>...] (override auto-routing; see Phase 8). Examples: --log-to archive, --log-to "archive,issue:microcosm", --log-to draft:policyengine-app-v2/app/src/data/posts/articles/arpa-ctc.md. Without it, report-logger files US and UK data issues in PolicyEngine/microcosm, or a UK run's in PolicyEngine/policyengine-uk-data when the run named an Enhanced FRS or FRS file.
  • --no-log (skip Phase 8 entirely — write the /tmp report only)
  • --auto-confirm (skip confirmation prompts before opening GitHub issues; only honor in non-interactive contexts)

Read the full file on GitHub · 549 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. 18d ago Changed 1aeefac89c0c
  2. 20d ago Changed · +5 lines f87129b2e975
  3. 25d ago Changed 918ccd181a19
  4. 3mo ago First seen · 544 lines · 0 tokens per session scan A 90b571fd7070

Subscribe to this mod's changes

analyze-policy is a command published in the GitHub repository PolicyEngine/policyengine-claude (31 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,750 tokens. 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

analyze-policy compared with commands from other repositories

analyze-policy next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
analyze-policyPolicyEngine/policyengine-claudeCommand31yesterdayMITA0Claude Code
checklistgithub/spec-kitCommand153ktodayMITA13Claude Code
clarifygithub/spec-kitCommand153ktodayMITA27Claude Code
specifygithub/spec-kitCommand153ktodayMITA13Claude Code
analyzegithub/spec-kitCommand153ktodayMITA26Claude Code
convergegithub/spec-kitCommand153ktodayMITA35Claude Code
implementgithub/spec-kitCommand153ktodayMITA14Claude Code