Use after resolving a bug, failed task, or unexpected agent behavior to improve the pipeline skills, agents, hooks, or scripts that contributed to the problem. Also proactively suggest improvements when recurring patterns or inefficiencies are observed.
Install with Tessl CLI
npx tessl i github:aaddrick/claude-desktop-debian --skill improvement-loop81
Quality
72%
Does it follow best practices?
Impact
93%
1.25xAverage score across 3 eval scenarios
Optimize this skill with Tessl
npx tessl skill review --optimize ./.claude/skills/improvement-loop/SKILL.mdImprove the .claude/ pipeline after resolving the issue at hand — never during. When a skill, agent, hook, or script produces bad output, work through to the correct solution first, then update the pipeline with what you learned.
Core principle: Fix first, understand fully, improve last. Premature edits encode partial understanding.
digraph when_to_use {
"Issue resolved successfully?" [shape=diamond];
"Root cause in pipeline file?" [shape=diamond];
"Worth encoding permanently?" [shape=diamond];
"Run improvement cycle" [shape=box style=filled fillcolor=lightgreen];
"Keep working on the issue" [shape=box];
"Skip - not a pipeline problem" [shape=box];
"Skip - one-off or too specific" [shape=box];
"Issue resolved successfully?" -> "Root cause in pipeline file?" [label="yes"];
"Issue resolved successfully?" -> "Keep working on the issue" [label="no - finish first"];
"Root cause in pipeline file?" -> "Worth encoding permanently?" [label="yes"];
"Root cause in pipeline file?" -> "Skip - not a pipeline problem" [label="no"];
"Worth encoding permanently?" -> "Run improvement cycle" [label="yes"];
"Worth encoding permanently?" -> "Skip - one-off or too specific" [label="no"];
}Trigger conditions (suggest to user):
Do NOT trigger:
This check is mandatory before any improvement work.
digraph gate_check {
"Original task/issue complete?" [shape=diamond];
"Tests passing?" [shape=diamond];
"User confirmed resolution?" [shape=diamond];
"GATE PASSED - proceed to improvement" [shape=box style=filled fillcolor=lightgreen];
"STOP - return to the issue" [shape=box style=filled fillcolor=salmon];
"Original task/issue complete?" -> "Tests passing?" [label="yes"];
"Original task/issue complete?" -> "STOP - return to the issue" [label="no"];
"Tests passing?" -> "User confirmed resolution?" [label="yes"];
"Tests passing?" -> "STOP - return to the issue" [label="no"];
"User confirmed resolution?" -> "GATE PASSED - proceed to improvement" [label="yes"];
"User confirmed resolution?" -> "STOP - return to the issue" [label="no/unclear"];
}Verify ALL of these before proceeding:
If ANY check fails, stop. Return to the issue. Do not start improvement work.
When you observe improvement opportunities during normal work, do not act immediately. Instead:
I noticed [specific problem] while working on [task]. The root cause appears to be
[skill/agent/hook/script name] which [lacks guidance on X / has an anti-pattern gap /
doesn't handle Y].
Would you like me to run an improvement cycle to update it? This would involve:
- [Specific change: e.g., "adding an anti-pattern entry for hardcoded minified variable names"]
- [Estimated scope: e.g., "a one-line addition to the agent's anti-patterns section"]Always ask before starting. The user may want to defer, batch improvements, or handle it differently.
Document what happened before details fade:
| Type | Target | Example |
|---|---|---|
| Anti-pattern | Agent definition | "NEVER hardcode minified variable names in sed patterns" |
| Missing guidance | Skill content | Add edge case handling to a technique skill |
| New trigger | Skill description | Add symptom that should invoke this skill |
| Hook gap | settings.json / hook script | Formatter not catching a file type |
| Script edge case | Orchestration script | Unhandled timeout in a stage |
| Missing skill | New skill file | Technique not documented anywhere |
| Missing agent | New agent file | Specialized role not defined |
Write the smallest change that prevents the problem from recurring.
Do NOT:
Depending on the type of change:
| Change Type | Verification |
|---|---|
| Agent anti-pattern | Grep for conflicting guidance in the agent file |
| Skill content | Read the skill end-to-end — does the new content fit? |
| Hook logic | Run the hook manually with test input |
| Orchestration script | Run relevant BATS tests |
| New skill/agent | Follow writing-skills or writing-agents skill (includes testing) |
git add .claude/[changed-file]
git commit -m "improve: [file] - [what was added and why]"Tell the user what was changed and why:
Updated [file] with [change]. This prevents [problem] which occurred during [task].| What Needs Changing | How to Change It |
|---|---|
| Existing skill (small edit) | Edit directly |
| Existing agent (small edit) | Edit directly |
| New skill | Invoke writing-skills skill |
| New agent | Invoke writing-agents skill |
| Orchestration script | Dispatch cc-orchestration-writer agent via Task tool |
| Hook script | Dispatch bash-script-craftsman agent via Task tool |
| settings.json | Edit directly |
For new skills and agents: The writing-skills and writing-agents skills have their own TDD cycles. Follow them — don't shortcut.
Improvements can spiral. Guard against these anti-patterns:
| Anti-Pattern | Prevention |
|---|---|
| Yak shaving — improving A leads to improving B leads to C... | One improvement per cycle. If you discover more, note them and ask the user about a separate cycle. |
| Speculative improvements — "while I'm here, let me also..." | Only fix the problem that actually occurred. YAGNI applies to pipeline improvements too. |
| Encoding partial understanding — improving before fully resolving | The gate check (Step 0) prevents this. Never skip it. |
| Over-engineering — turning a one-line anti-pattern into a new skill | Match the weight of the fix to the weight of the problem. |
| Stale improvements — guidance that was correct once but isn't anymore | When you notice outdated guidance during work, flag it as an improvement opportunity. |
When multiple improvement opportunities arise in one session:
I identified 3 potential pipeline improvements during this session:
1. [agent-name]: Missing anti-pattern for [X] (occurred during task Y)
2. [skill-name]: Edge case not covered for [Z] (caused wrong approach in task W)
3. [hook]: Not catching [file type] (missed formatting on 2 files)
Would you like me to address these? I can handle them as:
a) One batch (fastest, ~5 min)
b) Individual cycles (most thorough)
c) Skip for now"When a skill or agent produces bad output, don't immediately edit it. Work through to the correct solution first. Then update the skill with what you learned."
The instinct to jump into the pipeline file and tweak is strong. Resist it. Partial understanding encoded as guidance creates more problems than it solves. The improvement only becomes reliable after full resolution.
6035523
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.