code-clean

code-clean is a skill for Claude Code, Codex from termio-sh/termio. It costs 110 tokens per session (1,775 once invoked), scanned A, original, MIT.

A code-cleanup procedure for termio, a Swift codebase, that finds unused code and comments that have become too long. It checks the changes with a build and accounts for known false alarms from its analysis tools.

In plain words
What is it for?
Use it on the current branch's changes to find unreachable Swift symbols and oversized comments, then verify the cleanup builds.
Why use it?
It focuses cleanup on the kinds of clutter this repository actually has, instead of treating every comment or debug-looking line as a problem. It also helps avoid breaking the project while removing code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it on the current branch's changes to find unreachable Swift symbols and oversized comments, then verify the cleanup builds.

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

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 code-clean

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/termio-sh/termio/code-clean"><img src="https://agentmods.dev/badge/skills/termio-sh/termio/code-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,775 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 pass 7 Sept 2026
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.00110 $0.01775
Opus 5.5 $0.00044 $0.00710
Sonnet 5.5 $0.00022 $0.00355
Haiku 4.5 $0.00011 $0.00178

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

Security

Grade A, and why

code-clean 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 1mo 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.

skills/code-clean/SKILL.md · 151 lines

How it starts

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

Code Clean

Two passes over termio's Swift: dead code (symbols nothing reaches) and over-long comments (prose that outgrew what it explains). Both end in a build. Neither is a refactor.

This is not a generic AI-slop sweep. Run one on this repo and it finds nothing: a 2026-08 survey of all 69k tracked Swift lines turned up 1 TODO (a false match on an mktemp template), 0 commented-out code blocks, and 1 deliberate debug print. Don't spend the pass hunting those. The bloat here is shaped differently, and §2 is where it lives.

Scope

Default to the current branch's diff against origin/main. A whole-tree pass is a standing request only — say so, and expect it to take real time.

Never touch:

  • Sources/termio/Editor/Highlightr/ — vendored; upstream API surface is kept intact on purpose (AGENTS.md).
  • Anything under skills/ recorded in skills-lock.json — re-pull from upstream instead of hand-editing.
  • ios/build/, ios/build-sim/ — Xcode artifacts, not tracked source. They hold ~100k lines of SPM checkouts that will swamp any tree-wide grep. Scope greps with git ls-files, never bare find ios.

1. Dead code

periphery scan --targets termio (SPM; no config file needed). It is installed at /opt/homebrew/bin/periphery.

Roughly three of every four hits are false. Four shapes account for nearly all of them — clear each before deleting anything:

  1. Retain-holders. private var toolbarDelegate / menuBar / hookListener / linkClickMonitor / scanTask / stream / source / window. Flagged assignOnlyProperty, but holding the reference is the job — drop the property and the object deallocates and the feature dies. App.swift says so in comments ("must be retained").
  2. Equatable / Hashable key-struct fields. Read only through the synthesized == / hash(into:), which periphery cannot see. BranchModel's GitState spells out why its field exists: so a same-HEAD refresh is recognized as a no-op.
  3. @objc selector-target sender: parameters. The AppKit selector signature requires them.
  4. Vendored code. See Scope.

Read the full file on GitHub · 151 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. 1mo ago First seen · 151 lines · 110 tokens per session scan A 1ff886f0845a

Subscribe to this mod's changes

code-clean is a skill published in the GitHub repository termio-sh/termio (548 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 1,775 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

simplify

Review recent code changes for reuse, code quality, and efficiency, then directly apply straightforward cleanup improvements. Use when the user wants a post-implementation cleanup pass, pre-PR polish, or asks to simplify/refine recent changes. Invoke with /simplify or /simplify .

QwenLM/qwen-code · 63 tokens

triage

Gatekeep and review GitHub issues and pull requests for Qwen Code maintainers. Use for GitHub Action issue triage, PR admission checks, product-direction review, KISS-focused PR review, and staged bilingual GitHub comments.

QwenLM/qwen-code · 50 tokens

autofix

Review and repair current local changes until they converge, or run Qwen Code Autofix issue and review workflows from GitHub Actions.

QwenLM/qwen-code · 30 tokens

find-simplifications

Use for a periodic repo-wide sweep of qwen-code for accumulated excess surface — dead components and files, orphaned locale keys, exports nothing consumes, added-then-removed scaffolding — filing candidates on a tracking issue and landing only what a maintainer has said yes to. Repo-wide and evidence-first; every…

QwenLM/qwen-code · 103 tokens

pr-council-review

Multi-dimensional LLM council review of an open PR (default) or a local feature branch (§ 8 branch mode, invoked via /gflow:branch-review). Five baseline dimensions (correctness, quality, security, tests, memory-hygiene) plus adaptive dimensions per surface (transports / data / CLI / docs / auth / BDD / scripts /…

ffroliva/gflow-cli · 125 tokens

check

Auto-fix lint and formatting, then report types and tests. Run before every commit.

ffroliva/gflow-cli · 20 tokens