
Clear Comments is a Visual Studio Code and Cursor IDE extension designed to help you quickly remove comments from any code — including comments generated by ChatGPT or other AI tools.

Note: Use Clear Comments to clean up generated code: if you paste in code scaffolded by ChatGPT (or any AI), simply invoke Clear Comments to eliminate all AI-generated commentary and get straight to the logic.
Cursor IDE Support: This extension is fully compatible with Cursor IDE, providing the same powerful comment removal functionality in your AI-powered development environment.
The extension processes the currently open document—or one or more files selected in the Explorer—using a simple mapping of language IDs to comment tokens. It removes entire lines that are solely comments and, when appropriate, strips out inline comment portions (only if the code before the comment marker is empty or ends with a semicolon (;
) or a closing brace (}
)).
If you try to run Clear Comments on a file whose language isn’t supported, the extension will inform you via an information message.
Features
- Supported Languages: JavaScript/TypeScript/TSX, C/C++/C#, Dart, VB, HTML/ASPX, and many more.
- Inline Comment Removal: Strips inline comments when safe (ends with
;
or }
).
- Non-destructive Editing: Applies changes in memory; review before saving.
- Categories: Code Cleanup, Tools, Productivity, Formatter
- Tags:
comments
, cleanup
, AI
, ChatGPT
, code
, vscode
, cursor
, developer-tools
, productivity
Usage
- In the Explorer view, right-click on one or more files.
- Select Clear Comments from the context menu.
- Review changes in memory; save manually if desired.
Using the Command Palette
- Open the file you want to process.
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
on macOS).
- Type Clear Comments and select the command.
- Review changes in memory; save manually if desired.
Supported File Types
- C / C++:
.c
, .cpp
, .h
- C#:
.cs
- CoffeeScript:
.coffee
- Dart:
.dart
- F#:
.fs
- Go:
.go
- Handlebars:
.hbs
- HTML / ASPX:
.html
, .aspx
- Jade / Pug:
.jade
, .pug
- Java:
.java
- JavaScript:
.js
- Less:
.less
- Lua:
.lua
- Makefile:
Makefile
- PHP:
.php
- Rust:
.rs
- SCSS:
.scss
- ShaderLab:
.shader
- Shell / Bash:
.sh
- Swift:
.swift
- TypeScript / TSX:
.ts
, .tsx
- VB:
.vb
- XML / XSL:
.xml
, .xsl
- YAML:
.yml
, .yaml
If the language of the file is not supported by the extension, an information message will inform you, and no changes will be made.
Logging and Debugging
During processing, the extension logs key events and actions to the Developer Tools console. You can view these logs by opening Help > Toggle Developer Tools in the Extension Development Host. This is useful for understanding how your code is being processed and for troubleshooting any issues.
Contribution
Contributions, bug reports, and feature requests are welcome!
If you have suggestions or improvements, please open an issue or submit a pull request at our GitHub repository.
License
This extension is licensed under the ISC License.