ashlr-cost-refactor

ashlr-cost-refactor is a skill for Claude Code from ashlrai/ashlr-plugin. It costs 62 tokens per session (694 once invoked), scanned A, original, MIT.

A set of cost-conscious practices for refactoring code, such as checking the current diff, finding references, and grouping edits.

In plain words
What is it for?
Use it for structural renames, reference updates, and multi-file refactors where minimizing token use matters.
Why use it?
It reduces repeated file reads and tool calls during renames and other code changes while keeping the refactoring process organized.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the ashlr plugin — 11 skills, 36 commands, 5 agents, 7 hooks, 1 MCP server shipped together

Good fit Use it for structural renames, reference updates, and multi-file refactors where minimizing token use matters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashlrai/ashlr-plugin/ashlr-cost-refactor
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 ashlrai/ashlr-plugin --skill ashlr-cost-refactor
Clone the repo
git clone --depth 1 https://github.com/ashlrai/ashlr-plugin

Made for: Claude Code.

Or install ashlr, the plugin that ships this one along with the rest of its 11 skills, 36 commands, 5 agents, 7 hooks, 1 MCP server.

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 ashlr-cost-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashlrai/ashlr-plugin/ashlr-cost-refactor.svg)](https://agentmods.dev/skills/ashlrai/ashlr-plugin/ashlr-cost-refactor)
Your own site
<a href="https://agentmods.dev/skills/ashlrai/ashlr-plugin/ashlr-cost-refactor"><img src="https://agentmods.dev/badge/skills/ashlrai/ashlr-plugin/ashlr-cost-refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 694 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.00062 $0.00694
Opus 5 $0.00031 $0.00347
Sonnet 5 $0.00012 $0.00139
Haiku 4.5 $0.00006 $0.00069

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

Security

Grade A, and why

ashlr-cost-refactor 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 7d 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.

skills/ashlr-cost-refactor/SKILL.md · 51 lines

How it starts

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

Ashlr Cost Refactor

A structured discipline for refactoring tasks that minimizes token spend without sacrificing correctness.

Rules (active when this skill is enabled)

1. Diff first

Before editing anything, run ashlr__diff or ashlr__diff_semantic to understand what already changed (staged/unstaged). This prevents redundant edits to files that are already in the state you want.

2. Structural edits for renames

When renaming a symbol, type, or file — use ashlr__edit_structural instead of search/replace. Structural edit finds all references in one pass and renames them correctly, including imports and re-exports.

3. Find all refs, then one ashlr__multi_edit per file

Before editing a file, run ashlr__grep to find all references. Then apply all changes to that file in a single ashlr__multi_edit call. Do not make sequential single edits to the same file — each one burns a full round-trip.

4. No re-reads between edits in a sequence

Once you've read a file and know its structure, proceed through your edit sequence without re-reading. ashlr__edit and ashlr__multi_edit return diffs that confirm each change — that's sufficient to continue.

5. One ashlr__genome_propose at the end

After the refactor is complete and stable, write one genome proposal summarizing the entire change: what was renamed/moved, why, and the affected file paths. Do not propose mid-refactor.

6. Verify with ashlr__bash not Read

After a refactor, confirm with bun run typecheck or bun test via ashlr__bash. Do not re-read edited files to verify — the typecheck output is authoritative and far cheaper.

Sequence template

1. ashlr__diff_semantic()             — see what's already changed
2. ashlr__grep("OldName|oldFn")       — find all refs
3. ashlr__edit_structural(...)        — rename symbols
   OR ashlr__multi_edit([...])        — batch all edits per file
4. ashlr__bash("bun run typecheck")   — verify, not Read
5. ashlr__genome_propose(summary)     — one proposal at the end

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

Subscribe to this mod's changes

ashlr-cost-refactor is a skill published in the GitHub repository ashlrai/ashlr-plugin (3 stars, last pushed 7d ago), licensed MIT. It adds 62 tokens to every session and 694 once invoked, about $0.0003 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.