Agent skill

Correction Root-Cause Pipeline

by garrytan in garrytan/gbrain

Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction.

MITAuto-check passedAgent Workflows

Install Correction Root-Cause Pipeline

skills CLI
$ npx skills add garrytan/gbrain --skill correction-pipeline -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install garrytan/gbrain correction-pipeline --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/correction-pipeline .claude/skills/correction-pipeline && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
correction-pipeline
GitHub stars
31k
Token cost
~3.4k tokens
SKILL.md length
1,488 words
Files
2
Skills in repo
47
Repo updated
First seen
Licence
MIT

At a glance

Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction.

  • Works in 8 steps: Search the brain → Search memory files → Check SOUL.md and USER.md → …
  • The user points out that the agent stated a fact incorrectly
  • SKILL.md covers Trigger, Immediate Response, Root Cause Analysis (do THIS,… and Severity Tiers, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Any factual error the user identifies triggers this pipeline, with no exceptions and no just noting it for later. The agent first acknowledges the error plainly, quotes the specific wrong claim and states the correct fact as given, then runs root-cause steps in order and reports what it finds at each one.

It searches the brain with gbrain search and, for concept-shaped claims, gbrain query, and greps the brain repository's people, companies and concepts folders directly for the wrong terms; if the wrong fact is there, the brain is the contamination source and gets fixed. It then greps the harness's always-loaded memory files, and checks SOUL.md and USER.md for a misleading passage, noting that on gbrain installs those files are rendered from a bootstrap answer bank rather than edited directly, so the underlying answer must be fixed instead of the rendered file. A routing-eval.jsonl file is included for evaluating this routing behavior.

When your agent uses it

  • The user points out that the agent stated a fact incorrectly
  • Tracing a wrong claim back to a stale brain page or memory file
  • Fixing the root cause of a repeated factual mistake instead of only correcting it once

Example prompts

  • “You said I live in Austin, but I moved to Denver last year; find out where that wrong fact is coming from.”
  • “That company's founding date is wrong in your answer; trace it back to the source and fix it.”
  • “You keep getting my job title wrong, root-cause it this time.”

Requirements

  • The gbrain command line tool and its configured brain repository

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Search the brain
  2. Search memory files
  3. Check SOUL.md and USER.md
  4. Check the facts table
  5. Classify the error
  6. Fix the source
  7. Check for propagation
  8. Report to the user

What it can do on your machine

Read from SKILL.md and the folder at commit fc54831. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Correction Root-Cause Pipeline loads about 3.4k tokens when it runs. Until then it costs about 94 tokens; SKILL.md has 1,488 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from garrytan/gbrain at commit fc54831, republished under its MIT licence (© garrytan). 1,488 words, ~3,375 tokens.

Download SKILL.mdSave it as .claude/skills/correction-pipeline/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
correction-pipeline
description
When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER identity, bad facts row) or a hallucination (LLM confabulated from partial signals).
version
1.0.0
triggers
that's wrong, that's not true, I never said that, where did you get that, you got that wrong, correct that fact, root-cause this error
mutating
true
writes_pages
true
writes_to
people/, companies/, concepts/
upstream
correction-pipeline@fc834ee

Correction Pipeline

Convention: see conventions/brain-first.md — Step 1 of the root-cause chain IS the brain-first lookup chain (search for exact tokens, query for concept-shaped questions) before anything else.

Convention: see _brain-filing-rules.md — corrections edit pages in place; the page stays filed by primary subject.

Trigger

ANY factual error the user identifies. No exceptions. No "I'll note that."

(Routing here is a harness convention, not a mechanical guarantee — but once this skill is in play, the no-exceptions contract above is the discipline.)

Immediate Response

  1. Acknowledge the error. Don't defend. Don't explain. Just: "You're right. I got that wrong."
  2. Quote the specific wrong claim so the user can see you know exactly what was wrong.
  3. State the correct fact as the user gave it.

Root Cause Analysis (do THIS, not just a memory note)

Run these steps IN ORDER. Report findings to the user.

Step 1: Search the brain
bash
gbrain search "<relevant terms>" --limit 10

For concept-shaped or synonym-phrased claims, escalate to gbrain query "<question>" (LLM expansion recovers phrasings search misses). Also grep the brain repo checkout directly — resolve it once from config:

bash
BRAIN_DIR=$(gbrain config get sync.repo_path)
grep -ri "<wrong claim terms>" "$BRAIN_DIR/people/" "$BRAIN_DIR/companies/" "$BRAIN_DIR/concepts/" 2>/dev/null

Question: Is the wrong fact IN the brain? If yes → the brain is the contamination source. Fix the brain page (Step 6).

Step 2: Search memory files

Grep the harness's always-loaded memory files (e.g. the workspace MEMORY.md and any memory/*.md companions — the exact location depends on your harness):

bash
grep -ri "<wrong claim terms>" <memory files> 2>/dev/null

Question: Is the wrong fact in memory? If yes → memory is the contamination source. Fix the memory file.

Step 3: Check SOUL.md and USER.md
bash
grep -i "<relevant terms>" <workspace>/SOUL.md <workspace>/USER.md 2>/dev/null

Question: Is there a misleading passage that could have led to the wrong inference? SOUL.md and USER.md are in every context window — a vague or ambiguous line here propagates into every session.

Important: on gbrain installs these files are RENDERED from the bootstrap answer bank (state/interview.json). Note the finding here; the fix goes through the answer bank in Step 6, never through a direct edit.

Step 4: Check the facts table
bash
gbrain recall <entity-slug>            # facts about the subject, newest first
gbrain recall --grep "<claim terms>"   # substring filter when the entity is unclear

Is there a wrong fact with high confidence? Note its fact id.

Step 5: Classify the error
ClassificationDescriptionFix surface
BRAIN_ERRORWrong fact exists in a brain pageEdit the page in the brain repo, commit, re-sync
MEMORY_ERRORWrong fact exists in memory filesFix the memory file
SOUL_USER_ERRORMisleading passage in SOUL.md or USER.mdFix the ANSWER BANK, re-render — never the rendered file
FACTS_TABLE_ERRORWrong fact in the gbrain facts tablerecall → forget <fact-id> → remember the correction
HALLUCINATIONNo source — LLM confabulated from partial signalsName the contamination vector (what partial signals led to it), write a guard fact
STALE_DATAFact was once true but is no longerUpdate the source with current truth; supersede the stale fact
CROSS_CONTAMINATIONCorrect fact about person A attributed to person BFix attribution in the source — on BOTH entities
Step 6: Fix the source
  • BRAIN_ERROR: Edit the page file in the brain repo. Include [Source: user correction, YYYY-MM-DD] on the corrected line. Commit, then gbrain sync so the DB reflects the fix. (Editing the DB row without the repo file — or vice versa — leaves the two out of agreement until the next sync overwrites one of them.)
  • MEMORY_ERROR: Edit the memory file. Add a correction note with date.
  • SOUL_USER_ERROR: NEVER edit SOUL.md / USER.md directly — they are rendered files, and a hand edit is silently lost on the next render. Fix the underlying answer in the shared bootstrap answer bank, then re-render:
    bash
    gbrain bootstrap interview --set KEY "corrected value"   # verbatim, user's words
    gbrain bootstrap interview --show                        # read back
    gbrain bootstrap interview --status                      # get the confirm hash
    gbrain bootstrap interview --confirm <hash>
    gbrain bootstrap render --only SOUL.md --force           # repeat per affected file
    The full interview discipline (read-back ritual, verbatim answers, backup behavior) lives in skills/soul-audit/SKILL.md — route through it for anything beyond a single-key fix.
  • FACTS_TABLE_ERROR: Expire the wrong row and write the correction with provenance:
    bash
    gbrain recall <entity-slug>                                  # find the fact id
    gbrain forget <fact-id>                                      # expire the wrong fact
    gbrain remember "<correct fact>" \
      --provenance "user correction, YYYY-MM-DD" --entity <entity-slug>
  • HALLUCINATION: There is no source to fix. Identify the partial signal that seeded the confabulation, then write a guard so it can't reseed:
    bash
    gbrain remember "WRONG: <what was said>. RIGHT: <what is true>. Guard: <instruction to prevent recurrence>" \
      --provenance "user correction, YYYY-MM-DD (hallucination guard)" --entity <entity-slug>
  • STALE_DATA: Update the source page with current truth (BRAIN_ERROR flow), and supersede any stale facts rows (forget + remember with the current truth and fresh provenance).
  • CROSS_CONTAMINATION: Fix the attribution at the source, then check BOTH entities: person A's page and facts (does the fact now live where it belongs?) and person B's page and facts (is every trace of the misattribution gone?).
Step 7: Check for propagation

The wrong fact may have propagated into OTHER brain pages, synthesis output, or memory files.

bash
grep -ri "<wrong claim terms>" "$BRAIN_DIR" 2>/dev/null | grep -v ".git"
gbrain search "<wrong claim terms>" --limit 20

Fix ALL instances, not just the first one found. Re-sync after repo edits.

Step 8: Report to the user

Short report:

**Error:** [what was wrong]
**Root cause:** [BRAIN_ERROR | HALLUCINATION | etc.]
**Source:** [specific file/line or fact id, or "no source — confabulated from X"]
**Fixed:** [what was changed, where]
**Propagation:** [other files fixed, or "no propagation found"]

Severity Tiers

TierDescriptionAction
S1 — Identity errorWrong facts about the user's family, heritage, history, core identityFix immediately. These contaminate EVERYTHING — every synthesis, every book mirror, every conversation.
S2 — Entity errorWrong facts about a person, company, deal in the brainFix brain page, check propagation
S3 — Context errorWrong inference about the user's current state, feelings, situationGuard fact via remember. Usually hallucination.
S4 — Minor factualWrong date, wrong number, wrong detailFix source, no propagation check needed
Show full SKILL.md (689 more words)Show less

Recurring Error Patterns to Watch

PatternExampleGuard
Projecting therapeutic narratives"You've been avoiding the hard conversation with your cofounder" (no evidence)Check calendar/behavior data before making claims about the user's actions or state
Autocorrecting names to famous peopleA contact named alice-example Cho silently becomes the similarly-named celebrityThe user's people outrank world-famous people — resolve against people/ first
Confusing takes with factsDumping takes-table beliefs into factsTakes = other people's beliefs. Facts = the user's personal knowledge.
Enumerative claims from session context only"You've worked at two companies" — missing the one only recorded in the brainNEVER make enumerative claims ("all your X," "every Y," "the three times you Z") without searching the brain first. Session context is always incomplete.
Missing data in always-loaded filesA core fact lives only in a brain page, not in USER.md/MEMORY.md, so every session re-derives it wrongWhen a correction reveals a gap in an always-loaded file, ADD the missing data through the proper surface (answer bank for rendered files, direct edit for memory files) so it's in every future context window

Complement: the contradictions probe

This skill is REACTIVE — it fires when the user catches an error. The shipped contradictions probe is the PROACTIVE side of the same discipline: it finds intra-brain conflicts before the user does.

bash
gbrain eval suspected-contradictions   # run the probe
gbrain find-contradictions             # read the latest run's findings

If a correction reveals a class of conflict (e.g. two pages disagreeing about a date), run the probe afterward — the same contamination pattern may exist elsewhere in the brain.

Contract

This skill guarantees:

  • Every factual error gets root-caused, not just noted
  • Source fixes land at the REAL fix surface for the error class (page edit + commit + re-sync; forget/remember for facts rows; answer bank + re-render for SOUL/USER — never a direct edit to a rendered file)
  • Propagation is checked (whole-brain grep + gbrain search)
  • The user gets a clear report of what was wrong, why, and what was fixed
  • Routing matches the canonical triggers in the frontmatter
  • Privacy contract preserved: no real names, no fork-specific filesystem path literals, no upstream-fork references

Output Format

The skill's output is the Step 8 root-cause report delivered inline during the conversation, plus all source fixes applied (brain-repo edits committed and re-synced; facts rows expired/superseded; identity files re-rendered from the answer bank).

Dedup (sharp boundaries)

  • skills/maintain/SKILL.md — PROACTIVE brain health (stale pages, orphans, citations, doctor). This skill is REACTIVE: a specific user correction gets traced to its contamination source. If nobody said "that's wrong," it's maintain's territory.
  • The contradictions probe (gbrain eval suspected-contradictions / gbrain find-contradictions) — PROACTIVE intra-brain conflict detection. Complementary, not overlapping: the probe finds conflicts between two brain sources; this skill starts from a correction supplied by the user.
  • skills/soul-audit/SKILL.md — the full identity re-interview surface. This skill DELEGATES to it for SOUL_USER_ERROR fixes; it never re-implements the interview or render flow.
  • skills/citation-fixer/SKILL.md — citation FORMAT compliance. Correcting a claim's truth is this skill; fixing how a true claim is cited is citation-fixer.
  • frontmatter-guard (host-side) — structural page validation (YAML shape), not claim truth.

When it fails

Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:

  • forget <fact-id> / remember returns fact_not_found or fact_already_expired: re-run recall to get the current fact id; never forget by guessing an id.
  • A page fix returns revision_conflict: re-read the page, apply the correction to the current text, and save with the new revision.
  • write_pending (exit 10): the correction is accepted but not committed; poll gbrain write-request <request_id> before telling the user it is fixed.

Anti-Patterns

  • "Noted, I'll remember that." NO. Trace the source. Fix the source.
  • Fixing only memory without checking the brain. The brain is the persistent store. Memory gets flushed.
  • Editing SOUL.md / USER.md directly. They're rendered from the answer bank; the hand edit dies on the next render and the error comes back. Fix the answer, re-render.
  • Editing the brain-repo file without re-syncing (or the DB row without committing). The two stores drift and the next sync resurrects the error.
  • Fixing one instance without checking propagation. Wrong facts spread.
  • Blaming the hallucination without identifying the partial signal. Every hallucination has a seed — find it.
  • Defensive response. Never explain why you got it wrong before acknowledging it's wrong.

© garrytan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/correction-pipeline of garrytan/gbrain.

  • SKILL.md
  • routing-eval.jsonl

Open the folder on GitHubat commit fc54831

Compare with similar skills

Correction Root-Cause Pipeline next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Correction Root-Cause Pipeline compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Correction Root-Cause Pipeline this skillgarrytan/gbrain31k—~3.4kAutomated safety check: PassMIT
Vibe Reflect And Compoundash1794/vibe-engineering163—~864Automated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT
Compound Learning WriterEveryInc/compound-engineering-plugin25k—~2kAutomated safety check: PassMIT
Paseo Committeegetpaseo/paseo20k1 repos~496Automated safety check: PassCustom licence

Similar skills

  • Vibe Reflect And Compound

    ash1794/vibe-engineering

    Captures reusable knowledge after work is done — learnings from feedback or failures, resolved bugs (symptom, root cause, prevention), and recurring code patterns — into the project's persistent…

    163 GitHub stars~864 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Compound Learning Writer

    EveryInc/compound-engineering-plugin

    Records one solved and verified problem as a durable learning in the repository, but only when the reasoning is not already clear from the final code, tests or docs.

    25k GitHub stars~2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Paseo Committee

    getpaseo/paseo

    Forms a two-agent committee with contrasting profiles to analyze a stuck problem in parallel, reconcile their views and return a consensus plan without editing files.

    20k GitHub starsUsed in 1 repo~496 tokens
    Agent WorkflowsAuto-check passed
  • Compound Learnings Refresh

    EveryInc/compound-engineering-plugin

    Audits a repo's stored learnings against the current codebase, fixes stale, overlapping or superseded docs and reports on every document.

    25k GitHub stars~2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from garrytan/gbrain

All 47 skills in this repo
  • Searches and writes a company-wide knowledge brain through the gbrain CLI, so durable decisions and facts about people, projects and history stay findable beyond one session.

    31k GitHub stars~875 tokensUpdated today
    Auto-check passed
  • Idea Ingest

    garrytan/gbrain

    Ingest links, articles, tweets, and ideas into the brain. An agent skill from garrytan/gbrain.

    31k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Sends what your notes already know about a topic to Perplexity, so the cited web search reports only what is new, such as entity updates or deal changes.

    31k GitHub stars~2k tokensUpdated today
    Auto-check: notes
  • Schema Unify

    garrytan/gbrain

    Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler.

    31k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Skillpack Check

    garrytan/gbrain

    Run gbrain skillpack-check to produce an agent-readable JSON health report for the gbrain install.

    31k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Skillpack Harvest

    garrytan/gbrain

    Lift a proven skill from a host repo (e.g. An agent skill from garrytan/gbrain.

    31k GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Questions about Correction Root-Cause Pipeline

What does Correction Root-Cause Pipeline do?

Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction. Any factual error the user identifies triggers this pipeline, with no exceptions and no just noting it for later. The agent first acknowledges the error plainly, quotes the specific wrong claim and states the correct fact as given, then runs root-cause steps in order and reports what it finds at each one.

When should I use Correction Root-Cause Pipeline?

Correction Root-Cause Pipeline fits situations like: the user points out that the agent stated a fact incorrectly; tracing a wrong claim back to a stale brain page or memory file; fixing the root cause of a repeated factual mistake instead of only correcting it once.

How do I install Correction Root-Cause Pipeline in Claude Code?

Run `npx skills add garrytan/gbrain --skill correction-pipeline -a claude-code`. Or copy the skill folder (skills/correction-pipeline in garrytan/gbrain) into .claude/skills/correction-pipeline in your project. Claude Code loads it when a task matches its description.

How do I install Correction Root-Cause Pipeline in Codex?

Run `npx skills add garrytan/gbrain --skill correction-pipeline -a codex`. Or copy the skill folder (skills/correction-pipeline in garrytan/gbrain) into .agents/skills/correction-pipeline in your project. Codex loads it when a task matches its description.

Can I use Correction Root-Cause Pipeline in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add garrytan/gbrain --skill correction-pipeline -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/correction-pipeline, .gemini/skills/correction-pipeline, .github/skills/correction-pipeline and .opencode/skills/correction-pipeline in your project.

What does Correction Root-Cause Pipeline need to run?

SKILL.md names no scripts, command-line tools or credentials: Correction Root-Cause Pipeline is instructions for the agent only. Our summary lists: The gbrain command line tool and its configured brain repository.

Does Correction Root-Cause Pipeline access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Correction Root-Cause Pipeline safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Correction Root-Cause Pipeline use?

Correction Root-Cause Pipeline is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Correction Root-Cause Pipeline use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Correction Root-Cause Pipeline?

Skills that share tags, products or a category with Correction Root-Cause Pipeline: Vibe Reflect And Compound (ash1794/vibe-engineering, 163 stars), Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars), Beads Task Memory (gastownhall/beads, 28k stars) and Compound Learning Writer (EveryInc/compound-engineering-plugin, 25k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Correction Root-Cause Pipeline?

garrytan (a GitHub user) maintains it in garrytan/gbrain, which has 30,701 GitHub stars. The repository holds 47 skills in this directory. The repository was last updated on October 9, 2026.

Source: garrytan/gbrain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.