Skip to content
Back to skills

Lessloc

ASecurity

Find, review or remove code a codebase does not need (duplicates, copies under other names, dead code, needless abstractions, files, folders, comments, dependencies) without changing behavior. Use for "audit", "find bloat", "consolidate", "slim this", "reduce LOC", "what can I delete", "review this change", "does this already exist", /lessloc.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 22, 2026
ai-agentsgonodegitapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 22, 2026

npx -y skills add rextail-ai/lessloc --skill lessloc --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lessloc?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lessloc
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rextail-ai-lessloc/badge)](https://www.skillsdirectory.com/skills/rextail-ai-lessloc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lessloc
description: Find, review or remove code a codebase does not need (duplicates, copies under other names, dead code, needless abstractions, files, folders, comments, dependencies) without changing behavior. Use for "audit", "find bloat", "consolidate", "slim this", "reduce LOC", "what can I delete", "review this change", "does this already exist", /lessloc.
argument-hint: "[setup | audit [path] | review [git ref] | consolidate | find <words>]"
disable-model-invocation: true
---

The CLI is `node "${CLAUDE_PLUGIN_ROOT}/lessloc.mjs"`. Its numbers are facts; do not recount by hand.

- **setup** ("set up lessloc for this project"): run `init`. It writes nothing into the repository, only git hooks for this clone. Show the user the test command it found: a passing run of it is what marks an agent's final state verified. Offer `init --rules` (rules in AGENTS.md for other AI tools) only if the user uses tools without lessloc's hooks, and say that the file is shared with everyone who works on the project. Finish with `doctor`, in plain words. `remove` undoes it all.
- **find**: `find <what it does>` lists existing definitions that may already do it, by name; then search for code named differently too.
- **audit**: `audit <path> --json --tools` (`--tools` adds knip, vulture, cargo-machete, deadcode and installed vulnerability scanners). Then find what the tool cannot see: code the standard library or an installed dependency already provides, defensive code for cases that cannot happen, responsibilities split across folders that always change together, made-up APIs and unpinned versions, over-mocked tests, answers hard-coded to fixtures, data shapes duplicated with renamed fields, and dead code kept behind a guard or flag. Similar-looking code is a duplicate only if it serves the same responsibility.
- **review**: `check --base <ref> --json` (no ref: the uncommitted work), then the same semantic pass on the changed code and its callers.
- **consolidate**: the deletion pass agents never do on their own. Run `audit --json`, take the biggest safe cuts (duplicate blocks, definitions with the same body, unreferenced definitions after checking dynamic use, if-chains a table replaces, swallowed errors, comment blocks whose decisions belong in DECISIONS.md), in small steps with `test` after each, then rerun the audit. Shrink without removing tests, logging or error handling. Stop when the next cut needs a tradeoff or cannot be verified; "nothing further justified" is a valid result. Finish with `baseline` so the ratchet locks the gain in.

Every finding names a location, the concrete cut, the lines saved, and why behavior stays the same. Never cut what RULES.md says never to cut: correctness, security, tests or anything the user asked for (see "What lessloc never pushes an agent toward" in PATTERNS.md). No style taste. Report numbered findings, biggest safe saving first, one line each: `N. path:lines: cut → −X lines (risk)`, ending with `Total: −X lines, −Y files, −Z dependencies` and what you did not check. For audit and review, change nothing until the user picks numbers.

Files in this skill

  • SKILL.md3.1 KB
  • agents/openai.yaml134 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.