reduce-complexity

reduce-complexity is a skill for Claude Code, Codex from fmind/dot. It costs 38 tokens per session (678 once invoked), scanned A, original, MIT.

A structured cleanup pass for removing unnecessary complexity from a codebase while keeping its behavior tested. It looks for dead code, duplicate logic, unused dependencies, stale configuration, and overly large or abstract designs.

In plain words
What is it for?
Use it to delete unused code, remove dependencies, combine duplicated logic, flatten needless abstractions, simplify conditions, and clean up obsolete tasks.
Why use it?
It reduces the amount of code and configuration developers must understand and maintain. It prioritizes changes by likely benefit and verifies the project after each cleanup.

Skill for Claude CodeCodex

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/fmind/dot/reduce-complexity
Any agent
npx skills add fmind/dot --skill reduce-complexity
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

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 reduce-complexity

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/reduce-complexity.svg)](https://agentmods.dev/skills/fmind/dot/reduce-complexity)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/reduce-complexity"><img src="https://agentmods.dev/badge/skills/fmind/dot/reduce-complexity.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 678 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.00038 $0.00678
Opus 5 $0.00019 $0.00339
Sonnet 5 $0.00008 $0.00136
Haiku 4.5 $0.00004 $0.00068

Measured yesterday against content hash c82292bb2c63, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reduce-complexity 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.

skills/reduce-complexity/SKILL.md · 36 lines

How it starts

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

Reduce Complexity

A repeatable pass that removes accidental complexity from a codebase: measure, delete, flatten, verify. repository-review produces the candidate list read-only, project-health is the full refresh this pass belongs to, and improve-docs is the same pass for documentation.

Workflow

  1. Measure: largest files (wc -l over tracked sources), duplicated blocks (rg for repeated signatures), unused dependencies and exports, and config files nothing reads.
  2. Use the language linters: golangci-lint (unused, gocyclo), ruff (F401, C901), knip for TypeScript, and mise tasks for orphan tasks.
  3. Sort by payoff: rank candidates by lines removed per risk; start with dead code and unused dependencies (zero behavior change), then duplication, then abstractions with a single implementation.
  4. Delete before abstracting: a helper used once is inlined; an interface with one implementation becomes the concrete type; a flag nobody sets is removed with its branches.
  5. Flatten: deep package trees become flat packages; nested conditionals become early returns; configuration replaces hard-coded branches.
  6. Verify each step: mise run check and mise run test after every logical removal, so a regression is attributable to one change.
  7. Report: before and after counts (files, lines, dependencies, tasks), what was removed and why, and anything intentionally kept.

Gotchas

  • Behavior is the contract: public APIs, CLI flags, and on-disk formats change only with the user's agreement.
  • Tests are not debt: never delete a failing test to simplify; fix or replace it per test-driven-development.
  • One theme per commit: when asked to commit, group by removal theme (refactor: or chore:) so each commit reverts cleanly.

Documentation

Read the full file on GitHub · 36 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 · 36 lines · 38 tokens per session scan A c82292bb2c63

Subscribe to this mod's changes

reduce-complexity is a skill published in the GitHub repository fmind/dot (4 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 678 once invoked, about $0.0002 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-09-03.