code-clean

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

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/termio-sh/termio/code-clean
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.

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. 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.00110 $0.01775
Opus 5 $0.00055 $0.00888
Sonnet 5 $0.00022 $0.00355
Haiku 4.5 $0.00011 $0.00178

Measured 2d ago against content hash 1ff886f0845a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (359 stars, last pushed 2d ago), licensed MIT. It adds 110 tokens to every session and 1,775 once invoked, about $0.0006 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-08-30.

Related

Other skills, from other repositories

argent-device-interact

Interact with an iOS simulator, Android emulator, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking…

software-mansion/argent · 73 tokens

argent-settings-permissions

Grant, deny, or reset an app's runtime permissions (camera, microphone, photos, contacts, notifications, calendar, location, location-always, media-library, motion, reminders) on an iOS simulator or Android device using the argent settings-permissions tool - without navigating the system Settings UI. Use when the…

software-mansion/argent · 140 tokens

argent-lens

Propose multiple visual design variants for on-screen elements and let the human pick in the Argent Lens window. Use when the user asks for design alternatives / options / A-B choices for a screen or component, or any time you have produced more than one candidate look for an element and want a human decision before…

software-mansion/argent · 67 tokens

argent-test-ui-flow

Autonomously test an app UI (iOS or Android) by running interact-screenshot-verify loops using argent MCP tools. Use when testing UI flows, verifying login works, testing navigation, running end-to-end UI test scenarios, manual QA steps, visible UI changes, or visual behavior.

software-mansion/argent · 64 tokens

argent-screenshot-diff

Compare saved or live app screenshots with the argent screenshot-diff tool. Use when testing visual regressions, before/after UI comparisons, screenshot diff checks, visible layout, spacing, color, typography, clipping, overflow, text rendering, or image/icon rendering changes.

software-mansion/argent · 59 tokens

argent-react-native-profiler

Profile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/after a fix, spotting slow components, diagnosing re-renders, checking CPU hotspots, or producing a ranked issue report.

software-mansion/argent · 57 tokens