---
title: "Comment Removal"
description: "Repomix can automatically remove comments from your codebase when generating the output file. This can help reduce noise and focus on the actual code."
type: skill
canonical_url: https://claudary.paisolsolutions.com/skills/comment-removal-1
source: "Claudary"
difficulty: intermediate
author: "Claude Code Knowledge Pack"
date: 2026-07-10T11:18:31.733Z
license: CC-BY-4.0
attribution: "Comment Removal — Claudary (https://claudary.paisolsolutions.com/skills/comment-removal-1)"
---

# Comment Removal
Repomix can automatically remove comments from your codebase when generating the output file. This can help reduce noise and focus on the actual code.

## Overview

# Comment Removal

Repomix can automatically remove comments from your codebase when generating the output file. This can help reduce noise and focus on the actual code.

## Usage

To enable comment removal, set the `removeComments` option to `true` in your `repomix.config.json`:

```json
{
  "output": {
    "removeComments": true
  }
}
```

## Supported Languages

Repomix supports comment removal for a wide range of programming languages, including:

- JavaScript/TypeScript (`//`, `/* */`)
- Python (`#`, `"""`, `'''`)
- Java (`//`, `/* */`)
- C/C++ (`//`, `/* */`)
- HTML (`<!-- -->`)
- CSS (`/* */`)
- And many more...

## Example

Given the following JavaScript code:

```javascript
// This is a single-line comment
function test() {
  /* This is a
     multi-line comment */
  return true;
}
```

With comment removal enabled, the output will be:

```javascript
function test() {
  return true;
}
```

## Notes

- Comment removal is performed before other processing steps, such as line number addition.
- Some comments, such as JSDoc comments, may be preserved depending on the language and context.

## Related Resources

- [Code Compression](/guide/code-compress) - Further reduce token count by extracting code structure
- [Configuration](/guide/configuration) - Set `output.removeComments` in your config file
- [Command Line Options](/guide/command-line-options) - Use `--remove-comments` flag

---

Source: [Claudary](https://claudary.paisolsolutions.com/skills/comment-removal-1) · https://claudary.paisolsolutions.com
