A JetBrains IDE plugin that copies file/folder references in the @path#Lx-y mention format used by
Claude Code and similar agents, directly from the editor or the project tree.
It is a module-aware fork of
copy-path-for-claude-code: the original
resolves paths against the single project directory and falls back to a bare file name outside it,
which makes same-named files across modules indistinguishable (@AdManagerApiServiceImpl.java#L84-88).
This plugin keeps the module / content-root prefix so references stay unambiguous in multi-module
projects.
- Copy references in
@module/path/to/file#Lx-yformat. - Module-aware path resolution (anchors on the project directory, then the owning module / content root, and finally the absolute path) so files never collapse to a bare name.
- No selection: copies the line the cursor is on (
@path#Lx). - Text selection: copies the selected line range (
@path#Lx-y). - Multi-caret: each caret becomes a separate reference.
- Multi-file selection from the project tree: copies all paths at once.
- Spaces in the path are automatically wrapped in quotes (
@"my file.ts"). - Directories get a trailing slash (
@src/components/). - Optional trailing space and configurable separator (space / newline) for multiple references.
- Configurable path base:
Content root(recommended) orProject directory(legacy). - Balloon notification with adjustable duration.
- Works in all JetBrains IDEs (2024.1+).
- Keyboard shortcut:
Alt+C(⌥C on macOS). - Editor context menu: right-click → Copy Path for Agent.
- Project tree context menu: right-click a file/folder → Copy Path for Agent.
Settings → Tools → Copy Path for Agent
- Path base — how the relative path is computed (default: Content root).
- Append trailing space — add a space after the copied reference.
- Multiple references separator — Space or Newline.
- Show notification / duration — balloon behavior.
Requires JDK 17.
./gradlew buildPluginThe installable zip is produced at build/distributions/copy-path-idea-1.0.0.zip.
Install it from Settings → Plugins → ⚙ → Install Plugin from Disk.