legacy-code-changes

legacy-code-changes is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 95 tokens per session (1,084 once invoked), scanned A, original, MIT.

A method for changing old or unfamiliar software carefully, especially when it has few tests. It uses code tracing, existing behaviour tests, and small replacements instead of broad rewrites.

In plain words
What is it for?
Use it when inheriting a codebase, changing code without tests, investigating a legacy feature, or planning a gradual refactor.
Why use it?
Old code often contains fixes for problems that are not obvious. This approach reduces the chance of breaking working behaviour while making changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when inheriting a codebase, changing code without tests, investigating a legacy feature, or planning a gradual refactor.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/05-deepak-patidar/claude-skills/legacy-code-changes
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 05-deepak-patidar/claude-skills --skill legacy-code-changes
Clone the repo
git clone --depth 1 https://github.com/05-deepak-patidar/claude-skills

Made for: Claude Code, Codex.

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 legacy-code-changes

README.md
[![agentmods](https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/legacy-code-changes/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/legacy-code-changes)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/legacy-code-changes"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/legacy-code-changes/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 legacy-code-changes

Your own site · 80×15
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/legacy-code-changes"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/legacy-code-changes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,084 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00095 $0.01084
Opus 5 $0.00048 $0.00542
Sonnet 5 $0.00019 $0.00217
Haiku 4.5 $0.00010 $0.00108

Measured 9d ago against content hash fe71b57d7943, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

legacy-code-changes scanned grade A with 0 findings 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 9d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

legacy-code-changes/SKILL.md · 43 lines

How it starts

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

Legacy Code Changes

Legacy code is code that makes money and scares you. It survived contact with reality — every weird if in it may be a bug fix for something that actually happened. The discipline: comprehension before modification, safety before improvement, incremental over heroic. This applies double to AI assistants, which have a strong rewrite bias: regenerating code they don't understand instead of minimally editing it.

Gate 1: Understand before touching (timeboxed, active)

  • Trace one real flow end-to-end — entry point → decision points → side effects → output — for the exact behavior you must change. Reading the whole codebase is procrastination; tracing one path is comprehension.
  • Use archaeology, not just reading: git log -p on the file (why does this weird line exist? — the commit message knows), git blame on the scary part, existing tests as executable documentation, and running the thing with a debugger/print on the path in question.
  • Write down the 3–5 facts you learned that surprised you. If nothing surprised you, you haven't understood it yet — legacy code always surprises.
  • Chesterton's Fence is the law: never delete or "fix" code you can't explain. That check for a null tenant on Tuesdays is either dead code or a ₹10-lakh lesson — find out which (git history, asking, logging it in prod) before removing.

Gate 2: Pin current behavior before changing it

  • Where tests are missing, write characterization tests first: capture what the code actually does now (including behavior that looks wrong), so you can detect what your change breaks. You're not asserting correctness; you're building a tripwire. Feed the function its realistic inputs, snapshot the outputs, done — 30 minutes of pinning beats a week of "what else did I break".
  • Can't test it because it's tangled in I/O and globals? Find or make the smallest seam: extract the decision logic from the side effects just enough to get it under test (code-quality's edges-and-core rule) — the minimal surgery, not a beautification pass.
  • No time even for that? Then pin behavior operationally: run the golden path before and after, diff the outputs/DB state, and say honestly that this is the verification level (evidence rule).

Read the full file on GitHub · 43 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. 9d ago First seen · 43 lines · 95 tokens per session scan A fe71b57d7943

Subscribe to this mod's changes

legacy-code-changes is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 95 tokens to every session and 1,084 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.