ase-code-refactor

A code-refactoring skill for changing an existing codebase while tracking the request as a distinct task.

In plain words
What is it for?
Starting code cleanup or restructuring work after the user describes what should change.
Why use it?
It gives vague refactoring requests a defined task identity and asks for details when the requested change is unclear.

Skill for Claude CodeCodex

View the source file rse/ase
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.

agentmods
npx agentmods add skills/rse/ase/ase-code-refactor
Any agent
npx skills add rse/ase --skill ase-code-refactor
Clone the repo
git clone --depth 1 https://github.com/rse/ase

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,196 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00026 $0.02196
Opus 5 $0.00013 $0.01098
Sonnet 5 $0.00005 $0.00439
Haiku 4.5 $0.00003 $0.00220

Measured 2d ago against content hash 3bcb3ac94ec6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ase-code-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 2d 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.

plugin/skills/ase-code-refactor/SKILL.md · 233 lines

How it starts

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

@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md

$ARGUMENTS

@${CLAUDE_SKILL_DIR}/../../meta/ase-format-task.md @${CLAUDE_SKILL_DIR}/../../meta/ase-tenets.md @${CLAUDE_SKILL_DIR}/../../meta/ase-common-code.md

Procedure

    1. Set (set task id to request) and (set request empty), call the ase_task_id(id: "<ase-task-id/>", session: "<ase-session-id/>") tool from the ase MCP server to switch the task, and then only output the following :

    2. Set and and call the ase_task_id(id: "<ase-task-id/>", session: "<ase-session-id/>") tool from the ase MCP server to implicitly switch the task. Do not output anything.

    3. **No refactoring details known yet. What is the refactoring you want to request?**

      Then set to the response of the user.

    4. Set to a unique task id, derived from , which consists of two lower-case words concatenated with a - character. Then call the ase_task_id(id: "<ase-task-id/>", session: "<ase-session-id/>") tool from the ase MCP server to implicitly switch the task. Do not output anything.

    5. Report the task and request with the following :

    6. Figure out what the artifact refactoring is about.

    7. Ask the user for clarification if the goal of this refactoring is too unclear.

    8. Do not output anything else in this step, unless you asked the user.

Read the full file on GitHub · 233 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 233 lines · 26 tokens per session scan A 3bcb3ac94ec6

Subscribe to this mod's changes

ase-code-refactor is a skill published in the GitHub repository rse/ase (47 stars, last pushed 4d ago), licensed Apache-2.0. It adds 26 tokens to every session and 2,196 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories