clean-code

clean-code is a skill for Claude Code from Sagargupta16/claude-skills. It costs 66 tokens per session (1,184 once invoked), scanned A, original, MIT.

A set of Python coding guidelines covering names, functions, comments, repeated code, edge cases, and tests.

In plain words
What is it for?
Use it when writing, reviewing, refactoring, or cleaning up Python code, including its tests and documentation.
Why use it?
It gives consistent ways to make Python code easier to read, change, and check as the project grows.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the clean-code plugin — 1 skill shipped together

Good fit Use it when writing, reviewing, refactoring, or cleaning up Python code, including its tests and documentation.

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

Made for: Claude Code.

Or install clean-code, the plugin that ships this one along with the rest of its 1 skill.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sagargupta16/claude-skills/clean-code.svg)](https://agentmods.dev/skills/sagargupta16/claude-skills/clean-code)
Your own site
<a href="https://agentmods.dev/skills/sagargupta16/claude-skills/clean-code"><img src="https://agentmods.dev/badge/skills/sagargupta16/claude-skills/clean-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,184 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.
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.00066 $0.01184
Opus 5 $0.00033 $0.00592
Sonnet 5 $0.00013 $0.00237
Haiku 4.5 $0.00007 $0.00118

Measured 7d ago against content hash a2c783dc9082, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

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

plugins/clean-code/skills/clean-code/SKILL.md · 117 lines

How it starts

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

Clean Code (Python)

"Always leave the campground cleaner than you found it." — Robert Baden-Powell

"Always check a module in cleaner than when you checked it out." — Robert C. Martin, Clean Code

Rule Chapters

Load the chapter that matches the work. Rule IDs (N1, C5, G25, F3, T9...) are defined in these files:

Chapter When
references/full-catalog.md Reviewing any Python -- the complete rule index (master)
references/names.md Naming variables, functions, classes, modules
references/comments.md Writing or editing comments and docstrings
references/functions.md Creating or refactoring functions
references/general.md Code quality review -- DRY, intent, abstractions
references/tests.md Writing or reviewing tests

The Philosophy

You don't have to make every module perfect. You simply have to make it a little bit better than when you found it.

If we all followed this simple rule:

  • Our systems would gradually get better as they evolved
  • Teams would care for the system as a whole
  • The relentless deterioration of software would end

When Working on Code

Every time you touch code, look for at least one small improvement:

Quick Wins (Do These Immediately)

  • Rename a poorly named variable → references/names.md
  • Delete a redundant comment → references/comments.md
  • Remove dead code or unused imports
  • Replace a magic number with a named constant
  • Extract a deeply nested block into a well-named function

Deeper Improvements (When Time Allows)

Read the full file on GitHub · 117 lines

Files

What ships with it

6 files 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.

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. 7d ago First seen · 117 lines · 66 tokens per session scan A a2c783dc9082

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository Sagargupta16/claude-skills (5 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 1,184 once invoked, about $0.0003 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-31.