improve-codebase

improve-codebase is a skill for Claude Code from tomzx/agents. It costs 96 tokens per session (4,783 once invoked), scanned B, original, MIT.

A routine cleanup workflow that makes a small batch of safe codebase improvements and opens one pull request. A codebase is the complete collection of source code and related project files.

In plain words
What is it for?
It helps remove unused code, add missing types, fix lint issues, remove unused dependencies, and update dependencies when safe. It then runs the project checks and prepares a pull request.
Why use it?
It turns recurring maintenance work into a reviewable change and verifies the result with the project’s linting, type checks, and tests.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument; mentions AGENTS.md.

Good fit It helps remove unused code, add missing types, fix lint issues, remove unused dependencies, and update dependencies when safe. It then runs the project checks and prepares a pull request.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tomzx/agents/improve-codebase
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tomzx/agents --skill improve-codebase
Clone the repo
git clone --depth 1 https://github.com/tomzx/agents

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for improve-codebase

README.md
[![agentmods](https://agentmods.dev/badge/skills/tomzx/agents/improve-codebase/github.svg)](https://agentmods.dev/skills/tomzx/agents/improve-codebase)
Your own site
<a href="https://agentmods.dev/skills/tomzx/agents/improve-codebase"><img src="https://agentmods.dev/badge/skills/tomzx/agents/improve-codebase/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for improve-codebase

Your own site · 80×15
<a href="https://agentmods.dev/skills/tomzx/agents/improve-codebase"><img src="https://agentmods.dev/badge/skills/tomzx/agents/improve-codebase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,783 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.04783
Opus 5.5 $0.00038 $0.01913
Sonnet 5.5 $0.00019 $0.00957
Haiku 4.5 $0.00010 $0.00478

Measured 22d ago against content hash c0a8aa6235da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

improve-codebase scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

For `--no-pr`, leave the local branch in place and print instructions to review and push.
skills/improve-codebase/SKILL.md · 434 lines

How it starts

The opening of the file, as written. The whole thing — 434 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Improve Codebase

Makes a bounded set of safe, verified improvements to a codebase, then opens a single reviewable PR. Designed to run on a weekly cadence so the codebase gets incrementally better without a large one-time refactor.

The Core Problem This Solves

/audit-sdlc and /sync-repository tell you what is wrong. They produce reports and issues, but the work of actually deleting the dead export, adding the missing type annotation, and running the formatter still falls to a human. That backlog grows faster than anyone clears it.

This skill closes that gap. Each run it scans for the same opportunities the audit skills find, picks a small batch that is safe to apply automatically, applies it, proves it is safe by running the project's own lint/typecheck/test suite, and ships it as one PR. Over weeks, the backlog shrinks instead of grows.

Skill Reads code Writes code Opens PR Cadence
audit-sdlc yes no (report only) no on demand
sync-repository yes .sdlc/ only, or --fix no on demand
improve-codebase yes yes, source code yes weekly routine

Use audit-sdlc to find problems. Use improve-codebase to fix the safe ones automatically.

Prerequisites

  • Working directory is the root of a git repository on a clean working tree (no uncommitted changes)
  • A default branch to branch from (main, or the repo's detected default)
  • A way to verify changes: a test suite, a linter/formatter, or a typechecker. The skill discovers these (see Discovery below). If none can be found, it runs in --dry-run only and asks the user to record commands in AGENTS.md.
  • Read any files under .sdlc/context/ for project conventions
  • Network access to push the branch and open a PR (unless --no-pr)

Safety Contract (Non-Negotiable)

These rules make the skill safe to run unattended on a schedule:

  1. Never touch the default branch. All work happens on a short-lived branch.
  2. Never auto-fix anything rated higher than "low risk". Security issues, dependency majors, complexity refactors, and public API changes become issues, not commits.
  3. Never skip verification. Every change must be validated by the project's own checks. If verification fails, revert that change and continue with the next candidate.
  4. One concern per commit, one PR per run. Reviewers see small atomic commits, not one large diff.
  5. Respect .gitignore, lint configs, and existing suppression comments (# noqa, //nolint). Do not go against the project's stated preferences.
  6. Never force-push, never amend published commits, never bypass hooks.
  7. Bounded output. A run stops at the change budget so the PR stays reviewable.
  8. Never introduce new dependencies. Only removes or patches existing ones.

Read the full file on GitHub · 434 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago Changed · +42 lines c0a8aa6235da
  2. 24d ago Changed d8d45ab5b24b
  3. 1mo ago First seen · 392 lines · 96 tokens per session scan B f1d91c9a5bef

Subscribe to this mod's changes

improve-codebase is a skill published in the GitHub repository tomzx/agents (13 stars, last pushed yesterday), licensed MIT. It adds 96 tokens to every session and 4,783 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

adk-go-self-review

Review an ADK Go change the way a maintainer will — a fresh-context pass over the whole diff, five lenses (correctness and tests, scope, simplicity, style, adk-python parity), and the mutation check that proves your tests pin the change. Use before opening a PR, before any later push that changes code, and when asked…

google/adk-go · 87 tokens

adversarial-reviewer

Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…

emdash-cms/emdash · 72 tokens

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

semgrep-rule-variant-creator

Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.

waybarrios/opencode-power-pack · 50 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

plugin-review

Review plugin quality with tiered checks and dependency scoping. Use for PR and pre-release audits.

athola/claude-night-market · 23 tokens