VS Code Extensions
path-header

path-header

by ManojSharma

Insert relative file path as comment

Downloads

12

Rating

5.0 / 5 (1)

Version

1.0.0

Last updated

May 23, 2026

Automatically inserts the current file path at the top of your files as a comment.

Perfect for:

  • Large projects
  • React / Expo apps
  • Sharing screenshots
  • AI prompts
  • Faster navigation
  • Team collaboration

Features

✅ Insert relative file path as comment
✅ Supports many programming languages
✅ Auto insert on save
✅ Manual command support
✅ Keyboard shortcut support
✅ Updates existing path automatically
✅ Lightweight and fast


Example

JavaScript / TypeScript

// @path: src/components/Button.jsx

Python

# @path: app/utils/helper.py

Html

<!-- @path: public/index.html -->

Supported Languages

  1. JavaScript
  2. JSX
  3. TypeScript
  4. TSX
  5. Python
  6. Java
  7. Kotlin
  8. C
  9. C++
  10. Go
  11. Rust
  12. PHP
  13. HTML
  14. XML
  15. SVG
  16. CSS
  17. SCSS
  18. SASS
  19. LESS
  20. Shell
  21. YAML
  22. Markdown
  23. Vue
  24. Svelte
  25. SQL
  26. Lua
  27. INI
  28. ENV files and more...

Keyboard Shortcut

Windows / Linux

Ctrl + Alt + P

Mac

Cmd + Alt + P

Commands

Open Command Palette:

Insert File Path Comment

Auto Insert On Save

When enabled, the extension automatically inserts:

// @path: src/screens/HomeScreen.jsx

when you save a file.

Ignored Folders

The extension automatically ignores:

  1. node_modules
  2. .git
  3. dist
  4. build
  5. .next
  6. .expo
  7. .turbo
  8. Installation

From VSIX

Open VSCode

Go to Extensions

Click ...

Select:Install from VSIX

Select the .vsix file

Development

Install dependencies

npm install

Run extension

Press: F5 Package extension vsce package

Why Use Path Header?

In large projects, it becomes difficult to:

identify files quickly share snippets debug screenshots work with AI tools

Path Header solves this by embedding the relative file path directly inside the file.

Future Plans

Custom path formats Absolute path support Toggle auto insert Status bar controls Workspace settings Import alias support Better config file detection License

MIT License

Related extensions