ralphctl-code-simplification

ralphctl-code-simplification is a skill for Claude Code, Codex from lukas-grigis/ralphctl. It costs 115 tokens per session (1,268 once invoked), scanned A, original, MIT.

A method for making existing code easier to understand without changing what it does. It reduces unnecessary nesting, unclear names, duplication, dead code, and indirection one step at a time while keeping the existing tests passing.

In plain words
What is it for?
Use it when cleaning up or refactoring working code. It helps simplify the code touched by a change while checking that the same inputs still produce the same results.
Why use it?
Refactoring can accidentally change outputs, errors, side effects, or their order. This approach limits changes to behaviour-preserving simplifications and avoids cleanup when the code is not understood.

Skill for Claude CodeCodex

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

Good fit Use it when cleaning up or refactoring working code. It helps simplify the code touched by a change while checking that the same inputs still produce the same results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lukas-grigis/ralphctl/ralphctl-code-simplification
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 lukas-grigis/ralphctl --skill ralphctl-code-simplification
Clone the repo
git clone --depth 1 https://github.com/lukas-grigis/ralphctl

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 ralphctl-code-simplification

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/lukas-grigis/ralphctl/ralphctl-code-simplification"><img src="https://agentmods.dev/badge/skills/lukas-grigis/ralphctl/ralphctl-code-simplification.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,268 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.00115 $0.01268
Opus 5.5 $0.00046 $0.00507
Sonnet 5.5 $0.00023 $0.00254
Haiku 4.5 $0.00012 $0.00127

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

Security

Grade A, and why

ralphctl-code-simplification 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 6d 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.

src/integration/ai/skills/bundled/ralphctl-code-simplification/SKILL.md · 101 lines

How it starts

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

Code Simplification

Adapted from addyosmani/agent-skills — "Code Simplification" (MIT). Adapted for ralphctl's harness contract.

Simplify by reducing complexity while preserving behaviour exactly. The goal is not fewer lines — it is code a new reader understands faster than the original. Every simplification passes one test: would someone new to this code follow the result more easily?

When this applies

  • Execute — when the task asks for a refactor or cleanup, simplify the task's own new code before the completion checks, never as a separate pass after them — unless the task is itself a refactor. Simplification outside the task's scope is a finding to surface, not an edit to make — record it in a note signal when the prompt's output-contract section lists it; otherwise fold it into the required signal's own fields.

When not to use: the code is already clear; you do not yet understand what it does; the simpler form is measurably slower on a hot path; the module is about to be replaced.

Principles

  1. Preserve behaviour exactly. Same outputs for every input, same errors, same side effects and their order. The existing tests pass without modification. If you are not sure a change preserves behaviour, do not make it.
  2. Follow the project's conventions. Read the project's context file when present and the neighbouring code; simplification that breaks local consistency is churn.
  3. Clarity over cleverness. A chain of nested conditional expressions becomes early returns or a lookup; a dense chained transform with inline logic becomes a named intermediate step.
  4. Keep the balance. Do not inline a helper that gives a concept its name, merge unrelated logic into one function, or remove an abstraction that exists for testability. Line count is not the measure.
  5. Scope to what changed. Default to the code the task touched.

The process

1. Understand before touching (Chesterton's fence)

Read the full file on GitHub · 101 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. 6d ago Changed · -1 tokens per session f46859380320
  2. 1mo ago First seen · 101 lines · 116 tokens per session scan A f1b9f4166b79

Subscribe to this mod's changes

ralphctl-code-simplification is a skill published in the GitHub repository lukas-grigis/ralphctl (24 stars, last pushed today), licensed MIT. It adds 115 tokens to every session and 1,268 once invoked, about $0.0005 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-10-18.

Related

ralphctl-code-simplification compared with skills from other repositories

ralphctl-code-simplification next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ralphctl-code-simplificationlukas-grigis/ralphctlSkill24todayMITA115Claude Code, Codex
atomic-debugdamusix/atomic-claudeSkill117yesterdayMITA114Claude Code, Codex
sipcode-regressAnuj7411/sipcodeSkill471mo agoMITA105Claude Code
debug-my-harnesszernie/vigilesSkill18todayMITA114Claude Code
linter-docszernie/vigilesSkill18todayMITA125Claude Code
sonar-manage-findingsNick2bad4u/SonarCloud-SkillSkill2yesterdayUnlicenseA46Codex
troubleshoot-tervaterva-sh/tervaSkill5yesterdayMITA83Claude Code, Codex