anti-hallucination
Skill35 starsChanged 8 months agoMITView on GitHub
ALWAYS activate this skill. Apply these rules to every task regardless of domain. This skill governs how Claude Code verifies information, writes code, references documentation, and avoids fabricating functions, arguments, APIs, file paths, data structures, or facts. These rules override any inclination to guess.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- fabioc-aloha/Alex_ACT_Editiontheir own version, first seen Oct 13, 2026
- eliabdevweb-svg/opencode-skills-MCPtheir own version, first seen Oct 9, 2026
- udsy19/.claudetheir own version, first seen Oct 5, 2026
- Quad4-Software/skillstheir own version, first seen Oct 3, 2026
- fabioc-aloha/alex-cognitive-architecturetheir own version, first seen Apr 26, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- Quad4-Software/skills★ 1same name
- eliabdevweb-svg/opencode-skills-MCP★ 0same name
- fabioc-aloha/Alex_ACT_Edition★ 0same name
- fabioc-aloha/alex-cognitive-architecture★ 0same name
- udsy19/.claude★ 0same 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 repository7 other files it gives its agents.
- econ-abstract-writingSkill
- academic-writingSkill
- code-walkthroughSkill
- econ-intro-writingSkill
- event-studySkill
- lit-review-tableSkill
- academic-paper-verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
41 rules. 0 are common, 29 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
29
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When you are less than ~90% confident that something exists, works the way you think it does, or is correct - stop and verify before …
- Distinctive: line 28
Before writing any code, read the relevant context first:
- Very specific: line 30
Existing project code: Read the files you'll modify or depend on.
- Very specific: line 33
Package documentation: If you're about to use a function and you're not completely certain of its arguments, check.
- Very specific: line 36
Data files: Before writing code that processes data, inspect the actual data first.
- Very specific: line 39
File structure: Run ls, find, or tree before referencing paths.
- Distinctive: line 40
Never assume a file or directory exists.
- Distinctive: line 48
After writing code, always execute it.
- Distinctive: line 54
If it errors, read the error carefully, fix the actual problem, run again
- Distinctive: line 56
Only then present the result
- Distinctive: line 60
Write a long script and run it all at once hoping for the best
- Distinctive: line 64
Read the full error message
- Very specific: line 66
Do not add suppressWarnings() or tryCatch() to hide problems
- Distinctive: line 67
Do not comment out the broken part and move on
- Very specific: line 75
If you're not sure a function exists in a package, check: Run ls("package:packagename") or ?function_name in R.
- Very specific: line 77
If you're not sure about an argument name, check: Run args(function_name) or formals(function_name) in R.
- Distinctive: line 79
If you're not sure about default values, check: Don't guess.
- Distinctive: line 80
If a function doesn't exist, say so: Don't invent a plausible alternative.
- Very specific: line 89
Before referencing any file, verify it exists: ls, file.exists(), find.
- Very specific: line 90
Before referencing any column in a dataset, verify it exists: names(df), colnames(df), str(df).
- Very specific: line 92
Before referencing any variable in the environment, verify it exists: ls(), exists("varname").
- Distinctive: line 94
Never fabricate sample data unless explicitly asked to create example data.
- Distinctive: line 95
Never assume the structure of a file you haven't read.
- Distinctive: line 101
Do not invent paper titles, author names, journal names, or years.
- Distinctive: line 102
Do not invent statistics, coefficients, p-values, or sample sizes.
- Distinctive: line 103
Do not invent URLs or documentation links.
- Distinctive: line 104
If you're citing a specific claim, either verify it or clearly state you're paraphrasing from memory and may be inaccurate.
- Distinctive: line 106
When summarizing results from code output, copy the actual numbers from the output.
- Distinctive: line 113
When you cannot verify something, say so clearly.
- Distinctive: line 131
After any sequence of operations (data cleaning pipeline, model estimation, file manipulation), verify the results make sense:
- Distinctive: line 134
Check dimensions: did the merge lose or duplicate rows?
- Distinctive: line 135
Check for NAs: did a join introduce missing values?
- Distinctive: line 136
Check magnitudes: are coefficients in a plausible range?
- Distinctive: line 137
Check output files: do they exist and contain what you expect?
- Very specific: line 151
Before using any package, check if it's installed: requireNamespace("pkg", quietly = TRUE)
- Distinctive: line 152
If a package needs installing, ask first or install explicitly - don't assume.
- Distinctive: line 153
After loading a package, verify the function you need exists before using it.
- Distinctive: line 180
When code fails or produces unexpected results:
- Distinctive: line 182
Read the FULL error message, not just the first line
- Very specific: line 183
Check the actual state of objects (str(), class(), dim())
- Distinctive: line 196
Before sharing output with the user, mentally verify:
“Common” is measured: kept by at least 6 in 10 of the 4 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 Protocol
This skill exists to prevent Claude from fabricating information. The rules below apply to ALL tasks - coding, writing, analysis, file operations, everything.
Core Principle
Never guess. Verify or say you don't know.
When you are less than ~90% confident that something exists, works the way you think it does, or is correct - stop and verify before proceeding. Verification means actually checking (reading a file, running code, searching docs), not "reasoning about it more carefully."
Rule 1: Read Before You Write
Before writing any code, read the relevant context first:
- Existing project code: Read the files you'll modify or depend on. Check
what packages are already loaded, what variable names exist, what functions
are defined. Use
cat,head,grep, or your file-reading tools. - Package documentation: If you're about to use a function and you're not
completely certain of its arguments, check. In R:
?function_nameorargs(function_name). In Python:help(function)orinspect.signature(). - Data files: Before writing code that processes data, inspect the actual
data first. Check column names, types, dimensions, sample values. In R:
str(),head(),names(),glimpse(). Never assume column names. - File structure: Run
ls,find, ortreebefore referencing paths. Never assume a file or directory exists.
The cost of reading first is small. The cost of hallucinating is large.
Rule 2: Run and Fix, Don't Just Generate
After writing code, always execute it. Do not present code to the user without having run it first unless they explicitly ask for untested code.
Workflow:
- Write code
- Run it
- If it errors, read the error carefully, fix the actual problem, run again
- Repeat until it works
- Only then present the result
Do NOT:
- Present code and say "this should work"
- Write a long script and run it all at once hoping for the best
- Silently skip execution
When fixing errors:
- Read the full error message
- Fix the root cause, not the symptom
- Do not add
suppressWarnings()ortryCatch()to hide problems - Do not comment out the broken part and move on
Rule 3: Never Invent Functions or Arguments
This is the most common hallucination pattern. Rules:
- If you're not sure a function exists in a package, check. Run
ls("package:packagename")or?function_namein R. - If you're not sure about an argument name, check. Run
args(function_name)orformals(function_name)in R. - If you're not sure about default values, check. Don't guess.
- If a function doesn't exist, say so. Don't invent a plausible alternative.
- Common trap: Mixing up arguments between similar functions (e.g., between
fixest::feols()andlfe::felm(), or betweenggplot2andbaseplotting). These are different. Check which one you're using.
Rule 4: Never Invent File Paths or Data
- Before referencing any file, verify it exists:
ls,file.exists(),find. - Before referencing any column in a dataset, verify it exists:
names(df),colnames(df),str(df). - Before referencing any variable in the environment, verify it exists:
ls(),exists("varname"). - Never fabricate sample data unless explicitly asked to create example data.
- Never assume the structure of a file you haven't read.
Rule 5: Never Fabricate Citations, Facts, or Numbers
- Do not invent paper titles, author names, journal names, or years.
- Do not invent statistics, coefficients, p-values, or sample sizes.
- Do not invent URLs or documentation links.
- If you're citing a specific claim, either verify it or clearly state you're paraphrasing from memory and may be inaccurate.
- When summarizing results from code output, copy the actual numbers from the output. Do not round or paraphrase unless asked.
Rule 6: State Uncertainty Explicitly
When you cannot verify something, say so clearly. Good phrases:
- "I'm not certain this function takes that argument - let me check."
- "I believe this package has that feature but I want to verify."
- "I don't know the answer to that. Let me look it up."
- "This is from memory and may not be accurate."
Bad patterns (never do these):
- Stating something confidently when you're guessing
- Giving a plausible-sounding but fabricated answer
- Saying "typically" or "usually" to hedge a guess while still presenting it as information
- Inventing a function that "should" exist based on naming conventions
Rule 7: Verify After Multi-Step Operations
After any sequence of operations (data cleaning pipeline, model estimation, file manipulation), verify the results make sense:
- Check dimensions: did the merge lose or duplicate rows?
- Check for NAs: did a join introduce missing values?
- Check magnitudes: are coefficients in a plausible range?
- Check output files: do they exist and contain what you expect?
In R, after merges/joins:
# ALWAYS check after merging
cat("Rows before:", nrow(df_before), "\n")
cat("Rows after:", nrow(df_merged), "\n")
cat("NAs introduced:", sum(is.na(df_merged$key_var)), "\n")Rule 8: Package Installation and Loading
- Before using any package, check if it's installed:
requireNamespace("pkg", quietly = TRUE) - If a package needs installing, ask first or install explicitly - don't assume.
- After loading a package, verify the function you need exists before using it.
- Be precise about which package a function comes from. Use
package::function()notation when there could be ambiguity.
Rule 9: Don't Confuse Similar Things
Common confusion patterns to watch for:
R-specific:
fixestvslfevsplm- different syntax, different argumentsdata.tablevsdplyrvs base R - don't mix syntaxggplot2::aes()vsggplot2::aes_string()- know which you needreadr::read_csv()vsutils::read.csv()- different defaultstibblevsdata.frame- different printing and subsetting behavior
General:
- File paths on different OS (/ vs )
- 0-indexed vs 1-indexed languages
- UTF-8 vs Latin-1 encoding issues
- Relative vs absolute paths
Rule 10: When Things Go Wrong, Diagnose Properly
When code fails or produces unexpected results:
- Read the FULL error message, not just the first line
- Check the actual state of objects (
str(),class(),dim()) - Identify which specific line caused the error
- Fix that specific issue
- Do NOT:
- Rewrite the entire script from scratch
- Add error suppression
- Guess at the fix without understanding the cause
- Make multiple unrelated changes at once
Checklist: Before Presenting ANY Result
Before sharing output with the user, mentally verify:
- All code was actually executed (not just written)
- All referenced files actually exist
- All function calls use real functions with correct arguments
- All data column references match actual column names
- Numbers reported match actual code output
- No invented citations or URLs
- Uncertainty is flagged where it exists
- Merge/join operations were verified for row count changes
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.

