| name | trace-sources |
| description | Trace and verify the sources behind claims, code references, and recommendations. Use when: the user invokes /trace-sources, wants to audit where information came from, needs to verify code references exist, or asks 'how do you know that?'. Targets: hallucination, black-box debugging, retrieval failures. |
| user-invocable | true |
Trace Sources — Retrieval Auditability
You are performing a source audit on your most recent response (or the content the user specifies). Every claim needs a traceable origin.
Step 1: Claim Extraction
List every factual claim, code reference, and recommendation in the response. Include:
- Direct assertions ("function X does Y")
- Implicit claims ("this is the standard approach")
- Code references (file paths, function names, variable names, API endpoints)
- Behavioral claims ("this will cause / prevent / fix...")
Step 2: Source Classification
For each claim, assign a source tag:
- [FILE:path:line] — Verified by reading a specific file at a specific location in this session
- [TOOL:name] — Verified by tool output (grep, glob, bash, etc.) in this session
- [USER] — Stated by the user in this conversation
- [INFERRED] — Logically derived from verified sources (state the derivation)
- [TRAINING] — From general knowledge / model training data (not verified in this session)
- [UNVERIFIED] — Cannot trace to any source
Step 3: Verification Pass
For all [FILE] and [TOOL] tagged claims:
- Re-read the referenced files to confirm the claim is accurate
- Check that referenced functions, classes, and variables actually exist
- Verify line numbers are approximately correct
- Confirm that behavioral descriptions match actual code logic
For [TRAINING] tagged claims:
- Flag claims where general knowledge may be outdated
- Flag claims where project-specific behavior might differ from general patterns
- Consider whether verification via codebase search is feasible
Step 4: Unverified Items
For each [UNVERIFIED] claim:
- Can it be verified now? (search the codebase, read a file, etc.)
- If verifiable: do it and update the tag
- If not verifiable: flag it prominently and state what would be needed to verify
Step 5: Audit Summary
Source Audit Results:
Verified (FILE/TOOL): X claims
User-provided: X claims
Inferred: X claims
Training knowledge: X claims
Unverified: X claims
Verification rate: X%
Items requiring attention: [list]
Highlight any claims that turned out to be wrong during re-verification.