Official agent skill

Code Improver

by trailofbits in trailofbits/skills

Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent.

OfficialCC-BY-SA-4.0Auto-check: notesAgent Workflows

Install Code Improver

skills CLI
$ npx skills add trailofbits/skills --skill code-improver -a claude-code

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

GitHub CLI
$ gh skill install trailofbits/skills code-improver --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/trailofbits/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/code-improver/skills/code-improver .claude/skills/code-improver && 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
code-improver
GitHub stars
7.4k
Token cost
~1.8k tokens
SKILL.md length
917 words
Files
1
Skills in repo
79
Repo updated
First seen
Licence
CC-BY-SA-4.0

At a glance

Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent.

  • Works in 3 steps: Collect the three required inputs — no… → Resolve the loop script → Invoke the workflow
  • Asked to improve this code until review passes
  • SKILL.md covers Starting the loop, Relaying the result, Continuing after an escalation and When NOT to use
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Improver is an agent skill from trailofbits/skills, published by the product's own GitHub organization. Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.

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

It sits in Agent Workflows, covering Skill management. It works with Bash. The repository describes itself as: Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows. The licence is CC-BY-SA-4.0.

When your agent uses it

  • Asked to improve this code until review passes
  • Run an improvement loop with <reviewer
  • Iterate review-and-fix with a specific reviewer

Example prompts

  • “improve this code until review passes”
  • “run an improvement loop with <reviewer”
  • “/code-improver”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Glob, Read, TaskOutput, TaskStop, Workflow

Workflow steps

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

  1. Collect the three required inputs — no guessing
  2. Resolve the loop script
  3. Invoke the workflow

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Glob
    • Read
    • TaskOutput
    • TaskStop
    • Workflow

    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 json).

    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

Code Improver loads about 1.8k tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 917 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Glob, Read, TaskOutput, TaskStop, Workflow

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 trailofbits/skills at commit 82fe822, republished under its CC-BY-SA-4.0 licence (© trailofbits). 917 words, ~1,827 tokens.

Download SKILL.mdSave it as .claude/skills/code-improver/SKILL.md (or your agent's skills folder).
name
code-improver
description
Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.
allowed-tools
Bash, Glob, Read, TaskOutput, TaskStop, Workflow
argument-hint
<TARGET_PATH> --reviewer <agent-or-skill-name> --scope <globs> [--max-rounds N]

Code Improver

Improve any code target by running /code-improver:improve — a dynamic workflow that loops the named reviewer and a fixer subagent until a review reports zero critical/major findings, then strips its own residue. The loop, its ledger, and its guards live in the workflow; this skill collects the three inputs the generic entry requires and relays the outcome.

Starting the loop

The user provided: $ARGUMENTS (if empty, take the details from the conversation).

1. Collect the three required inputs — no guessing
  1. Target: the absolute path to the directory under improvement. Resolve relative paths against the working directory; verify the directory exists.
  2. Reviewer: the installed skill or agent that performs every review. The user must name it — there is no default and no bundled reviewer. Determine the kind:
    • a namespaced agent (e.g. plugin-dev:skill-reviewer) → "kind": "agent"
    • an installed skill (e.g. pr-review-toolkit:review-pr) → "kind": "skill" If the name could be either, check the session's skill listing; if still ambiguous, ask the user. If no reviewer was named, ask — do not pick one.
  3. Scope: repo-relative globs the loop may touch. The generic entry requires it explicitly; if the user did not give one, propose the target directory (<repo-relative-target>/**) and confirm before launching.
2. Resolve the loop script

The loop is the dynamic workflow workflows/improve.js in this plugin. Launch it by path: scriptPath takes a resolved absolute path, and the Workflow tool's name resolves built-in and project workflows, so a marketplace-installed one may not answer to code-improver:improve. Try in order, first hit wins — the home directories come before . so an installed copy beats a checkout of this marketplace:

  1. Bash: ls -d -- "${CLAUDE_PLUGIN_ROOT}/workflows/improve.js"
  2. Bash: ls -d -- "${CODEX_PLUGIN_ROOT}/workflows/improve.js" (if that variable is set instead)
  3. Bash: find ~/.claude ~/.codex . -maxdepth 7 -path '*/code-improver/workflows/improve.js' -print -quit 2>/dev/null

Use the path exactly as printed. Its plugin directory — the path with /workflows/improve.js removed — is pluginRoot. If all three come back empty, try {name: "code-improver:improve"} once; if that is unavailable too, stop and say the loop could not be located. Do not assemble a path by hand and do not improvise the loop.

3. Invoke the workflow

Run it with the Workflow tool, {scriptPath: "<the path from step 2>", args: {...}}:

json
{
  "target": "<absolute target path>",
  "reviewer": { "kind": "agent|skill", "name": "<namespaced-name>", "notes": "<what the reviewer should know about the target>" },
  "scope": ["<repo-relative-glob>/**"],
  "pluginRoot": "<the plugin directory from step 2>",
  "maxRounds": 5
}
  • maxRounds only if the user asked for a different cap.
  • pluginRoot lets the run find its metrics collector; omit the key only if step 2 fell through to the workflow name — the workflow then searches for itself.
  • finalize ({"version_bump": bool, "narration_strip": bool, "docs_pass": bool}) only to override the defaults: version bump when the target sits inside a plugin, narration strip and docs pass always.
  • decision only on continuation (below).

The workflow runs in the background and needs no babysitting: it reviews, fixes, re-reviews, checks scope after every fix round, and can only complete on a clean review. It never commits; all changes stay in the working tree.

If the Workflow tool is unavailable or denied, stop and say so. Do not improvise the loop inline with direct edits — the ledger, scope guard, and escalation guarantees live in the workflow, and an inline imitation has none of them.

If the result is halted: "reviewer-unavailable", relay it and stop. The named reviewer is not installed in this session; tell the user which plugin provides it and re-run after installing. Do not review the target yourself.

Do not end your turn while the loop is running. The Workflow tool returns a task id immediately; the result comes later. In an interactive session the completion notification re-invokes you — wait for it. In a non-interactive run (scripted, CI, eval) there is no later turn: stopping abandons the loop mid-round, so after launching, poll the task (TaskOutput with the returned task id, or sleep-and-recheck) until it completes, then relay the result. A session that answers "the loop is running, I'll report later" has lost the run.

Show full SKILL.md (284 more words)Show less

Relaying the result

The workflow returns a structured result. Report it honestly — the distinctions matter:

  • converged: true — the last action was a review with zero critical/major findings. Report rounds used, remaining minor findings (open_minor_count), and the artifact paths (ledger_path, metrics).
  • capped: true — the fix budget ran out and the FINAL review still found blocking issues. Say plainly: capped, NOT converged, and list open_blocking. Do not present this as success.
  • escalation — the loop detected it was not converging (recurring findings, non-decreasing counts, or a fix relocating a problem). Relay the escalation message and finding ids to the user: this needs a design decision, not more rounds.
  • halted — a guard fired (scope violation, unregistered new files, a dead or unavailable reviewer, or a finalize pass whose own edits failed the check that follows it). Relay the paths in violations/new_untracked_files, the sites in finalize_regressions, and the notes.
  • notes always travel with the result — surface them; they include loud warnings such as "a git repository was initialized".

Continuing after an escalation

The loop stops on escalation by design. When the user decides, start a fresh run with the same target and reviewer plus:

json
{ "decision": "<the user's ruling, verbatim>" }

The new run reloads the on-disk ledger, so every finding, rejection, and verdict carries over — rounds restart, re-derivation does not.

To stop a running loop, stop the workflow task (TaskStop); the ledger on disk is current to the last round and a re-run resumes from it.

When NOT to use

  • A Claude Code skill: use the skill-improver entry — it wires the right reviewer
  • A branch / pull request: use the pr-improver entry — it derives scope from the diff
  • One-time review: dispatch the reviewer directly; the loop's value is iteration
  • Quick single fixes: edit the file directly

© trailofbits, CC-BY-SA-4.0. 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 plugins/code-improver/skills/code-improver of trailofbits/skills.

Open the folder on GitHubat commit 82fe822

Compare with similar skills

Code Improver 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.

Code Improver compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Improver this skilltrailofbits/skills7.4k—~1.8kAutomated safety check: NotesCC-BY-SA-4.0
Skill Stocktakeaffaan-m/ECC275k—~1.4kAutomated safety check: PassMIT
Skill Stocktakemajiayu000/claude-skill-registry6667 repos~1.9kAutomated safety check: PassMIT
Skill Installermajiayu000/claude-skill-registry6663 repos~2.8kAutomated safety check: NotesMIT
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Plugin Settings Patternanthropics/claude-plugins-official38k7 repos~3kAutomated safety check: PassApache-2.0

Similar skills

  • Skill Stocktake

    affaan-m/ECC

    Claudeのスキルとコマンドの品質を監査するためのツール。変更されたスキルのみを対象とした高速スキャンと、順次サブエージェントバッチ評価を使用した完全棚卸しモードをサポートする。

    275k GitHub stars~1.4k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Skill Stocktake

    majiayu000/claude-skill-registry

    用于审计Claude技能和命令的质量。支持快速扫描(仅变更技能)和全面盘点模式,采用顺序子代理批量评估. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 7 repos~1.9k tokens
    Agent WorkflowsAuto-check passed
  • Skill Installer

    majiayu000/claude-skill-registry

    Instala, valida, registra e verifica novas skills no ecossistema.

    666 GitHub starsUsed in 3 repos~2.8k tokens
    Agent WorkflowsAuto-check: notes
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    Official

    Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.

    38k GitHub starsUsed in 7 repos~3k tokens
    Agent WorkflowsAuto-check passed
  • Darwin Skill Optimizer

    alchaincyf/darwin-skill

    Scores SKILL.md files on a nine-dimension rubric, then improves them in a keep-or-revert loop with independent judge agents, test prompts, git history and human checkpoints.

    6.2k GitHub starsUsed in 1 repo~4.7k tokens
    Agent WorkflowsAuto-check passed

More from trailofbits/skills

All 79 skills in this repo
  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.4k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • CodeQL Security Scan

    trailofbits/skills

    Official

    Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.

    7.4k GitHub stars~4.6k tokensUpdated today
    Auto-check: notes
  • Trailmark Graph Evolution

    trailofbits/skills

    Official

    Compares Trailmark code graphs at two snapshots, such as commits, tags or directories, to surface attack paths, blast radius and taint changes that text diffs miss.

    7.4k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Let Fate Decide

    trailofbits/skills

    Official

    Draws a 12 Houses tarot spread to break ties when a request is vague or casually delegated, then reads the cards to pick the next step.

    7.4k GitHub stars~2.5k tokensUpdated today
    Auto-check: notes
  • Burp Suite Project Parser

    trailofbits/skills

    Official

    Searches and extracts data from Burp Suite project files on the command line: regex searches over responses, audit findings, proxy history and site map data.

    7.4k GitHub starsUsed in 4 repos~4.2k tokens
    Auto-check: notes
  • Semgrep Security Scan

    trailofbits/skills

    Official

    Detects languages, proposes rulesets for approval, then runs the approved Semgrep scan across a codebase and merges the output into one SARIF file.

    7.4k GitHub stars~3.7k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about Code Improver

What does Code Improver do?

Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Code Improver is an agent skill from trailofbits/skills, published by the product's own GitHub organization. Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent.

When should I use Code Improver?

Code Improver fits situations like: asked to improve this code until review passes; run an improvement loop with <reviewer; iterate review-and-fix with a specific reviewer.

How do I install Code Improver in Claude Code?

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

How do I install Code Improver in Codex?

Run `npx skills add trailofbits/skills --skill code-improver -a codex`. Or copy the skill folder (plugins/code-improver/skills/code-improver in trailofbits/skills) into .agents/skills/code-improver in your project. Codex loads it when a task matches its description.

Can I use Code Improver 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 trailofbits/skills --skill code-improver -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-improver, .gemini/skills/code-improver, .github/skills/code-improver and .opencode/skills/code-improver in your project.

What does Code Improver need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Improver is instructions for the agent only. Its frontmatter pre-approves these tools: Bash, Glob, Read, TaskOutput, TaskStop, Workflow.

Does Code Improver 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 Code Improver safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Code Improver use?

Code Improver is published under the CC-BY-SA-4.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Improver use?

About 1.8k tokens (SKILL.md is roughly 7.3k 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 Code Improver?

Skills that share tags, products or a category with Code Improver: Skill Stocktake (affaan-m/ECC, 275k stars), Skill Stocktake (majiayu000/claude-skill-registry, 666 stars), Skill Installer (majiayu000/claude-skill-registry, 666 stars) and Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Improver?

trailofbits (a GitHub organization, an official publisher) maintains it in trailofbits/skills, which has 7,420 GitHub stars. The repository holds 79 skills in this directory. The repository was last updated on October 7, 2026.

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