English | 简体中文
A Claude Code / OpenCode skill that removes signs of AI-generated code from a codebase while preserving behavior. It is the code-focused companion to the prose humanizer skill, with one non-negotiable difference: code has to keep working, so verification is built into the workflow.
AI-generated code has a fingerprint: redundant comments, decorative banners, emoji, dictionary-length names, reflexive try/except, defensive null-guards in places that cannot fail, tiny single-use functions, speculative abstraction, dead code, and a suspiciously uniform shape. This skill rewrites those tells into the style a competent human on your team would use, without changing what the code does.
It runs a test-guarded detect-modify-verify loop:
- Scope and safety net (Phase 0). Map the functional contract, enumerate the edge cases that must keep working, run the existing tests for a green baseline, and write tests to fill any gaps. These tests are the arbiter for everything that follows.
- Detect. Scan for AI tells, looking for clusters and style fractures rather than isolated patterns.
- Modify. Rewrite flagged code into the surrounding codebase's style. Behavior-preserving changes only.
- Verify. Re-run the suite after every change. If a test goes red, a "defensive" block was actually load-bearing: restore it, or move the check to the system boundary where it belongs.
Repeat until there are no remaining tells and the full suite is green.
The prime directive: never trade correctness for naturalness. The tests, not a gut feeling, decide whether a guard is slop or a safeguard.
mkdir -p ~/.claude/skills
git clone https://github.com/Ruiqi-Yan/HumanizeCode.git ~/.claude/skills/humanize-codeOr copy the skill file manually:
mkdir -p ~/.claude/skills/humanize-code
cp SKILL.md ~/.claude/skills/humanize-code/mkdir -p ~/.config/opencode/skills
git clone https://github.com/Ruiqi-Yan/HumanizeCode.git ~/.config/opencode/skills/humanize-code/humanize-code
Clean up the AI tells in src/auth/ — keep the behavior identical and the tests green.
Or ask directly:
Humanize the code in this module: remove the AI patterns but don't change what it does.
The skill will establish a test baseline first, then work through the detect-modify-verify loop and report which "defensive" blocks turned out to be real safeguards.
24 numbered patterns across six groups. Examples in the skill span Python and JavaScript/TypeScript; the patterns are language-agnostic.
- Redundant comments that restate the code
- Over-structured docstrings and headers on everything
- Decorative comment dividers and banners
- Emoji in code, comments, and docs
- Exhaustive project-structure trees with file icons
- Diff-anchored comments that narrate a change
- Over-descriptive, dictionary-length names
- Generic placeholder names and leftover scaffolding
try/exceptaround code that cannot fail- Over-broad exception catching that swallows errors
- Reflexive null-guards and default-value fallbacks
- Field-name guessing
- Excessive type and argument validation in internal code
- Over-decomposition into tiny single-use functions
- Speculative abstraction and unrequested design patterns
- Suspiciously uniform shape
- Dead code, redundant helpers, and unused imports
- Non-idiomatic solutions
- Over-engineered scaffolding for trivial scripts
- Commit messages
- PR descriptions
- Unrequested README sections
- Hallucinated and undeclared dependencies (slopsquatting)
- Style fractures
Over-correcting code is worse than over-correcting prose, because you can break it. The skill deliberately preserves:
- Defensive code at real boundaries (HTTP params, user input, third-party responses, env vars).
- Comments that explain a genuine why.
- Type annotations and descriptive names that match the project's conventions.
- Test code (legitimately uniform and repetitive).
- Framework-required boilerplate and machine-generated files.
- A single isolated tell. It looks for clusters, not one-offs.
This skill is under active testing and iteration. Its reliability has not yet been fully established, and it may produce false positives or remove code incorrectly. Use it with caution. The patterns, workflow, and exit criteria are still being refined against real codebases, so expect changes. Bug reports, new pattern examples, and pull requests are very welcome.
This skill builds directly on the prose-focused humanizer skills, and adapts their structure and philosophy to code:
- blader/humanizer — the original "remove signs of AI writing" skill.
- op7418/Humanizer-zh — the Chinese adaptation.
The pattern catalog synthesizes observations from many write-ups, studies, and community discussions on AI-generated code. Thanks to all of the authors below for documenting these patterns:
Spotting AI-written code (code-review perspective)
- Mohamed Abdullah, "Signs: How to Spot AI-Written Code in the Wild" — https://mdxabu.github.io/techlog/ai-patterns/
- DEV.to (dev_tips), "Was this Python written by a human or an AI? 7 signs to spot LLM-generated code" — https://dev.to/dev_tips/was-this-python-written-by-a-human-or-an-ai-7-signs-to-spot-llm-generated-code-3370
- Data World, "How to Spot LLM-Generated Python Code at a Glance" — https://dataaaworld.com/2025/06/24/how-to-spot-llm-generated-python-code-at-a-glance/
- California Learning Resource Network, "How to tell if code is AI generated?" — https://www.clrn.org/how-to-tell-if-code-is-ai-generated/
- EONSR, "Identifying code written by bots: A guide for tech leads" — https://eonsr.com/en/identifying-code-written-by-bots-a-guide-for-tech-leads/
- Markaicode, "Code Review 2025: 5 AI Methods to Automatically Detect Bad Code" — https://markaicode.com/ai-code-review-tools-2025/
- 知乎, "什么样的代码一看就知道是 ai 写的?" — https://www.zhihu.com/question/1950828034
- CSDN, "判断1个代码是人写出来的还是AI主笔的" — https://blog.csdn.net/weixin_62528784/article/details/148076388
- CSDN, CodeT5-Authorship 模型转述 — https://blog.csdn.net/zxj007008/article/details/148933981
LLM code quality, smells, and technical debt
- Sonar, "Research report on coding behavior of large language models" — https://www.shcsinfo.com/eb-documentazione-tecnica/sonar-releases-research-report-on-coding-behavior-of-large-language-models
- HackerNoon, "Can LLMs Generate Quality Code? A 40,000-Line Experiment" — https://hackernoon.com/can-llms-generate-quality-code-a-40000-line-experiment
- TechDebt.works, "AI Slop: The New Technical Debt" — https://techdebt.works/ai-slop/
- Darren Redmond, "Does AI Coding Reduce or Increase the Need for Uncle Bob and Clean Code?" — https://darrenredmond.com/blog/2025/09/16/does-ai-coding-reduce-or-increase-the-need-for-uncle-bob-and-clean-code/
- 腾讯新闻, 威斯康星大学 AI 代码迭代研究转述 — https://news.qq.com/rain/a/20260403A07D1100
- The Moonlight, "A Causal Perspective on Measuring, Explaining and Mitigating Smells in LLM-Generated Code" — https://www.themoonlight.io/zh/review/a-causal-perspective-on-measuring-explaining-and-mitigating-smells-in-llm-generated-code
- CSDN, "代码洁净,模型更优:通过清理代码气味提升大语言模型性能" — https://lishizheng.blog.csdn.net/article/details/152417810
Defensive-coding overuse and over-engineering
- 掘金, "AI 为什么总喜欢写防御性代码?" — https://juejin.cn/post/7649421430309224486
- 掘金, "给 Codex 戴上紧箍,治一治 AI 的过度发挥" — https://juejin.cn/post/7646728363235983401
- 掘金, "让 AI 做 Code Review,别把整个项目都扔过去" — https://juejin.cn/post/7644745124401774634
- 今日头条, "AI 编程催生可丢弃临时缓存代码:靠工具+纪律破局" — http://www.toutiao.com/a7652533245174743593
- 腾讯新闻, "暴涨 33.5k Star!AI 编程精简神器开源" — https://news.qq.com/rain/a/20260619A068CE00
- MEXC, "Comments, Naming, and Abstractions in the AI Era" — https://www.mexc.co/en-NG/news/425241
- Aide Hub, "如何有效审查 AI 生成的 .NET 代码" — https://aidehub.top/posts/reviewing-ai-generated-code-in-dotnet
- 2048AI, "在 AI 生成代码的洪流中,如何守护软件的可维护性与架构美感?" — https://2048ai.net/68d4eae08867235e13886efb.html
Hallucinated dependencies (slopsquatting)
- The Register, "AI code suggestions sabotage software supply chain" — https://www.theregister.com/AMP/2025/04/12/ai_code_suggestions_sabotage_supply_chain/
- FOSSA, "Slopsquatting: AI Hallucinations and the New Software Supply Chain Risk" — https://www.fossa.io/blog/slopsquatting-ai-hallucinations-new-software-supply-chain-risk/
- Snyk, "Slopsquatting: New AI Hallucination Threats & Mitigation Strategies" — https://www.snyk.com/articles/slopsquatting-mitigation-strategies/
- arXiv, "Importing Phantoms: Measuring LLM Package Hallucination Vulnerabilities" — https://arxiv.org/html/2501.19012
Behavioral guidelines that informed the workflow
- forrestchang/andrej-karpathy-skills, CLAUDE.md — https://github.com/forrestchang/andrej-karpathy-skills