elegant-code

elegant-code is a skill for Claude Code from athola/claude-night-market. It costs 37 tokens per session (2,031 once invoked), scanned A, original, MIT.

A method for writing the smallest code change that still handles normal cases, edge cases, and failures safely.

In plain words
What is it for?
It guides the addition of functions, files, classes, abstractions, or dependencies, and helps audit changes for code that can be removed.
Why use it?
It helps avoid both unnecessary complexity and overly short solutions that leave important behavior unhandled.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the conserve plugin — 15 skills, 6 commands, 5 agents shipped together

Good fit It guides the addition of functions, files, classes, abstractions, or dependencies, and helps audit changes for code that can be removed.

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

Made for: Claude Code.

Or install conserve, the plugin that ships this one along with the rest of its 15 skills, 6 commands, 5 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/athola/claude-night-market/elegant-code"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/elegant-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,031 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.00037 $0.02031
Opus 5 $0.00018 $0.01015
Sonnet 5 $0.00007 $0.00406
Haiku 4.5 $0.00004 $0.00203

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

Security

Grade A, and why

elegant-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/conserve/skills/elegant-code/SKILL.md · 202 lines

How it starts

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

Elegant Code

Write the minimal, elegant code that fully solves the problem: its performance, its edge cases, and its failure cases. Minimal is not fewest lines. It is no incidental complexity, with nothing essential omitted.

What this skill is (and is not)

This skill codifies a discipline that strong models already exhibit some of the time. Its value is not teaching a missing capability. Its value is three things:

  1. A shared vocabulary (the rungs, the floor) that review skills can point at, so "you skipped rung 2" is a concrete, auditable note.
  2. Consistency: the ladder is applied every time, not just when the model happens to think of it.
  3. A guard: the negligence floor below is never traded away for brevity.

It is the generative counterpart to the review-side contract in leyline:additive-bias-defense.

When To Use

  • Before adding a function, file, class, abstraction, or dependency.
  • When choosing between reuse and writing new code.
  • When auditing a diff for lines that can be deleted.

When NOT To Use

  • Throwaway scripts or one-time migrations where review cost is near zero.
  • Cases where the negligence floor (below) is in play: there, add the guard first and optimize length second.

The Decision Ladder

Walk the rungs in order. Climb down only when the current rung does not hold. Stop at the first rung that solves the problem.

# Rung Ask Stop here when Example
1 Need-to-exist Does this need to exist at all? The requirement is speculative or already met. Delete or defer. "Config loader for a value used once" -> inline the value
2 Builtin / stdlib Can a language builtin or the standard library do it? The stdlib covers it. str.zfill, f"{n:05d}", pathlib, itertools
3 Native platform Is there a native platform or framework feature? The platform already ships it. URLSession retry, fetch, framework validators
4 Installed dependency Is an already-installed, audited dependency enough? A dep in the lockfile covers it. reuse requests/urllib3 backoff before adding tenacity
5 A few lines Can it be one line or a small explicit block? A short, obvious block solves it. a 20-line retry loop over a retry framework

Read the full file on GitHub · 202 lines

Files

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.

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 · 202 lines · 37 tokens per session scan A 48d53a1c599f

Subscribe to this mod's changes

elegant-code is a skill published in the GitHub repository athola/claude-night-market (337 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 2,031 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

explainer

Reviewable git hygiene for work you're about to commit or open a PR for. Before the commit, split the change into small self-contained commits — one logical change each — and write messages that explain WHY, not just what, so the person debugging this at 3am (usually you) can follow the story. Structure the diff so a…

ccplugins/awesome-claude-code-plugins · 155 tokens

historian

Chesterton's Fence for code you're about to delete or refactor. Before you rip out a weird retry, a seemingly dead branch, an ugly workaround, or a "redundant" check whose purpose isn't obvious — find out why it exists first. git blame it, find the callers, read the linked issue/PR/commit. If you can't explain why the…

ccplugins/awesome-claude-code-plugins · 184 tokens

chameleon

Match the house style when adding code to an existing codebase. Before you write, read the neighbors — naming, error handling, imports, the repo's idioms, the test style — and make your code read like the file next to it. Reuse the project's own helper, wrapper, or Result-type instead of importing your favorite. New…

ccplugins/awesome-claude-code-plugins · 168 tokens

fact-checker

Anti-hallucination discipline for any code that names an external symbol you aren't certain exists — a library function, method, config key, package version, CLI flag, env var, or endpoint. Before you call it, cite it, or import it, confirm it's real: grep the codebase, read the installed package's actual signature…

ccplugins/awesome-claude-code-plugins · 178 tokens

claudex-second-opinion

Suggests a cross-model second opinion after substantial or risky code changes. Use when a significant implementation, refactor, security-sensitive change, or uncertain bug fix has just been completed and is about to be committed or shipped. Advisory only — it recommends running /claudex:verdict; it never invokes Codex…

ccplugins/awesome-claude-code-plugins · 74 tokens

code-quality

Multi-language code quality standards and review for TypeScript, Python, Go, and Rust. Enforces type safety, security, performance, and maintainability. Use when writing, reviewing, or refactoring code. Includes review process, checklist, and Python PEP 8 deep-dive.

georgekhananaev/claude-skills-vault · 61 tokens