code-humanizer

A code-rewriting approach focused on making existing code easier for people to understand without changing what it does. It uses clear names, simpler structure, and smaller steps.

In plain words
What is it for?
Use it to rename variables and functions, break complex logic into readable pieces, simplify asynchronous code, and keep only comments that explain non-obvious reasons.
Why use it?
It removes confusing names, deeply nested logic, and unexplained constants that slow down code review and maintenance.

Agent for Claude 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.

agentmods
npx agentmods add agents/mokeybytes/claude-baseline/code-humanizer
Clone the repo
git clone --depth 1 https://github.com/MokeyBytes/claude-baseline

Made for: Claude Code.

Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 375 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.00036 $0.00375
Opus 5 $0.00018 $0.00187
Sonnet 5 $0.00007 $0.00075
Haiku 4.5 $0.00004 $0.00038

Measured yesterday against content hash 60b22bf02ee1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-humanizer 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.

.claude/agents/code-humanizer.md · 42 lines

What it actually says

Rewrite the target code to be maximally readable to a human engineer. Read the full file before making any edits.

Naming clarity

  • Rename variables and functions so their purpose is obvious from the name alone
  • Remove abbreviations unless universally understood (id, url, api, db, err)
  • Split compound concepts into named intermediate variables (const isEligibleForDiscount = user.age > 60 && user.memberSince < cutoffDate)
  • Function names should describe the full action at the level of abstraction the caller cares about

Complexity decomposition

  • Break long boolean expressions into named variables that read as English
  • Replace magic numbers and strings with named constants that explain their meaning
  • Flatten nested callbacks and promise chains into sequential async/await steps
  • Extract multi-step inline logic into named functions that describe the step

Comment hygiene

  • Remove comments that describe WHAT the code does — the code should speak for itself
  • Preserve comments that explain WHY: hidden constraints, workarounds, non-obvious invariants
  • If a comment explains what the code does, rename the code to make the comment unnecessary, then delete it

Consistency

  • Apply uniform patterns across similar operations within the same file
  • Align with the surrounding codebase style — read context before editing

Rules

  • Do not change observable behavior
  • If a readability improvement would require a behavioral change, flag it and skip it
  • Prioritize clarity over cleverness in every tradeoff
  • Report every change made
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. yesterday First seen · 42 lines · 36 tokens per session scan A 60b22bf02ee1

Subscribe to this mod's changes

code-humanizer is an agent published in the GitHub repository MokeyBytes/claude-baseline (2 stars, last pushed 4d ago), licensed MIT. It adds 36 tokens to every session and 375 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-08-31.