Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>File Path HeaderNew to Visual Studio Code? Get it now.
File Path Header

File Path Header

Flavio Coutinho

|
2 installs
| (0) | Free
Effortlessly add relative file path headers to the top of your code files with the File Path Header extension for Visual Studio Code. This extension is designed to enhance your workflow, especially when leveraging large language models (LLMs) such as ChatGPT, Claude, and other AI assistants to write
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

File Path Header README

Portuguese (Brazil): README.pt-BR.md

Effortlessly add relative file path headers to the top of your code files with the File Path Header extension for Visual Studio Code. This extension is designed to enhance your workflow, especially when leveraging large language models (LLMs) such as ChatGPT, Claude, and other AI assistants to write and manage your code.

Features

  • Automatic File Path Headers: Automatically insert the relative path of your file as a header at the top of your code files upon opening.
  • Language Support: Supports a wide range of programming languages including JavaScript, TypeScript, Python, Java, C, C++, C#, HTML, CSS, PHP, Ruby, Perl, Lua, and many more.
  • Duplicate Prevention: Ensures the header is only added if it doesn't already exist, preventing duplicate entries.
  • Customizable Include Paths: Specify which directories should have file path headers added.

Example

Requirements

No additional requirements or dependencies are needed for this extension.

Extension Settings

This extension contributes the following settings:

  • filePathHeader.includePaths: (Default: ["src"]) - An array of paths to include for file path headers. Paths are relative to the workspace root.
  • filePathHeader.pathSeparator: (Default: "auto") - A string to define what separator to use:
    • "auto" - (use OS separator, / for Unix-based systems, \ for Windows),
    • "forward" - (/)
    • "backward" - (\).

filePathHeader.pathSeparator controls how the generated path appears in the header comment. Example for the same file path:

  • "auto": uses your OS default separator
  • "forward": src/components/Button.tsx
  • "backward": src\components\Button.tsx

By default, only files in the "src" folder will have headers added. You can customize this behavior in your VS Code settings.

How to Customize Include Paths

  1. Open VS Code Settings (File > Preferences > Settings)
  2. Search for "File Path Header"
  3. Find the "Include Paths" setting
  4. Click on "Edit in settings.json"
  5. Add or modify the filePathHeader.includePaths array. For example:
{
  "filePathHeader.includePaths": ["src", "tests", "lib"]
}

This configuration will add file path headers to files in the "src", "tests", and "lib" directories and their subdirectories.

How to Customize Separator

  1. Open VS Code Settings (File > Preferences > Settings)
  2. Search for "File Path Header"
  3. Find the "Separator" setting
  4. Click on "Edit in settings.json"
  5. Add or modify the filePathHeader.pathSeparator string. For example:
{
  "filePathHeader.pathSeparator": "forward"
}

Known Issues

There are no known issues at this time. If you encounter any problems, please open an issue on the GitHub repository.

Release Notes

1.0.1

  • Build output entry updated from extension.js to extension.cjs to fix extension activation/runtime compatibility with the current packaging setup (type: module + CommonJS bundle).
  • Added localization for extension metadata and settings/command labels (English + Portuguese/Brazilian) via package.nls files.

1.0.0

  • Initial release of File Path Header.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft