Agent skill

trace-mcp Codemods

by nikolai-vysotskyi in nikolai-vysotskyi/trace-mcp

Replaces repeated hand edits with the trace-mcp apply_codemod tool, previewing matches in a dry run before bulk mechanical changes across one file or many.

MITAuto-check passedDevelopment

Install trace-mcp Codemods

skills CLI
$ npx skills add nikolai-vysotskyi/trace-mcp --skill trace-mcp-codemod -a claude-code

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

GitHub CLI
$ gh skill install nikolai-vysotskyi/trace-mcp trace-mcp-codemod --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/nikolai-vysotskyi/trace-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/trace-mcp-codemod .claude/skills/trace-mcp-codemod && 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
trace-mcp-codemod
GitHub stars
189
Token cost
~729 tokens
SKILL.md length
281 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Replaces repeated hand edits with the trace-mcp apply_codemod tool, previewing matches in a dry run before bulk mechanical changes across one file or many.

  • Works in 4 steps: Preview with dry run (default) → Narrow scope when needed → Apply the change → …
  • Applying the same code change in many places
  • SKILL.md covers When to Use — HARD RULE, Standard Workflow, Planning Larger Changes and Anti-Patterns to Avoid
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Whenever the same kind of edit is about to be made twice or more, such as adding async and await to functions, updating a signature at every call site, fixing import paths after a move, wrapping calls in logging or replacing a deprecated API, the agent stops and uses apply_codemod instead of repeated Edit calls. The skill treats this as a hard rule with no exception for small jobs.

The workflow starts with a dry-run preview to spot false positives, narrows scope with a content filter or multiline mode, then applies the change for real, adding a confirmation flag when more than 20 files are affected. Reindexing happens inside the tool, and the agent follows up with the test suite or the quality gates. For package upgrades it uses plan_batch_change first to get an impact report, and renames go to a separate apply_rename tool.

When your agent uses it

  • Applying the same code change in many places
  • Updating a function signature at every call site
  • Fixing import paths after moving files
  • Replacing a deprecated API across a repository

Example prompts

  • “Rename every call to oldFunction to newFunction across src, and show me a dry run first.”
  • “Wrap all fetch calls in our logger helper using a codemod.”
  • “Plan the lodash upgrade impact before changing any files.”

Requirements

  • A connected trace-mcp MCP server

Workflow steps

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

  1. Preview with dry run (default)
  2. Narrow scope when needed
  3. Apply the change
  4. Reindex and verify

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    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

trace-mcp Codemods loads about 729 tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 281 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 nikolai-vysotskyi/trace-mcp at commit a577015, republished under its MIT licence (© nikolai-vysotskyi). 281 words, ~729 tokens.

Download SKILL.mdSave it as .claude/skills/trace-mcp-codemod/SKILL.md (or your agent's skills folder).
name
trace-mcp-codemod
description
Use trace-mcp apply_codemod for any bulk mechanical change instead of repeated Edit calls. Activate whenever the same edit pattern would be applied 2+ times, across one file or many.

trace-mcp — Codemod Workflow

apply_codemod is the correct tool for any repeated mechanical change. Using Edit for the same pattern twice or more is a waste of tokens and is error-prone.

When to Use — HARD RULE

If you are about to make the same kind of change 2 or more times — whether in one file or across many — stop and use apply_codemod. This includes:

  • Adding async/await to a set of functions
  • Updating a function signature everywhere it is called
  • Fixing import paths after a move
  • Adding or removing keywords/decorators
  • Wrapping calls in a logger, try/catch, or feature flag
  • Replacing a deprecated API usage
  • Any regex-replaceable refactor

No exceptions. "It's just three edits" is still a violation — use apply_codemod.

Standard Workflow

1. Preview with dry run (default)
apply_codemod({
  pattern: "oldFunction\\(",
  replacement: "newFunction(",
  file_pattern: "src/**/*.ts",
  dry_run: true        // default
})

Review the preview: matched files, context lines, and replacement correctness. Look for false positives.

2. Narrow scope when needed

Use filter_content to only touch files that also contain a second marker:

apply_codemod({
  pattern:        "extractNodes\\(",
  replacement:    "extractNodes(ctx, ",
  file_pattern:   "src/**/*.ts",
  filter_content: "import.*extractNodes",
  dry_run:        true
})

For patterns that cross line boundaries, enable multiline mode:

apply_codemod({
  pattern:     "function\\s+foo\\([^)]*\\)\\s*\\{",
  replacement: "async function foo() {",
  multiline:   true,
  dry_run:     true
})
3. Apply the change
apply_codemod({ ..., dry_run: false })

If more than 20 files are affected, add confirm_large: true.

4. Reindex and verify
  • register_edit is not needed for codemods — apply_codemod handles reindexing internally.
  • Run the test suite or check_quality_gates with scope: "changed".

Planning Larger Changes

For changes that span packages or require version awareness (e.g. upgrading a dependency), use plan_batch_change first:

plan_batch_change({
  package:      "lodash",
  from_version: "4.17.0",
  to_version:   "5.0.0"
})

This returns an impact report with all affected files and import references. Combine it with apply_codemod for the actual rewrite.

Anti-Patterns to Avoid

  • Using Edit with replace_all for renames — use apply_rename (see trace-mcp-refactoring).
  • Chaining 3–10 Edit calls with the same old_string pattern shape — use apply_codemod.
  • Skipping the dry-run preview — always review matches first.
  • Forgetting confirm_large: true on changes >20 files.

© nikolai-vysotskyi, MIT. 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 skills/trace-mcp-codemod of nikolai-vysotskyi/trace-mcp.

Open the folder on GitHubat commit a577015

Compare with similar skills

trace-mcp Codemods 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.

trace-mcp Codemods compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
trace-mcp Codemods this skillnikolai-vysotskyi/trace-mcp189—~729Automated safety check: PassMIT
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Graph-Guided Safe Refactoringtirth8205/code-review-graph32k1 repos~332Automated safety check: PassMIT
ast-grep Codemod Referencewarp-drive-data/warp-drive3.2k—~2.6kAutomated safety check: PassMIT
Roslynkmrpmorris/Roslynk1361 repos~3.8kAutomated safety check: PassMIT

Similar skills

  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Graph-Guided Safe Refactoring

    tirth8205/code-review-graph

    Plans a refactor from a code dependency graph, previews renames before applying them and checks that the final impact matches the plan.

    32k GitHub starsUsed in 1 repo~332 tokens
    DevelopmentAuto-check passed
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Roslynk

    mrpmorris/Roslynk

    How to use the Roslynk MCP tools (mcproslynk) effectively for .NET work.

    136 GitHub starsUsed in 1 repo~3.8k tokens
    DevelopmentAuto-check passed
  • Code Review Graph Navigator

    handsontable/handsontable

    Queries a pre-built, Tree-sitter-based code graph of the whole monorepo instead of grepping call chains, for exploring, debugging, refactoring or reviewing code.

    22k GitHub stars~939 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from nikolai-vysotskyi/trace-mcp

  • Trace MCP

    nikolai-vysotskyi/trace-mcp

    Use trace-mcp tools for code navigation, impact analysis, and framework-aware queries instead of Read/Grep/Glob/Bash.

    189 GitHub stars~1.6k tokensUpdated today
    Auto-check: notes
  • trace-mcp Pre-Commit Checks

    nikolai-vysotskyi/trace-mcp

    Runs trace-mcp security, quality-gate and antipattern checks before a commit or pull request, and builds a symbol-level diff for the PR description.

    189 GitHub stars~565 tokensUpdated today
    Auto-check passed
  • Trace-MCP Refactoring

    nikolai-vysotskyi/trace-mcp

    Refactors code safely in projects indexed by trace-mcp: assess risk, find candidates, check impact and rename symbols across every file without missing a reference.

    189 GitHub stars~672 tokensUpdated today
    Auto-check passed
  • trace-mcp Code Navigation

    nikolai-vysotskyi/trace-mcp

    Routes code exploration through trace-mcp's indexed dependency graph, using symbol search, outlines, call graphs and change-impact tools instead of Read, Grep and Glob.

    189 GitHub stars~354 tokensUpdated today
    Auto-check passed

Categories

Questions about trace-mcp Codemods

What does trace-mcp Codemods do?

Replaces repeated hand edits with the trace-mcp apply_codemod tool, previewing matches in a dry run before bulk mechanical changes across one file or many. Whenever the same kind of edit is about to be made twice or more, such as adding async and await to functions, updating a signature at every call site, fixing import paths after a move, wrapping calls in logging or replacing a deprecated API, the agent stops and uses apply_codemod instead of repeated Edit calls. The skill treats this as a hard rule with no exception for small jobs.

When should I use trace-mcp Codemods?

trace-mcp Codemods fits situations like: applying the same code change in many places; updating a function signature at every call site; fixing import paths after moving files; replacing a deprecated API across a repository.

How do I install trace-mcp Codemods in Claude Code?

Run `npx skills add nikolai-vysotskyi/trace-mcp --skill trace-mcp-codemod -a claude-code`. Or copy the skill folder (skills/trace-mcp-codemod in nikolai-vysotskyi/trace-mcp) into .claude/skills/trace-mcp-codemod in your project. Claude Code loads it when a task matches its description.

How do I install trace-mcp Codemods in Codex?

Run `npx skills add nikolai-vysotskyi/trace-mcp --skill trace-mcp-codemod -a codex`. Or copy the skill folder (skills/trace-mcp-codemod in nikolai-vysotskyi/trace-mcp) into .agents/skills/trace-mcp-codemod in your project. Codex loads it when a task matches its description.

Can I use trace-mcp Codemods 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 nikolai-vysotskyi/trace-mcp --skill trace-mcp-codemod -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trace-mcp-codemod, .gemini/skills/trace-mcp-codemod, .github/skills/trace-mcp-codemod and .opencode/skills/trace-mcp-codemod in your project.

What does trace-mcp Codemods need to run?

SKILL.md names no scripts, command-line tools or credentials: trace-mcp Codemods is instructions for the agent only. Our summary lists: A connected trace-mcp MCP server.

Does trace-mcp Codemods 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 trace-mcp Codemods safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does trace-mcp Codemods use?

trace-mcp Codemods is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does trace-mcp Codemods use?

About 729 tokens (SKILL.md is roughly 2.9k 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 trace-mcp Codemods?

Skills that share tags, products or a category with trace-mcp Codemods: ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Graph-Guided Safe Refactoring (tirth8205/code-review-graph, 32k stars) and ast-grep Codemod Reference (warp-drive-data/warp-drive, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains trace-mcp Codemods?

nikolai-vysotskyi (a GitHub user) maintains it in nikolai-vysotskyi/trace-mcp, which has 189 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 11, 2026.

Source: nikolai-vysotskyi/trace-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.