★ C R A P C O M M E N T N U K E R ★
interactive comment stripper that cannot eat code
Igh bro, now, what code base files / type are we taking the trash out of
| |
| TRASH |
| ONLY |
|_______|
//_________________________________________
//| Co-Authored by Anthropic's Claude Code |
//|________________________________________|
___
\
\ O
\/|\
| \
/ \
/ \
> [x] javascript [detected: 3 files] [acorn] .js .cjs .mjs .jsx
[x] python [detected: 1 file] [tree-sitter] .py
[ ] kotlin [tree-sitter] .kt .kts
...
ccn walks a directory of source files and nukes comments. One block at a time,
on a cleared screen, you decide Y/N. HTML, MD, JSON, TXT, and everything it
does not recognize is never touched.
It speaks 9 languages, the ones with a real parser behind them, not a regex guess. JavaScript is the default. Every other language is the same idea bolted onto a different parser.
The whole pitch is one sentence: it cannot eat your code. a write gate re-parses the file and bounces any edit that moves a single token, and comments aren't tokens. your code stays put.
javascript typescript tsx
python java kotlin rust
c c++
Each one covers its variants and skids: javascript covers js, cjs, mjs,
esm, jsx. c++ covers cxx, cc, hpp, hh. kotlin covers kt, kts.
JavaScript (and cjs, mjs, esm, jsx) is grounded in acorn, the JS
engine's own parser family. that's the oracle, and it's the sharpest. Every other
language is grounded in tree-sitter, which gives the same three things from a
real AST: comment spans (so a // inside a string or a # in a Python string
literal is never mistaken for a comment), a validity check, and a leaf-token
invariant.
Pick the language with --lang, or let ccn detect it from the directory. If
the directory is mixed and you are on a TTY, it asks:
Type the code language to nuke comments from (eg, JavaScript, CJS, ESM, TypeScript, Python, Java, Kotlin, Rust, C, C++):
Non-JS languages need their grammar on the first run. ccn says so and asks
before it pulls anything:
Nuking python comments needs the python AST parser (python). Download? Y/N
One fetch, cached in ~/.config/ccn/grammars, offline forever after.
npm install -g commentnukerOr clone and run it in place. Deps auto-install on first launch if they are
missing (acorn for JS, web-tree-sitter for everything else):
git clone <this repo> ccn
cd ccn
node bin/ccn ./src # js, auto-detected
node bin/ccn ./src --lang c++ # nuke c++ comments (yes, "c++" resolves, not c)No network after the one-time fetches. JS runs offline forever after; each new non-JS language pulls its grammar once, then offline forever after.
Linux and macOS, solid. Windows... "Might not work for windows, idek guys I
tried 🥀". Paths are path.join'd, the home dir falls back to USERPROFILE,
and node is spawned directly (no shell shenanigans), so on paper it should
run. If it doesn't, put in a complaint on the GitHub, I'll fix it.
Just run it. No arguments, no commands to remember, it drops you straight into the menu and walks you through the rest:
ccn # the hub: nuke, recap, or wipe history
ccn ./src # skip the hub, start at the language menu
ccn ./src --lang python # skip hub + language, straight to the quip + picker
ccn --langs # list every supported language
ccn ./src --dry-run --remember # rehearse, record choices, write nothing
ccn ./src --demo --limit 5 # auto-Y preview, 5 blocks a fileRun ccn with nothing and you land on the main menu, not a usage error:
★ Crap Comment Nuker ★
what are we doing?
> take out the trash (nuke a codebase)
recap -- previously nuked codebases & the comments
delete recap storage & disable this feature
exit
Pick take out the trash and you go straight into the directory + language flow described below. recap is the history. delete recap storage wipes it and flips recording off (same slot flips it back on).
Every real nuke (not a dry run, not a file the safety gate refused) gets logged
to ~/.config/ccn/recap.json. Open recap from the hub and you get:
Previously, you nuked these codebases
pick one to see the comments we nuked together
> my-app (3 nuked, javascript, 2026-08-01)
cli (12 nuked, javascript, 2026-07-30)
back to main menu
Drill into one and every comment you removed is listed, file + line, enter to
read it in full. It is a look-back, not an undo, the comments are already gone
from your code (a .bak was left next to each rewritten file).
Recap is on by default. The hub toggle wipes the storage and turns recording off, or turns it back on. The last 200 sessions are kept, oldest fall off.
Interactive nukes go through four screens after the hub. (Pass a dir as the
first arg to skip the hub and screen 0; pass --lang to skip screens 0 and 1.)
Screen 0, the directory menu. Where's the codebase? A list of likely dirs
(the current dir, your Desktop, and any subdirs that actually contain code),
plus a type a path manually option. Arrow keys to pick, or type one yourself.
Skipped if you pass a dir on the command line.
Screen 1, the language menu. Pick one language or many. Detected languages
are highlighted in green and pre-checked, so a mixed codebase is handled in one
run. Each comment gets gated by the parser for its own language, so a JS file
goes through acorn and a Python file through tree-sitter in the same pass. a
selects all, space toggles, enter confirms (needs at least one).
Igh bro, now, what codebase files / type are we taking the trash out of
| |
| TRASH |
| ONLY |
|_______|
//_________________________________________
//| Co-Authored by Anthropic's Claude Code |
//|________________________________________|
___
\
\ O
\/|\
| \
/ \
/ \
> [x] javascript [detected: 3 files] [acorn] .js .cjs .mjs .jsx
[x] python [detected: 1 file] [tree-sitter] .py
[ ] kotlin [tree-sitter] .kt .kts
...
Screen 2, the quip + the method + proceed. A one-liner about the language
you picked (Java gets the real lore, the rest get the same posture), then exactly
how the comments get stripped for that engine, then proceed? Y/n. Non-JS
languages ask to pull their grammar here if it is not cached yet.
Screen 3, the per-comment picker. Every comment block (a contiguous run
of // lines, one /* */, or a # run) gets its own cleared screen:
- green
This might belong here-- the block sits above a method, class, or const declaration, carries an@marker, or has aTODO,FIXME,HACK, orNOTE. It still asks:nuke anyway? Y/N. You decide. It just warns louder. - red
Found a big one-- a multi-line block. - red
Yo found a comment to nuke-- everything else.
y or enter to nuke, n to keep, m for the simulurity menu, ctrl-c to bail
(it saves memory first).
Hit m on any comment and you drop into the cluster view. Every comment in the
codebase that is >= --sim cosine-similar to the one you are on gets grouped
under it, the shared rules they all break get listed, and you decide for the
whole group at once:
✦ SIMULURITY ✦ baseline-driven cluster
your entry:
"TODO refactor this later, hacky"
2 other comments across the codebase are >=0.75 similar to it.
these ALL break the same rules: TODO, single-line, trailing
> strip em all (3 comments)
pick which ones
set baseline only, keep reviewing
nuke EVERYTHING remaining in the codebase (47 comments)
back to manual
- strip em all: nuke the whole cluster in one move.
- pick which ones: multi-select, toggle individual comments with space.
- set baseline only: keep this comment as the reference and go back to manual one-by-one review.
- nuke EVERYTHING remaining: straight nuke every comment left in the codebase. up to you.
- back to manual: return to the per-comment picker.
The gate runs on every write regardless of how the comment got picked, so the cluster path cannot eat code any more than the manual path can.
| flag | what it does |
|---|---|
--lang <name> |
pick the language (js, python, c++, java, ...). js is default. skips screen 1 |
--langs |
list every supported language and its engine, then exit |
--remember |
persist every choice to ~/.config/strip-review/memory.json |
--dry-run |
review only, never write (choices still recorded with --remember) |
--demo |
auto-Y every manual prompt, no TTY needed (also auto-resolves the menus) |
--limit N |
cap blocks reviewed per file |
--sim 0.75 |
cosine similarity bar for the simulurity cluster |
--no-sim |
turn clustering off (the m menu still opens, just matches nothing) |
--fdelay MS |
delay between files (default 50) |
--cdelay MS |
delay per block (default 150) |
With --remember, an exact match to a choice you already made is auto-applied
on later runs (the brain). It still shows you it did it. "Might belong" blocks
are never auto-applied, they always ask.
So the workflow is: dry-run with --remember once to teach it your taste, then
the real run is mostly automatic. It still cannot eat code, because the gate
runs every time regardless of what memory says.
I mean the source code is RIGHT HERE dawg, don't tell me you can't trust a comment nuker... You being paranoid about something that nukes comments while running Claude Code without the FA proxy already tells us, you're paranoid about being spied on or ratted, when it's too late, you already are, you did it to yourself, all because you trusted a corporation.
You gunna trust Boris Cherny who hides behind 5 legal teams? Or you gunna trust the comment stripper made by a guy you can talk to on instagram @larp_init?
Ight thought so, go nuke those retarded comments AI left megabytes of in your code base, you're welcome.
Issues, complaints, feature requests: the GitHub repo. End users can put in complaints on the GitHub xD, that's what it's there for.
Find it, use it, index it.
comment-remover strip-comments comment-stripper remove-comments
delete-comments comment-cleaner code-cleanup code-hygiene
dead-code-removal dead-comments ai-comments claude-comments
copilot-comments co-authored-by-remover co-authored-by ast tree-sitter
acorn parser refactoring-tool developer-tools cli interactive
source-code-cleanup javascript-comment-remover python-comment-remover
typescript-comment-remover rust-comment-remover java-comment-remover
kotlin-comment-remover c-comment-remover cpp-comment-remover
todo-remover fixme-remover hack-remover documentation-cleanup
code-stripper comment-nuker crap-comment-nuker lint review hardwick
GitHub topics: comment-remover code-cleanup tree-sitter acorn ast
developer-tools cli refactoring dead-code co-authored-by
openSource★. See LICENSE.md. Source-available, not OSI open
source. Read it, run it, learn from it. Commercial use needs a separate license
from Hardwick Software Services.
You may keep your source code private and utilize this tool so long as attribution is made.
Attribution: "Built with Crap Comment Nuker from justcalljon.pro". Other forms of acceptable attribution: "Built with Comment Nuker from justcalljon.pro" "We utilized Comment Nuker from justcalljon.pro"
I get it if you don't want to use the word "crap" on your company's code base or attribute with that. Attribution still required because real humans built it. Kthx :0
-- Hardwick