anti-hallucination
Skill0 starsChanged 8 months agoMITView on GitHub
Never invent APIs, file paths, line numbers, library functions, CLI flags, or framework features. Use whenever making a factual claim about code or external systems — verify before stating, cite the source.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Quad4-Software/skillstheir own version, first seen Oct 3, 2026
- dariia-m/my_claude_skillstheir own version, first seen Mar 12, 2026
- Aedelon/claude-code-blueprinttheir own version, first seen Mar 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Aedelon/claude-code-blueprint★ 120same name
- dariia-m/my_claude_skills★ 36same name
- Quad4-Software/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- hostile-self-reviewSkill
- memory-hygieneSkill
- session-closerSkill
- simplicity-firstSkill
- surgical-editsSkill
- think-before-codingSkill
- verifiable-criteriaSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
When stating a verified claim:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Anti-Hallucination
LLMs invent plausible-sounding APIs that do not exist, library functions that were removed two versions ago, CLI flags that match the convention but were never implemented, and file paths from a different project. The hallucination feels like knowledge — it is fluent, specific, and confident — but it is wrong, and the user will discover it the moment they try to run the code.
The rule
Never state a factual claim about code or external systems without verifying it in this session.
Verification means: you read the file, ran the command, fetched the docs, or grep'd the codebase. Not: "I remember seeing this," "this looks like it should work," or "the docs probably say."
What counts as a factual claim
- "There is a function
Xin moduleY." - "This file is at path
/foo/bar/baz.ts." - "Library version
2.5.0added support forX." - "The CLI flag is
--strict-mode." - "Line 47 of
main.pycallsprocess()." - "The endpoint accepts
POST /api/v2/users."
Each of these can be wrong. Each must be backed by a verification step in the current session.
How to verify
| Claim type | Verification |
| Function exists in this codebase | Grep for the function name |
| File exists at path | ls or Read the path |
| Library has feature X | Fetch official docs (use context7, web fetch, or read installed package source) |
| Line number / location | Read the file with -n and confirm |
| CLI flag exists | Run --help and read it |
| API endpoint exists | Read the route definitions, or curl it |
How to cite
When stating a verified claim:
- File reference:
[file.py:42](path/to/file.py#L42)— specific line. - Library claim: link to official docs or version-specific changelog.
- CLI claim: quote the
--helpoutput.
When you have NOT verified
Say so explicitly. Phrasings:
- "I have not verified this — the API typically takes X but check before relying on it."
- "Based on my training data (which may be outdated), this was at path Y."
- "This is a guess based on framework conventions, not a fact."
The user can act on a labeled guess. They cannot act safely on a confident hallucination.
When to fetch fresh docs
Use context7 (or equivalent doc-fetcher) BEFORE writing code that calls a library API, even one you know well. Library APIs change. Your training data is months or years stale. The cost of fetching is seconds; the cost of a hallucinated function call is a debugging session.
Especially fetch for:
- Recently updated libraries (anything 1.0+ in the last 12 months).
- Cloud SDKs (AWS, GCP, Stripe, Supabase — these change constantly).
- AI/ML libraries (
anthropic,openai,langchain— fast-moving). - Your own project's internal APIs — read the actual code, not a mental model of it.
Example
Bad:
Agent: "I'll use
redis.async_get(key, timeout=5)to fetch with a timeout." Function does not exist. Real API isawait redis.get(key)and timeouts are configured at the connection level.
Good:
Agent: fetches redis-py docs via context7 "The async API uses
await redis.get(key). Timeouts are set on the connection (Redis(socket_timeout=5)), not per-call. Adjusting the implementation."
The cost of getting this wrong
A hallucinated API call doesn't fail with a clear "this doesn't exist" error in many contexts — it gets caught by a generic exception handler, logs a confusing message, and silently returns garbage. The user trusts the code, ships it, and finds out in production. Hallucinations are the single most damaging class of LLM coding bug because they look correct.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

