Agent skill

Log Correction

by ai-analyst-lab in ai-analyst-lab/ai-analyst

Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error.

MITAuto-check passed

Install Log Correction

skills CLI
$ npx skills add ai-analyst-lab/ai-analyst --skill log-correction -a claude-code

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

GitHub CLI
$ gh skill install ai-analyst-lab/ai-analyst log-correction --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/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/log-correction .claude/skills/log-correction && 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
log-correction
GitHub stars
304
Token cost
~2.2k tokens
SKILL.md length
1,085 words
Files
1
Skills in repo
43
Repo updated
First seen
Licence
MIT

At a glance

Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error.

  • Works in 5 steps: Gather Details → Categorize → Write the Correction → …
  • Corrects work (actually its Y
  • SKILL.md covers Purpose, When to Use, Auto Mode and Manual Mode Instructions, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Log Correction is an agent skill from ai-analyst-lab/ai-analyst. Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error. Fires automatically when the user corrects work ("actually it's Y", "that's wrong") or teaches a rule ("always use X", "never include test users", "remember that our fiscal year starts in February"), and manually on "log a correction", "save this mistake", "record this lesson". Writes the .knowledge store per docs/KNOWLEDGE.md.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: AI Product Analyst — Claude Code-powered data analysis toolkit. The licence is MIT.

When your agent uses it

  • Corrects work (actually its Y
  • Teaches a rule (always use X
  • Never include test users
  • Remember that our fiscal year starts in February)

Example prompts

  • “actually it”
  • “s wrong”
  • “always use X”
  • “/log-correction”

Workflow steps

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

  1. Gather Details
  2. Categorize
  3. Write the Correction
  4. Update Index
  5. Confirm

What it can do on your machine

Read from SKILL.md and the folder at commit 52c0744. 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 yaml).

    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

Log Correction loads about 2.2k tokens when it runs. Until then it costs about 110 tokens; SKILL.md has 1,085 words of instructions outside code blocks.

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

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 ai-analyst-lab/ai-analyst at commit 52c0744, republished under its MIT licence (© ai-analyst-lab). 1,085 words, ~2,227 tokens.

Download SKILL.mdSave it as .claude/skills/log-correction/SKILL.md (or your agent's skills folder).
name
log-correction
description
Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error. Fires automatically when the user corrects work ("actually it's Y", "that's wrong") or teaches a rule ("always use X", "never include test users", "remember that our fiscal year starts in February"), and manually on "log a correction", "save this mistake", "record this lesson". Writes the .knowledge store per docs/KNOWLEDGE.md.

Skill: Log Correction

Purpose

Record analyst mistakes, their fixes, and reusable learnings so future analyses learn from past errors. Runs in two modes against the same store (defined in docs/KNOWLEDGE.md): auto mode detects corrections and learnings in the user's messages without being asked, and manual mode handles explicit "log a correction" requests with full detail.

When to Use

  • Auto: the user corrects your work ("that's wrong", "actually it's...", "you used the wrong column") or teaches a reusable rule ("always use X", "never do Y", "remember that our fiscal year starts in February") without asking you to log anything
  • Manual: user says "log a correction", "save this mistake", "record this lesson", or similar
  • After discovering and fixing an error mid-analysis worth preserving

Auto Mode

Watch every user message for these signals. When one fires, capture it immediately; the user never has to ask.

Correction signals (something you produced was wrong):

  • "that's wrong", "that's incorrect", "actually it's...", "it should be..."
  • "the column is X not Y", "you used the wrong...", "off by...", "double-counted", "that join is wrong", "missing a filter", "forgot to exclude..."

Learning signals (a reusable methodology or fact):

  • "always use...", "never use...", "next time...", "prefer X over Y"
  • "remember that...", "the convention here is...", "our team uses...", "going forward...", "don't forget to..."

If both match, treat it as a correction. If neither matches, do nothing and say nothing about it.

On a correction signal: run Steps 1-5 below, but never interrogate the user. Infer severity, category, dataset, and tables from context; leave fields you cannot infer as null. Acknowledge in one line ("Got it, logged as CORR-008.") and then immediately continue with the user's underlying request; logging is never the whole response.

On a learning signal: append a bullet to .knowledge/learnings/index.md under the closest category heading (Data Patterns, Query Techniques, Business Context, Stakeholder Preferences, Visualization Insights, Methodology Notes), formatted - {concise learning} (source: user feedback, {YYYY-MM-DD}). Acknowledge in one line ("Noted for future analyses.") and continue with the user's request.

Auto-mode rules:

  1. Silent operation: no execution reports, no "I detected a correction signal", no file-path listings. One brief acknowledgment line, then the analysis.
  2. Never ask "should I log this?" Classify and log.
  3. Never block: if a read or write fails, skip capture and answer the user's question as if nothing happened. Do not retry or announce the failure.
  4. Never fabricate detail; use null for anything not stated by the user.

Manual Mode Instructions

Step 1: Gather Details

Extract from conversation context or ask the user:

  1. What was wrong? — One-sentence description of the error
  2. What is the correct answer? — The fix or corrected approach
  3. Which dataset/tables? — Dataset name and affected table(s)
  4. How severe? — critical (wrong numbers shared) | high (changes conclusions) | medium (directionally correct) | low (no impact)
  5. SQL before/after? — If the error involved a query, capture both versions

If any required field is unclear, ask the user. Do not guess severity.

Step 2: Categorize

IMPORTANT: Assign exactly ONE category from the following list. These are the only valid categories — do not create custom categories.

CategoryDescriptionExamples
sqlWrong query — bad join, missing filter, incorrect aggregation, wrong GROUP BY, missing WHERE clauseINNER JOIN instead of LEFT JOIN; forgot WHERE clause to filter test users; COUNT(*) instead of COUNT(DISTINCT); aggregation before filtering
metricWrong metric definition — numerator/denominator error, wrong time window, wrong columnUsed revenue_usd instead of order_total_usd for GMV; calculated DAU as total events instead of distinct users; wrong date range for YoY comparison
schemaWrong column or table reference — stale schema, misnamed field, wrong tableReferenced old_column_name after schema migration; queried staging.users instead of prod.users; assumed column existed but it doesn't
logicFlawed reasoning — Simpson's paradox missed, survivorship bias, wrong comparisonCompared current users to all-time users (survivorship bias); aggregated across segments hiding a reversal; compared apples to oranges
otherAnything that does not fit the aboveData interpretation error, visualization mistake, wrong stakeholder audience

If the user mentions a category not in this list (e.g., "filter_missing", "metric_definition"), map it to the closest match from the allowed categories above and confirm with the user.

Show full SKILL.md (403 more words)Show less
Step 3: Write the Correction
  1. Read .knowledge/corrections/index.yaml (treat a missing or corrupt file per Rule 3: recreate from scratch)
  2. Derive next ID: if last_correction_id is null, use CORR-001; otherwise parse the numeric suffix, increment, and zero-pad to 3 digits
  3. Build the entry in exactly this format:
yaml
- id: "CORR-{N}"
  date: "{YYYY-MM-DD}"
  severity: "{severity}"
  category: "{category}"
  dataset: "{dataset_name}"
  tables: ["{table1}", "{table2}"]
  description: "{what was wrong}"
  fix: "{what the correct approach is}"
  sql_before: "{original query, if applicable, else null}"
  sql_after: "{corrected query, if applicable, else null}"
  prevented_by: "{which validation layer should have caught this}"

The prevented_by field should reference one of these validation layers:

  • structural — schema checks, PK validation, null checks, row count validation
  • logical — aggregation consistency, trend direction, progression rates < 100%
  • business-rules — metric plausibility, known data quality rules, domain constraints
  • Simpson's check — segment-first analysis to detect reversals
  • source tie-out — pandas vs DuckDB comparison on foundational metrics

Examples of prevented_by:

  • For wrong aggregation: "logical (progression rates should never exceed 100%)"
  • For missing filter: "business-rules (check for test account filtering in conversion metrics)"
  • For wrong column: "structural (column validation against schema)"
  1. Read .knowledge/corrections/log.yaml (missing or corrupt: recreate per Rule 3)
  2. Append the new entry to the corrections list
  3. Write the YAML back (write the full file in one go so a failed write cannot leave a half-written log)
Step 4: Update Index
  1. Read .knowledge/corrections/index.yaml (already loaded in Step 3)
  2. Increment total_corrections
  3. Increment the matching by_severity.{severity} counter
  4. Increment by_category.{category} (create the key if it does not exist)
  5. Set last_correction_id to the new ID
  6. Set last_updated to today's date
  7. Write the YAML back (full file in one go)
Step 5: Confirm

Report to the user:

Correction logged: {id}
  Severity: {severity} | Category: {category}
  Description: {description}
  Fix: {fix}

Future analyses will check for this pattern during validation.

Rules

  1. Never overwrite existing corrections -- always append
  2. Always read current state before writing (no blind overwrites)
  3. If log.yaml or index.yaml is missing or corrupt, create from scratch with schema_version 1
  4. SQL snippets in sql_before/sql_after should be trimmed to the relevant clause, not the entire multi-hundred-line query
  5. prevented_by should reference a specific validation layer from the list in Step 3. Be specific about what check should have caught this.
  6. ONLY use the 5 allowed categories (sql, metric, schema, logic, other). If the user suggests a different category, map it to the closest match.

Edge Cases

  • No SQL involved: Set sql_before and sql_after to null
  • Dataset unknown: Set dataset to "unknown" and note in description
  • Duplicate correction: Still log it -- repeated errors signal a systemic gap
  • Correction to a correction: Log as a new entry referencing the prior ID in description
  • User suggests custom category: Map to closest allowed category and confirm. Example: "filter_missing" → sql category with description noting the missing filter.

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

Files

Just SKILL.md in .claude/skills/log-correction of ai-analyst-lab/ai-analyst.

Open the folder on GitHubat commit 52c0744

Compare with similar skills

Log Correction 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.

Log Correction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Log Correction this skillai-analyst-lab/ai-analyst304—~2.2kAutomated safety check: PassMIT
Learning to Learn (OpenMAIC)THU-MAIC/OpenMAIC40k—~502Automated safety check: PassMIT
Caveman Learn Token FixesJuliusBrussee/caveman110k—~2.8kAutomated safety check: PassApache-2.0
Ss Log MistakeSerial-Studio/Serial-Studio7.2k—~947Automated safety check: PassCustom licence
Project Learnings Managergarrytan/gstack136k—~8.2kAutomated safety check: NotesMIT
Fix Logcloudposse/atmos1.4k—~685Automated safety check: PassApache-2.0

Similar skills

  • A Chinese-language skill that embeds learning strategies like retrieval practice and self-explanation as a parallel goal inside an OpenMAIC subject lesson, without making study skills the topic.

    40k GitHub stars~502 tokensUpdated today
    EducationAuto-check passed
  • Caveman Learn Token Fixes

    JuliusBrussee/caveman

    Acts on a Caveman learn report: reviews ranked token sinks, applies cost-lowering edits one at a time with your consent, and reports what each fix returned.

    110k GitHub stars~2.8k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Ss Log Mistake

    Serial-Studio/Serial-Studio

    Append a row to Serial Studio's mistakes ledger (doc/claude/common-mistakes.md) for a defect just caught, and decide whether the class can be made mechanical.

    7.2k GitHub stars~947 tokensUpdated today
    DevelopmentAuto-check passed
  • Lets you review, search, prune and export the learnings gstack has collected across sessions, and surfaces them when a past fix or pattern comes up.

    136k GitHub stars~8.2k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • Fix Log

    cloudposse/atmos

    A skill your agent uses when implementing, finishing, documenting, or reviewing a fix, repair, remediation, bug fix, debug-and-fix task, workflow fix, infrastructure fix, or any change that should…

    1.4k GitHub stars~685 tokensUpdated today
    DevelopmentAuto-check passed
  • Fix Issue

    pytorch/pytorch

    Fix bugs reported in PyTorch GitHub issues by reproducing, root-causing, and implementing a fix in the local working tree.

    104k GitHub stars~2.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from ai-analyst-lab/ai-analyst

All 43 skills in this repo
  • Always Compare

    ai-analyst-lab/ai-analyst

    Never present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available.

    304 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Archaeology

    ai-analyst-lab/ai-analyst

    Retrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused.

    304 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Archive Analysis

    ai-analyst-lab/ai-analyst

    Save completed analyses to the knowledge system's analysis archive for future reference.

    304 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Auth Preflight

    ai-analyst-lab/ai-analyst

    Verify Google Workspace MCP authentication at the start of any session that needs Google APIs (Docs, Slides, Drive).

    304 GitHub stars~3.1k tokensUpdated 7 days ago
    Auto-check passed
  • Causal

    ai-analyst-lab/ai-analyst

    Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

    304 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Chart To Drive

    ai-analyst-lab/ai-analyst

    Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides.

    304 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed

Questions about Log Correction

What does Log Correction do?

Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error. Log Correction is an agent skill from ai-analyst-lab/ai-analyst. Record analyst mistakes, fixes, and reusable learnings so future analyses never repeat an error.

When should I use Log Correction?

Log Correction fits situations like: corrects work (actually its Y; teaches a rule (always use X; never include test users; remember that our fiscal year starts in February).

How do I install Log Correction in Claude Code?

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

How do I install Log Correction in Codex?

Run `npx skills add ai-analyst-lab/ai-analyst --skill log-correction -a codex`. Or copy the skill folder (.claude/skills/log-correction in ai-analyst-lab/ai-analyst) into .agents/skills/log-correction in your project. Codex loads it when a task matches its description.

Can I use Log Correction 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 ai-analyst-lab/ai-analyst --skill log-correction -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/log-correction, .gemini/skills/log-correction, .github/skills/log-correction and .opencode/skills/log-correction in your project.

What does Log Correction need to run?

SKILL.md names no scripts, command-line tools or credentials: Log Correction is instructions for the agent only.

Does Log Correction 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 Log Correction 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 Log Correction use?

Log Correction 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 Log Correction use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 Log Correction?

Skills that share tags, products or a category with Log Correction: Learning to Learn (OpenMAIC) (THU-MAIC/OpenMAIC, 40k stars), Caveman Learn Token Fixes (JuliusBrussee/caveman, 110k stars), Ss Log Mistake (Serial-Studio/Serial-Studio, 7.2k stars) and Project Learnings Manager (garrytan/gstack, 136k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Log Correction?

ai-analyst-lab (a GitHub organization) maintains it in ai-analyst-lab/ai-analyst, which has 304 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on September 30, 2026.

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