counterfactual-audit

counterfactual-audit is a skill for Claude Code from jamestexas/agents. It costs 93 tokens per session (2,532 once invoked), scanned A, original, Apache-2.0.

A read-only review of whether a repository’s architecture still fits its needs. It uses evidence and several review passes to examine design choices, recurring bugs, and possible refactors.

In plain words
What is it for?
It is for assessing monolith-versus-split decisions, over- or under-engineering, recurring bug patterns, and proposed major refactors.
Why use it?
It helps distinguish a structural design problem from an isolated bug before committing to a large change.

Skill for Claude Code

Written for Claude Code: disallowed-tools in frontmatter. Also seen: mentions subagents.

Good fit It is for assessing monolith-versus-split decisions, over- or under-engineering, recurring bug patterns, and proposed major refactors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamestexas/agents/counterfactual-audit
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 jamestexas/agents --skill counterfactual-audit
Clone the repo
git clone --depth 1 https://github.com/jamestexas/agents

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 counterfactual-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamestexas/agents/counterfactual-audit/github.svg)](https://agentmods.dev/skills/jamestexas/agents/counterfactual-audit)
Your own site
<a href="https://agentmods.dev/skills/jamestexas/agents/counterfactual-audit"><img src="https://agentmods.dev/badge/skills/jamestexas/agents/counterfactual-audit/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 counterfactual-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamestexas/agents/counterfactual-audit"><img src="https://agentmods.dev/badge/skills/jamestexas/agents/counterfactual-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,532 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.00093 $0.02532
Opus 5.5 $0.00037 $0.01013
Sonnet 5.5 $0.00019 $0.00506
Haiku 4.5 $0.00009 $0.00253

Measured 2mo ago against content hash 7465efe736ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

counterfactual-audit 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.

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/counterfactual-audit/SKILL.md · 195 lines

How it starts

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

Counterfactual Architecture Audit

Six isolated evidence passes answer one question: given the capabilities and constraints genuinely required today, how would this system be designed now, and how does that differ from the current design? The audit does not validate a thesis — the requester's suspicion ("too broad", "needs a split") is deliberately withheld from every pass, and a correct outcome may be that the present design is right.

Provenance: distilled from a full run against rosary @ 52b3db7 (2026-08-31, archive ~/codebase-audits/agentic-research-rosary/52b3db7/) and an external meta-review of that run. Every rule below that looks paranoid exists because the naive version failed in that run.

Iron rules

  1. Durable evidence directory FIRST, before any pass is dispatched. ~/codebase-audits/<org>-<repo>/<commit>/ with manifest.json, numbered pass files, and commands/ for raw tool output. Session scratchpads get garbage-collected — in the reference run, all six packs were destroyed by tmp GC mid-session and survived only because they had been read into context. Passes write here directly.
  2. Read-only. No tracked-file edits, no issue/bead creation, no tool installs, no dependency changes during the audit. Findings are banked as issues after the final report (see Post-audit).
  3. Every material statement is tagged OBSERVED (code, tests, command output, history), INFERRED (best explanation of observations), or PROPOSED (a design choice — passes 5–6 only).
  4. Every major conclusion needs 2+ independent evidence classes, one code-level. Documentation never confirms itself. A prior session's memory note is a weaker class — label it and have a pass re-verify it in code before any recommendation leans on it.
  5. LOC and file size are sampling signals, never conclusions.
  6. Passes 1–3 are doc-blind: no README, docs/, ADRs, design notes, roadmaps, or glossary. They may read build/CI config needed to operate. Doc-blindness is what makes pass 4's doc-vs-code reconciliation evidence rather than circularity.

Read the full file on GitHub · 195 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. 2mo ago Changed · +1 lines 7465efe736ce
  2. 2mo ago First seen · 194 lines · 93 tokens per session scan A 1af10c63cc91

Subscribe to this mod's changes

counterfactual-audit is a skill published in the GitHub repository jamestexas/agents (2 stars, last pushed today), licensed Apache-2.0. It adds 93 tokens to every session and 2,532 once invoked, about $0.0004 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-09-05.

Related

counterfactual-audit compared with skills from other repositories

counterfactual-audit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
counterfactual-auditjamestexas/agentsSkill2todayApache-2.0A93Claude Code
code-reviewgithub/awesome-copilotSkill42ktodayMITA27Claude Code, Codex
discount-reviewpromptfoo/promptfooSkill28ktodayMITA18Claude Code, Codex
code-reviewpromptfoo/promptfooSkill28ktodayMITA11Claude Code
writing-qualityvercel/eveSkill6.1ktodayApache-2.0A69Claude Code, Codex
crit-storytomasz-tomczyk/critSkill1.4k3d agoMITA47Claude Code, Codex
mcp-server-reviewpnp/copilot-promptsSkill913yesterdayMITA93Claude Code, Codex