hallucination-guard

hallucination-guard is a skill for Claude Code from Rune-kit/rune. It costs 76 tokens per session (2,253 once invoked), scanned A, original, MIT.

A validation tool that checks whether imports, packages, functions, and API calls introduced by generated code actually exist. It also checks for package names that may have been invented by an AI system or registered maliciously.

In plain words
What is it for?
Use it after generating or reviewing code, especially when new imports or external API calls are added, to verify that those references are real before completion.
Why use it?
It catches code that looks plausible but would fail because it references missing packages, functions, or incorrect API signatures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it after generating or reviewing code, especially when new imports or external API calls are added, to verify that those references are real before completion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rune-kit/rune/hallucination-guard
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 Rune-kit/rune --skill hallucination-guard
Clone the repo
git clone --depth 1 https://github.com/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 agents, 6 hooks.

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 hallucination-guard

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/rune-kit/rune/hallucination-guard"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/hallucination-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,253 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.00076 $0.02253
Opus 5.5 $0.00030 $0.00901
Sonnet 5.5 $0.00015 $0.00451
Haiku 4.5 $0.00008 $0.00225

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

Security

Grade A, and why

hallucination-guard 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 8d 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/hallucination-guard/SKILL.md · 222 lines

How it starts

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

hallucination-guard

Purpose

Post-generation validation that verifies AI-generated code references actually exist. Catches the 42% of AI code that contains hallucinated imports, non-existent packages, phantom functions, and incorrect API signatures. Also defends against "slopsquatting" — where attackers register package names that AI commonly hallucinates.

Triggers

  • Called by cook after code generation, before commit
  • Called by fix after applying fixes
  • Called by preflight as import verification sub-check
  • Called by review during code review
  • Auto-trigger: when new import statements are added to codebase

Calls (outbound)

Exception: L3→L3 coordination

  • research (L3): verify package existence on npm/pypi

Called By (inbound)

  • cook (L1): after code generation, before commit
  • fix (L2): after applying fixes
  • preflight (L2): import verification sub-check
  • review (L2): during code review
  • db (L2): verify SQL syntax and ORM method calls are real
  • review-intake (L2): verify imports in code submitted for review
  • skill-forge (L2): verify imports in newly generated skill code
  • adversary (L2): verify APIs/packages in plan actually exist
  • logic-guardian (L2): verify referenced functions and imports after guarded logic edits

Execution

Step 1 — Extract imports

Use Grep to find all import/require/use statements in changed files:

Grep pattern: ^(import|require|use|from)\s
Files: changed files passed as input
Output mode: content

Collect every imported module name and file path. Separate into:

  • Internal imports (start with ./, ../, @/, ~/)
  • External packages (bare module names)

Step 2 — Verify internal imports

For each internal import path, use Glob to confirm the file exists in the codebase.

Glob pattern: <resolved import path>.*   (try .ts, .tsx, .js, .jsx, .py, .rs etc.)

If Glob returns no results → mark as BLOCK (file does not exist).

Also use Grep to verify that the specific exported name (function/class/const) exists in the resolved file:

Read the full file on GitHub · 222 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. 8d ago First seen · 222 lines · 76 tokens per session scan A bd42f07dced6

Subscribe to this mod's changes

hallucination-guard is a skill published in the GitHub repository Rune-kit/rune (96 stars, last pushed 2d ago), licensed MIT. It adds 76 tokens to every session and 2,253 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-11-22.

Related

hallucination-guard compared with skills from other repositories

hallucination-guard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hallucination-guardRune-kit/runeSkill962d agoMITA76Claude Code
criticism-self-criticismHughYau/qiushi-skillSkill4.0k2d agoMITA197Claude Code
fix-pr-review-looprichkuo/rk-skillsSkill50todayMITA90Claude Code
validate-issuerichkuo/rk-skillsSkill50todayMITA55Claude Code
fable-validate-looprichkuo/rk-skillsSkill50todayMITA102Claude Code
refactorsmallnest/goal-workflowSkill3032mo agoMITA71Claude Code
walkthroughsmallnest/goal-workflowSkill3032mo agoMITA131Claude Code