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.
npx skills add rshankras/claude-code-apple-skills --skill code-sizegit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote 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.
[](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/code-size)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/code-size"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/code-size/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.
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/code-size"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/code-size.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00051 | $0.00998 |
| Opus 5.5 | $0.00020 | $0.00399 |
| Sonnet 5.5 | $0.00010 | $0.00200 |
| Haiku 4.5 | $0.00005 | $0.00100 |
Grade A, and why
code-size 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.
How it starts
The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Size & Complexity Limits
Complexity is the strongest single predictor of defect density, and code written by agents balloons fastest — an agent under pressure adds one more branch to an existing function far more readily than it extracts a new one. These five SwiftLint threshold rules are the deterministic cap: they keep functions small enough that tests can actually cover their branches, and they keep agents from wrangling with their own tangles.
When This Skill Activates
Use this skill when:
- Setting up quality gates for a project where agents write most of the code
- A review keeps flagging "this function is too long/branchy" by hand
- Functions have grown past what their tests plausibly cover
- Adopting the deterministic gauntlet (see
testing/fitness-functions/)
The Rules
The fragment at rules/swiftlint.yml configures five built-in SwiftLint rules (all enabled by default in SwiftLint — this fragment sets the thresholds):
| Rule | Warning | Error | What it caps |
|---|---|---|---|
cyclomatic_complexity |
10 | 20 | Independent paths through one function |
function_body_length |
50 | 100 | Lines per function body |
type_body_length |
300 | 500 | Lines per type body |
file_length |
500 | 1000 | Lines per file |
function_parameter_count |
5 | 8 | Parameters per function |
Merge the fragment into the project's .swiftlint.yml (alongside any opt_in_rules/custom_rules fragments already adopted).
Brownfield Adoption: Baseline, Never Mass-Refactor
Turning these rules on in an existing codebase must not trigger a refactoring spree — bulk rewrites to satisfy a linter are how working code gets broken. Freeze today's violations and gate only new ones:
# One-time: record existing violations (SwiftLint 0.55+)
swiftlint lint --write-baseline .swiftlint-baseline.json
# The gate from then on — fails only on NEW violations
swiftlint lint --strict --baseline .swiftlint-baseline.json
Commit .swiftlint-baseline.json. Shrink it opportunistically: when touching a baselined function for other reasons, fix its violation and regenerate the baseline in the same commit.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday First seen · 81 lines · 51 tokens per session scan A 9d1cf30e0f6f
code-size is a skill published in the GitHub repository rshankras/claude-code-apple-skills (864 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 998 once invoked, about $0.0002 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-11-05.
code-size compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-sizershankras/claude-code-apple-skills | Skill | 864 | 2d ago | MIT | A | 51 | Claude Code |
| make-pr-easy-to-reviewmichael-denyer/pstack-claude | Skill | 4.1k | yesterday | MIT | A | 57 | Claude Code |
| review-workcode-yeongyu/oh-my-openagent | Skill | 71k | yesterday | none | A | 63 | Claude Code, Codex |
| security-reviewwaybarrios/opencode-power-pack | Skill | 551 | 4d ago | MIT | A | 64 | Claude Code |
| review-checklistwesammustafa/Claude-Code-Everything-You-Need-to-Know | Skill | 3.5k | 3d ago | none | A | 25 | Claude Code, Codex |
| reviewdevoxx/DevoxxGenieIDEAPlugin | Skill | 687 | yesterday | MIT | A | 90 | Claude Code |
| apex-reviewtonone-ai/tonone | Skill | 77 | 23d ago | MIT | A | 46 | Claude Code |