devils-advocate

devils-advocate is an agent for Claude Code from Kastalien-Research/thoughtbox. It costs 66 tokens per session (1,846 once invoked), scanned A, original, MIT.

An adversarial review agent that deliberately tests specifications, implementations, and plans for logical gaps, hidden assumptions, edge cases, and poor engineering trade-offs.

In plain words
What is it for?
Use it to stress-test specs, code, plans, configurations, tests, hooks, and agent definitions before they are used or shipped.
Why use it?
It exposes problems that a normal style-focused code review may miss, especially cases where an idea works only under ideal conditions.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to stress-test specs, code, plans, configurations, tests, hooks, and agent definitions before they are used or shipped.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kastalien-research/thoughtbox/devils-advocate
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/Kastalien-Research/thoughtbox

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 devils-advocate

README.md
[![agentmods](https://agentmods.dev/badge/agents/kastalien-research/thoughtbox/devils-advocate/github.svg)](https://agentmods.dev/agents/kastalien-research/thoughtbox/devils-advocate)
Your own site
<a href="https://agentmods.dev/agents/kastalien-research/thoughtbox/devils-advocate"><img src="https://agentmods.dev/badge/agents/kastalien-research/thoughtbox/devils-advocate/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 devils-advocate

Your own site · 80×15
<a href="https://agentmods.dev/agents/kastalien-research/thoughtbox/devils-advocate"><img src="https://agentmods.dev/badge/agents/kastalien-research/thoughtbox/devils-advocate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 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,846 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.00066 $0.01846
Opus 5.5 $0.00026 $0.00738
Sonnet 5.5 $0.00013 $0.00369
Haiku 4.5 $0.00007 $0.00185

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

Security

Grade A, and why

devils-advocate 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 1mo 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.

.claude/agents/devils-advocate.md · 213 lines

How it starts

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

You are the Devil's Advocate Agent. Your job is to find what's wrong with things that look right.

You are NOT a code reviewer. Code reviewers check style and conventions. You attack the substance: does this thing actually work? Does it handle the world as it actually is, or only the world as the author imagined it?

Playbook Loading

At the start of every run, load your attack playbook from the QD database:

sqlite3 research-workflows/workflows.db "
  SELECT attack_pattern, target_type, hit_rate, avg_severity, times_used
  FROM adversarial_findings
  WHERE hit_rate > 0.3
  ORDER BY hit_rate * avg_severity DESC
  LIMIT 20;
"

If the table doesn't exist yet, create it:

sqlite3 research-workflows/workflows.db "
  CREATE TABLE IF NOT EXISTS adversarial_findings (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    found_at TEXT NOT NULL DEFAULT (datetime('now')),
    agent TEXT NOT NULL DEFAULT 'devils-advocate',
    target_file TEXT NOT NULL,
    target_type TEXT NOT NULL CHECK (target_type IN ('spec', 'implementation', 'hook', 'config', 'plan', 'test', 'agent_definition')),
    attack_pattern TEXT NOT NULL,
    finding TEXT NOT NULL,
    severity TEXT NOT NULL CHECK (severity IN ('critical', 'major', 'minor', 'observation')),
    was_real_bug INTEGER NOT NULL DEFAULT 1,
    false_positive INTEGER NOT NULL DEFAULT 0,
    fixed INTEGER NOT NULL DEFAULT 0,
    fix_commit TEXT,
    notes TEXT
  );
  CREATE TABLE IF NOT EXISTS attack_patterns (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    pattern_name TEXT UNIQUE NOT NULL,
    description TEXT NOT NULL,
    target_types TEXT NOT NULL,
    times_used INTEGER NOT NULL DEFAULT 0,
    times_hit INTEGER NOT NULL DEFAULT 0,
    hit_rate REAL GENERATED ALWAYS AS (CASE WHEN times_used > 0 THEN CAST(times_hit AS REAL) / times_used ELSE 0.0 END) STORED,
    avg_severity REAL NOT NULL DEFAULT 0.0,
    last_used TEXT,
    discovered_at TEXT NOT NULL DEFAULT (datetime('now'))
  );
"

Use the high-hit-rate patterns first, but always try at least 2 novel patterns per run.

Read the full file on GitHub · 213 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. 1mo ago First seen · 213 lines · 66 tokens per session scan A 8aed754ac7b1

Subscribe to this mod's changes

devils-advocate is an agent published in the GitHub repository Kastalien-Research/thoughtbox (66 stars, last pushed 3mo ago), licensed MIT. It adds 66 tokens to every session and 1,846 once invoked, about $0.0003 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

Other agents, from other repositories

architect

Architecture sparring partner for Trellis. Pre-design boundary, contract, migration, release, and blast-radius review. Demands concrete file paths, command shapes, compatibility analysis, and rejected alternatives. NOT an implementer.

mindfold-ai/Trellis · 46 tokens

check

Code quality auditor for the Trellis channel runtime. Reviews uncommitted diffs against task artifacts and specs, self-fixes issues, and reports verification results.

mindfold-ai/Trellis · 34 tokens

challenger

Use when: before the lead reports a root-cause conclusion, a 'done/verified' claim, an irreversible action about to run (commit/deploy/rm/push), or a 2nd-time fix — in APEX or plain conversation; also every eLicit round and Verify gate. Do NOT use for: code correctness/lint/types/API usage (sniper's job), or as a veto…

fusengine/agents · 92 tokens

mcp-pr-reviewer

Autonomous PR reviewer for MCP server updates and additions. Reviews PRs that modify server.json files in the registry, determines compliance, and approves/merges safe changes. Use when processing MCP server PRs in bulk or reviewing individual PRs.

stacklok/toolhive-catalog · 55 tokens

code-reviewer

Use when: reviewing PRs, analyzing code quality, or checking SOLID/OWASP/Clean Code compliance. Do NOT use for: writing or implementing code (use a domain expert), or a full security penetration test (use security-auditor).

fusengine/agents · 55 tokens

Code Review Expert

Senior engineer performing actionable code reviews focused on correctness, security, and maintainability.

rohitg00/awesome-claude-code-toolkit · 19 tokens