ralphctl-code-simplification

ralphctl-code-simplification is a skill for Claude Code, Codex from lukas-grigis/ralphctl. It costs 116 tokens per session (1,253 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 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,253 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.00116 $0.01253
Opus 5.5 $0.00046 $0.00501
Sonnet 5.5 $0.00023 $0.00251
Haiku 4.5 $0.00012 $0.00125

Measured yesterday against content hash f1b9f4166b79, 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 yesterday.

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, and after a change works, on the code that change touched. 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)

Before changing or removing anything, know why it exists: its responsibility, its callers and callees, its edge cases and error paths, the tests that pin its behaviour, and why it might have been written this way (a performance constraint, a platform quirk, history visible in git log or git blame). If you cannot answer these, read more first.

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. yesterday 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 116 tokens to every session and 1,253 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

Other skills, from other repositories

atomic-debug

Hypothesis-driven debugging skill. Use when a bug, test failure, crash, or unexpected behavior is reported. Auto-trigger on error pastes or "broken/doesn't work/failing" language. Explicit invocation: /atomic-debug. Output: symptom statement → hypothesis table → cheapest test first → root cause. No symptom-patching.…

damusix/atomic-claude · 114 tokens

sipcode-regress

Check the user's own local Claude Code and Codex logs for regressions after an update (prompt-cache misses, 5-minute cache TTL, uncached context, hourly cache rebuilds, Codex usage limit draining faster per token) and pin each one to the version that introduced it, using the Sipcode CLI. Use when the user asks whether…

Anuj7411/sipcode · 105 tokens

system-health

Suggest whether the machine needs a DISK or MEMORY cleanup — and catch the case where Heimdall ITSELF is the hog (runaway orphaned python from the presence keeper). Use when the machine is slow / swapping / laggy, disk or "System Data" is full, memory is exhausted, at the start of a long session, or when the user asks…

randomittin/heimdall · 102 tokens

debug-my-harness

Diagnose why an agent harness misbehaved by reading the local flight-recorder ledger (.vigiles/runs.jsonl) — which skills fired or got hijacked, which hooks blocked or wrongly allowed, which subagent tool-contract violations happened, and how a skill's trigger rate moved. Use when asked why a skill stopped firing, why…

zernie/vigiles · 114 tokens

linter-docs

Deep linter reference for authoring or debugging a vigiles enforce() rule — plugin tables, AST selectors, type-aware rules, auto-fix, and edge cases for ESLint, Ruff, Pylint, RuboCop, Stylelint, and Clippy. Use when you need the exact rule name or config for a specific linter, not for running a linter. (JVM/Go linters…

zernie/vigiles · 125 tokens

rca

Disciplined root-cause analysis for diagnosing why something is broken. Use whenever the user is debugging a bug, regression, incident, outage, flaky or intermittent behavior, a failing test, or asks "why is X happening" / "why did this break" / "whats causing this" — even if they never say the words "root cause." It…

FlorinI/Florians-Claude-Code-Kit · 174 tokens