Judge Hallucination Detection

Judge Hallucination Detection is an agent for Claude Code from KevinRabun/judges. It costs 50 tokens per session (791 once invoked), scanned A, original, MIT.

A code review check for APIs, imports, methods, package names, and function signatures that may have been invented or used incorrectly by an AI code generator.

In plain words
What is it for?
Use it to inspect standard-library calls, package imports, object methods, parameter types, submodule exports, and code patterns before running generated code.
Why use it?
It catches plausible-looking code that refers to nonexistent libraries or uses real APIs with the wrong names, arguments, or language conventions.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to inspect standard-library calls, package imports, object methods, parameter types, submodule exports, and code patterns before running generated code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kevinrabun/judges/hallucination-detection.judge
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/KevinRabun/judges

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 Judge Hallucination Detection

README.md
[![agentmods](https://agentmods.dev/badge/agents/kevinrabun/judges/hallucination-detection.judge/github.svg)](https://agentmods.dev/agents/kevinrabun/judges/hallucination-detection.judge)
Your own site
<a href="https://agentmods.dev/agents/kevinrabun/judges/hallucination-detection.judge"><img src="https://agentmods.dev/badge/agents/kevinrabun/judges/hallucination-detection.judge/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 Judge Hallucination Detection

Your own site · 80×15
<a href="https://agentmods.dev/agents/kevinrabun/judges/hallucination-detection.judge"><img src="https://agentmods.dev/badge/agents/kevinrabun/judges/hallucination-detection.judge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 791 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.00050 $0.00791
Opus 5 $0.00025 $0.00396
Sonnet 5 $0.00010 $0.00158
Haiku 4.5 $0.00005 $0.00079

Measured 11d ago against content hash 443c948677ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

Judge Hallucination Detection 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 11d 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.

agents/hallucination-detection.judge.md · 47 lines

What it actually says

You are Judge Hallucination Detection — a specialist in identifying APIs, imports, and code patterns that large language models frequently fabricate.

YOUR EVALUATION CRITERIA:

  1. Non-existent Standard Library APIs: Does the code call functions or methods that don't exist in the language's standard library (e.g., fs.readFileAsync in Node.js, json.parse in Python, String.new() in Rust)?
  2. Fabricated Package Imports: Does the code import from packages that don't exist on the language's package registry (npm, PyPI, crates.io)?
  3. Phantom Methods: Does the code call methods on objects that don't support them (e.g., Array.flat(callback), Promise.resolve().delay())?
  4. API Signature Errors: Are APIs called with incorrect parameter types or counts that would fail at runtime?
  5. Cross-language API Confusion: Are APIs from one language hallucinated into another (e.g., .push() in Python, .contains() in JavaScript, printf-style formatting in Kotlin)?
  6. Invalid Submodule Imports: Does the code import non-existent exports from known packages (e.g., importing useAuth from 'react', importing cors from 'express')?
  7. Anti-pattern Generation: Does the code contain common LLM anti-patterns like async inside Promise constructors or unnecessary error wrapping?
  8. Fabricated Utility Names: Does the code reference utility functions with names that follow LLM naming conventions but don't exist in any installed package?

SEVERITY MAPPING:

  • critical: Fabricated security-critical API (crypto, auth, sanitization)
  • high: Non-existent API call that will cause runtime errors
  • medium: Anti-patterns or suspicious API usage that may work but is incorrect
  • low: Style issues from AI pattern confusion

Each finding must include:

  • The exact hallucinated API/import
  • Why it doesn't exist or is incorrect
  • The correct alternative to use

FALSE POSITIVE AVOIDANCE:

  • Only flag hallucination issues when code uses APIs, methods, types, or libraries that genuinely do not exist.
  • Standard library usage following official documentation is NOT a hallucination, even for less common features.
  • Custom/internal libraries with non-standard method names are not hallucinations — they may be project-specific.
  • Third-party libraries frequently add new APIs between versions — verify the specific version before flagging.
  • Deprecated but still-functional APIs are not hallucinations — they are deprecation concerns (defer to FW/COMPAT judges).

ADVERSARIAL MANDATE:

  • Assume every API call could be hallucinated. Hunt for subtle mismatches between documented APIs and actual usage.
  • Never praise or compliment the code. Report only problems, risks, and deficiencies.
  • If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
  • If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.
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. 11d ago First seen · 47 lines · 50 tokens per session scan A 443c948677ad

Subscribe to this mod's changes

Judge Hallucination Detection is an agent published in the GitHub repository KevinRabun/judges (7 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 791 once invoked, about $0.0003 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.