Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PathCommenterNew to Visual Studio Code? Get it now.
PathCommenter

PathCommenter

Creatasy Studio

|
126 installs
| (1) | Free
Add File Path Comment Automatically adds a file path comment at the top of each file if not present and Generate File Tree generates file structure tree.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PathCommenter

PathCommenter is a Visual Studio Code extension that automatically adds a file path comment at the top of each file if not present. It also provides a command to generate a file structure tree and copy it to the clipboard.

example py (1)

This is particularly useful when working with ChatGPT or other AI-based code assistants. By automatically adding file path comments and generating file structure trees, it provides context about the file's location within the project. This context helps ChatGPT better understand the structure and organization of your project when you copy and paste code for assistance or debugging.

https://marketplace.visualstudio.com/items?itemName=CreatasyStudio.path-commenter

Features

  • Add File Path Comment: Automatically adds a file path comment at the top of each file when the file is saved.
  • Generate File Tree: Generates a file structure tree from the open folder (or a specified subfolder) and copies it to the clipboard.
  • Ignore Patterns: Allows specifying files and folders to be ignored when generating the file tree and adding file path comments.

Commands

  • path-commenter.addFilePathComment: Adds a file path comment to the top of the current file.
  • path-commenter.generateFileTree: Generates a file structure tree and copies it to the clipboard.

Usage

  1. Add File Path Comment: This command runs automatically when you save a file. You can also trigger it manually from the Command Palette (Ctrl+Shift+P) by typing "Add File Path Comment".
  2. Generate File Tree: Run this command from the Command Palette (Ctrl+Shift+P) by typing "Generate File Tree". Optionally, specify a subfolder to generate the tree from that subfolder.

Configuration

To specify files and folders to be ignored, add them in the vs code extension settings (PathCommenter Configuration)

Installation

  1. Download and install the extension from the Visual Studio Code Marketplace.
  2. Reload VS Code to activate the extension.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft