refactor

refactor is a skill for Claude Code, Codex from code-yeongyu/lazycodex. It costs 36 tokens per session (7,791 once invoked), scanned A, original, MIT.

A command for reorganizing existing code without changing what it is meant to do. Refactoring can include simplifying code, extracting parts, or changing its structure.

In plain words
What is it for?
Use it to clean up, restructure, simplify, extract, or modernize code.
Why use it?
It helps address tangled or repetitive code while keeping the intended behavior in focus.

Skill for Claude CodeCodex

Written for Claude Code and Codex: argument-hint in frontmatter, but also agents/openai.yaml present. Also seen: mentions subagents; names the TodoWrite tool; reads ~/.codex paths.

Good fit Use it to clean up, restructure, simplify, extract, or modernize code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/code-yeongyu/lazycodex/refactor
About the project

LazyCodex is an agent harness for working on complex codebases, combining project memory, planning, execution, and completion checks inside Codex. It is for developers who want structured, repeatable assistance when handling substantial software projects. The catalogue contains the skills, hook, and MCP integration that provide its workflow inside Codex.

code-yeongyu/lazycodex · 3,782 stars · on GitHub · lazycodex.ai

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 code-yeongyu/lazycodex --skill refactor
Clone the repo
git clone --depth 1 https://github.com/code-yeongyu/lazycodex

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 refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/code-yeongyu/lazycodex/refactor/github.svg)](https://agentmods.dev/skills/code-yeongyu/lazycodex/refactor)
Your own site
<a href="https://agentmods.dev/skills/code-yeongyu/lazycodex/refactor"><img src="https://agentmods.dev/badge/skills/code-yeongyu/lazycodex/refactor/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 refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/code-yeongyu/lazycodex/refactor"><img src="https://agentmods.dev/badge/skills/code-yeongyu/lazycodex/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,791 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 674
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Rogue Agent · line 748
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00036 $0.07791
Opus 5.5 $0.00014 $0.03116
Sonnet 5.5 $0.00007 $0.01558
Haiku 4.5 $0.00004 $0.00779

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

Security

Grade A, and why

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 16d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • refactor — 86% identical, 80 lines differ
plugins/omo/skills/refactor/SKILL.md · 780 lines

How it starts

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

Codex Harness Tool Compatibility

This skill may include examples copied from the OpenCode harness. In Codex, do not call OpenCode-only tools such as call_omo_agent(...), task(...), background_output(...), or team_*(...) literally. Translate those examples to Codex native tools:

OpenCode example Codex tool to use
call_omo_agent(subagent_type="explore", ...) multi_agent_v1.spawn_agent({"message":"TASK: act as an explorer. ...","agent_type":"explorer","fork_context":false})
call_omo_agent(subagent_type="librarian", ...) multi_agent_v1.spawn_agent({"message":"TASK: act as a librarian. ...","agent_type":"librarian","fork_context":false})
task(subagent_type="plan", ...) multi_agent_v1.spawn_agent({"message":"TASK: act as a planning agent. ...","agent_type":"plan","fork_context":false})
task(subagent_type="oracle", ...) for final verification By default, record a self-review in the notepad: re-read the diff, run diagnostics, and capture evidence for every acceptance criterion. Only when the user demanded strict, rigorous, or high-accuracy review, use multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false}); include fork_context: false.
task(category="...", ...) for implementation or QA multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","agent_type":"lazycodex-worker-medium","fork_context":false})
background_output(task_id="...") multi_agent_v1.wait_agent(...) for mailbox signals
team_*(...) Use Codex native subagents via multi_agent_v1.spawn_agent and multi_agent_v1.wait_agent; use multi_agent_v1.send_input and multi_agent_v1.close_agent only when exposed in the active tools list

Role-specific behavior must be described in a self-contained message. Use fork_context: false to start the child with only the initial prompt (no parent history); use fork_context: true only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's message. OMO installs these selectable agent roles into ~/.codex/agents/: explorer, librarian, plan, momus, metis, lazycodex-code-reviewer, lazycodex-qa-executor, and lazycodex-gate-reviewer - pass the matching name as agent_type so the child gets that role's model and instructions. Inspect the actual spawn schema: whenever agent_type is exposed, EVERY spawn MUST select an exact LazyCodex role, on V1 or V2. Implementation difficulty selects lazycodex-worker-low, lazycodex-worker-medium, or lazycodex-worker-high; clone QA can select lazycodex-clone-fidelity-reviewer. Never select generic worker or default. If a code block below conflicts with this section, this section wins.

Codex exposes ONE of two subagent tool surfaces per session; check your own tool list and route accordingly. If multi_agent_v1.* tools exist, use the table above as written. If instead a flat spawn_agent with a required task_name exists (multi_agent_v2), rewrite every multi_agent_v1.* example: multi_agent_v1.spawn_agent({...,"fork_context":false}) becomes spawn_agent({"task_name":"<lowercase_digits_underscores>","message":...,"agent_type":...,"fork_turns":"none"}) ("all" only when full parent history is truly required); send_input becomes send_message; do not call close_agent/resume_agent (finished agents end on their own; followup_task re-tasks one, interrupt_agent stops one); wait_agent takes only timeout_ms and returns on any child mailbox activity. Do not infer role support from V1/V2 or a model version. Legacy-schema exception: only if the actual schema lacks agent_type, omit that unsupported field and carry the complete role instructions in message, with history explicitly disabled. This cannot select a specialized TOML; an installed managed default supplies the medium worker for unnamed non-forks. The guard has no schema metadata and rejects unnamed calls, so report incompatible routing instead of retrying generically. Every deliberate full-history fork must still name its role: Codex skips role application on unnamed full-history forks, an upstream gap no LazyCodex default can repair. If a code block below conflicts with this section, this section wins. fork_context is rejected on multi_agent_v2 (fork_context is not supported in MultiAgentV2; use fork_turns instead).

Read the full file on GitHub · 780 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. 16d ago Changed · +1 lines 1c1e3ebfd2f1
  2. 25d ago Changed 9f68fb5e6d2b
  3. 1mo ago Changed ad0c2f791a7a
  4. 1mo ago Changed · +2 lines · +7 tokens per session 59e3f0116819
  5. 1mo ago First seen · 777 lines · 29 tokens per session scan A b60a49ea328c

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository code-yeongyu/lazycodex (3,782 stars, last pushed 3d ago), licensed MIT. It adds 36 tokens to every session and 7,791 once invoked, about $0.0001 per session on Opus 5.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.