# Learning loop

> Learning loop is an open-source agent skill for developer tools. Turns failures and user corrections into tested, narrowly scoped workflow fixes. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/learning-loop
- **Repository:** https://github.com/wan-huiyan/agent-traffic-control
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** learning-loop
- **Collection:** https://github.com/wan-huiyan/agent-traffic-control
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill guides an agent through a retrospective after a material failure, a user correction or a contradictory result. It asks the agent to preserve what happened along with the exact artifact versions, separate the observed discrepancy from its suspected cause, and reproduce or qualify that cause before choosing the smallest useful correction. The fix is checked against both the original failure and a legitimate case it must still permit, and it is placed where it belongs: code, data, measurement, a project decision, a skill or memory.

The workflow also covers closing the event. Each correction is recorded as incorporated and checked, rejected with evidence, or pending a named missing input, and rules are revisited when later evidence challenges them. Existing guidance is searched first so one canonical explanation is kept and superseded evidence is preserved rather than erased. Edits are limited to the authority of the current task, and the skill distinguishes a user's policy choice from an empirical claim.

The skill ships as a folder with a SKILL.md and reference documents for the correction procedure and an optional memory-hygiene integration. It includes no scripts, so it relies on the agent's own tools. It points to sibling skills for recurring lessons and blocked steps, and to other workflows for multi-lane research and shared worktrees.

## When your agent uses it

> Turn failures and user corrections into tested workflow improvements. Use for lessons and retrospectives.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/learning-loop)
- [License: MIT](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/learning-loop)

## Features

- **Evidence-based correction:** Separates the observed discrepancy from its proposed cause and reproduces or qualifies that cause before changing anything.
- **Smallest useful fix:** Chooses the narrowest correction and checks it against both the failure and a legitimate case it must still allow.
- **Correct placement:** Decides whether a fix belongs in code, data, measurement, a project decision, a skill or memory.
- **Existing guidance search:** Looks for current rules first and keeps one canonical explanation rather than duplicating guidance.
- **Event closure tracking:** Records each correction as incorporated, rejected with evidence, or pending a specific missing input.
- **Revisit and retire rules:** Narrows, replaces or removes rules whose cost exceeds their demonstrated benefit.

## Good for

- Review why an agent's code change broke a test and adjust the workflow
- Turn a user's correction on a research summary into a lasting rule
- Run a retrospective after a deployment or operations incident
- Retire guidance that no longer helps and record the decision
- Audit stored memory notes after an authorized cleanup

## Install

### Claude Code

This skill ships in the `agent-traffic-control` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control
```

Or copy only this skill to `~/.claude/skills/learning-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/learning-loop &&
cp -R "$tmp/plugins/agent-traffic-control/skills/learning-loop" ~/.claude/skills/learning-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/learning-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/learning-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/learning-loop &&
cp -R "$tmp/plugins/agent-traffic-control/skills/learning-loop" ~/.agents/skills/learning-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/learning-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/learning-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/learning-loop &&
cp -R "$tmp/plugins/agent-traffic-control/skills/learning-loop" ~/.cursor/skills/learning-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/learning-loop` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/learning-loop
```

Or copy the folder to `~/.gemini/skills/learning-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/learning-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/learning-loop &&
cp -R "$tmp/plugins/agent-traffic-control/skills/learning-loop" ~/.copilot/skills/learning-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/learning-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git
```

Then copy `agent-traffic-control/plugins/agent-traffic-control/skills/learning-loop` into your agent's skills folder as `learning-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Learning loop trigger?

It applies after a material failure, a substantive user correction or a contradictory result. The skill says an ordinary successful task or a simple spelling fix does not need a retrospective.

### Does Learning loop change files on its own?

It applies supported changes only within the current task's authorization. It does not authorize unrelated memory edits, changes to an owner's policy, future releases or scheduled background work.

### Does Learning loop include scripts?

No. The skill folder has no scripts and sets no allowed tools; it is made of instructions and reference documents.

### What does Learning loop recommend for recurring lessons?

A sibling skill for lessons that recur after being written down, which suggests turning a mechanical rule into a hook or check.

### How do I install Learning loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/learning-loop to use it in all your projects, or to .claude/skills/learning-loop in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.

### Does Learning loop run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Learning loop?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Learning loop?

The closest alternatives to Learning loop are Correct, Fix bug, Debug, Bugfix and Debugging and error recovery.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Fix bug](https://ai-powered.com/skills/fix-bug): Fix bug is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-evist0): Debug is an open-source agent skill for developer tools.
- [Bugfix](https://ai-powered.com/skills/bugfix): Bugfix is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.
- [Self correcting loop](https://ai-powered.com/skills/self-correcting-loop): Self correcting loop is an open-source agent skill for developer tools.
- [Principle fix root causes](https://ai-powered.com/skills/principle-fix-root-causes): Principle fix root causes is an open-source agent skill for developer tools.
- [Systematic Debugging](https://ai-powered.com/skills/systematic-debugging-joaoariedi): Systematic Debugging is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/learning-loop
