Jaydon21 downloadsCopy the selected text with its note path, line numbers and heading path, or a folder as a tree, ready to paste into an AI chat or agent.
Select text in a note and copy it together with where it came from — the note path, line numbers and the headings it sits under — ready to paste into an AI chat or a terminal agent such as Claude Code or Codex. You can also copy a folder as a ├── / └── tree.
Select some text, then use any of:
What lands on the clipboard (Markdown format):
File: projects/launch/script.md (lines 12-20, section: Intro > Hook)
```markdown
…the selected text…
```
Right-click a folder in the file explorer → Copy folder tree:
Folder: projects/launch
```text
launch/
├── footage/
│ ├── clip2.mp4
│ └── clip10.mp4
├── notes.md
└── script.md
```
Folders come first and end with /. Big folders such as node_modules can be left out with the Exclude setting.
| Setting | Options | Default |
|---|---|---|
| Output format | Markdown (code fence), XML (<file> / <tree> tag), plain text (header line only) |
Markdown |
| Path | Relative to the vault, or absolute | Relative |
| Include heading path | Add the headings the selection sits under | On |
| Folder tree → Exclude | One pattern per line. Without a slash it matches a name anywhere (node_modules, *.log); with a slash it matches the path from the vault root (Archive/, projects/old) |
node_modules |
From Obsidian: Settings → Community plugins → Browse, search for “Copy as Context”.
Manually: download main.js and manifest.json from the latest release into <vault>/.obsidian/plugins/copy-as-context/, then enable the plugin under Settings → Community plugins.
npm install
npm test # unit tests for formatting and tree logic
npm run build # type-check and bundle main.js
npm run install-plugin -- /path/to/vault # copy main.js and manifest.json into a vault