humncode is a CLI tool designed to transform AI-generated code comments into natural, human-like developer comments. It breaks the predictable statistical patterns of Large Language Models (LLMs) to help code pass through AI detectors and blend in with manual commits.
The tool processes code through a modular pipeline consisting of four specialized layers:
- Cleaner Layer: Strips AI-typical verbosity (e.g., "This function is responsible for..."), removes emojis, emoticons, and redundant numbered lists (e.g., "1. First, we...").
- Jargon Layer: Replaces formal terminology with industry-standard developer shorthand (e.g.,
database→db,parameters→params,authentication→auth). - Styler Layer: Introduces "human noise" by randomly adjusting capitalization, removing trailing periods, and occasionally injecting developer tags like
TODO:orFIXME:. - Recursive Processing: Automatically detects code files within directories and processes them in-place.
humncode detects comment syntax based on file extensions:
- Python (
.py) - C / C++ (
.c,.cpp,.h,.hpp) - JavaScript / TypeScript (
.js,.jsx,.ts,.tsx) - Java (
.java) - Rust (
.rs) - PHP / Ruby / Go
- Clone the repository to your local machine.
- Ensure you have
pythonandpipinstalled. - Install the package globally for your user:
pip install --user .- Make sure
~/.local/binis in your$PATH.
You can process a single file or an entire project directory.
Process a single file:
humncode main.cProcess a directory (recursively):
humncode ./src/# 1. 🚀 This function is used to perform the configuration of the database.
def setup_connection():
pass# config the db
def setup_connection():
pass.
├── layers/
│ ├── cleaner.py # Removes AI fluff and emojis
│ ├── jargon.py # Maps formal words to dev slang
│ └── styler.py # Adds randomness and style tweaks
├── tests/ # Pytest suite
├── main.py # CLI entry point
└── setup.py # Installation script
To verify the transformation logic and ensure the regex patterns are working correctly:
python3 -m pytest -vThis tool is intended for stylistic formatting and educational purposes. Always ensure your code comments remain clear and useful for your team. Use responsibly in academic or professional environments.