Context grounding
Skill a-ariff/ariff-claude-plugins/plugins/context-grounding/skills/context-grounding
65 plugins that turn Claude Code into an autonomous development team. 24 agents, 34 skills, 5 hooks. Includes 12-plugin anti-hallucination suite. One-line install.
npx -y skills add a-ariff/ariff-claude-plugins --skill context-groundingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Forces Claude to extract exact quotes from files before making claims about them. Prevents hallucinations by grounding every statement in actual text from the codebase. Use when working with large files or unfamiliar code.
SKILL.md
2.2 KB, as published. Nobody here has run it
Context Grounding
Read first. Quote second. Claim third. Never skip a step.
The grounding technique
Before making any claim about code, follow this sequence:
Step 1: Read the source
Read the actual file. Don't work from memory.
Step 2: Extract the relevant quote
Pull the exact text that supports your claim. Include line numbers.
Step 3: Make your claim based on the quote
Now state what you believe, citing the quote as evidence.
Example
Wrong approach: "The auth middleware checks for JWT tokens and returns 401 if invalid." (No evidence. Could be hallucinated.)
Grounded approach: "Reading src/middleware/auth.ts:15-25, the middleware does:
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token provided' });
So it extracts the Bearer token from the Authorization header and returns 401 if missing."
When to ground
Always ground when:
- Answering questions about specific code behavior
- Writing code reviews or change proposals
- Explaining how something works
- Describing bug causes
- Making security assessments
Grounding for long documents
For files over 100 lines:
- Read the full file first to understand structure
- Identify the specific section relevant to the question
- Re-read that section carefully
- Extract the key lines as quotes
- Build your answer from those quotes
For files over 500 lines:
- Use Grep to find the relevant section
- Read just that section (use offset and limit)
- Extract quotes from what you read
- If you need more context, read surrounding sections
- Never make claims about sections you haven't read
The grounding test
Before sending a response, test each factual statement: "Could someone verify this by reading the file I'm referencing?"
If yes: the statement is grounded. If no: you need to add the file reference and relevant quote. If you don't have a file to reference: either find one or mark as unverified.