Mohan Das Adhikari45 downloadsSee where attachments are used, find broken attachment links, and repair them one at a time after reviewing the exact change.
See where every attachment in your vault is used. Find broken attachment links, and repair them safely, one at a time.
Install · Quick start · Guide · What gets scanned · FAQ · Support
| 🔍 Scanning never changes files | Attachment Lens only reads your vault until you choose Apply repair. |
| ✋ Nothing happens automatically | No replacement is ever chosen for you. You pick it, review it, then apply it. |
| 🎯 One reference per repair | A repair changes the characters of one link in one file. Everything else stays as it is, down to spacing and line endings. |
| 🛡️ Checked before and after writing | If the note changed since you looked at the preview, nothing is written. After writing, the file is read back to confirm the result. |
| ↩️ Undo that survives a restart | Undo last repair puts the original text back, also after you close Obsidian. It refuses if you've edited the file since, so newer work is never overwritten. |
| 📎 Attachments are never touched | No renaming, moving or deleting of attachment files, ever. |
| 🔒 Private | No network requests, no accounts, no telemetry. |
The quickest way: open Attachment Lens in the Community directory and choose Add to Obsidian. Obsidian opens the plugin's page, where you choose Install, then Enable.
Or from inside Obsidian:
Attachment Lens needs Obsidian 1.14 or newer on Windows, macOS or Linux. A mobile version is planned.
main.js, manifest.json and styles.css..obsidian/plugins/attachment-lens/ (if you renamed Obsidian's configuration folder, use that instead of .obsidian).Click the paperclip in the left ribbon, or run Attachment Lens: Open from the command palette (Ctrl/Cmd+P). The panel opens as a tab. Choose Scan vault.
The scan reads your notes, properties, Canvas boards and bases. It runs in small steps, so you can keep working, and Cancel scan stops it at any time. After the first scan, the results follow your changes automatically.
| Part | What it's for |
|---|---|
| Search | Type part of a file name or folder. Ctrl/Cmd+F jumps here. |
| Filters | All attachments, Broken references, No references detected and Uncertain references, each with a live count. |
| All types and Sort | Show only images, PDFs, audio, video, documents or archives, and sort by name, folder, size, date or number of references. |
| The list | Every attachment with its folder, size and number of references. Click a row or use the arrow keys. |
| Details | A preview for images, the path (with a copy button), type, size and date, and every place the file is used. Open source takes you to the exact line. |
Choose Broken references. Each row is a file that's linked somewhere but doesn't exist. Select one, then choose Repair… on the reference you want to fix.
Pick the file you meant. Suggestions are ranked by how similar their names and folders are, and each one says why it's there, for example Same name, .jpg instead of .jpeg. If the right file isn't listed, search all attachments underneath. When you've chosen, select Review change.
The review dialog shows exactly what will change, highlighted in context. Nothing is written yet. Choose Apply repair to write it, or Back to choose another file.
The banner confirms the repair was checked after writing. Changed your mind? Choose Undo repair.
| Filter | Shows |
|---|---|
| All attachments | Every attachment in the vault. |
| Broken references | Links to attachments that don't exist, grouped by the missing file. The count is the number of broken links. |
| No references detected | Attachments that nothing links to, as far as Attachment Lens can see. This doesn't prove a file is unused, because some places (such as HTML tags or plugin code) aren't scanned. See What gets scanned. |
| Uncertain references | Plain text that looks like a file name but isn't a link, such as a banner: dune.jpg property that a theme reads. |
When a link is broken, Attachment Lens compares the missing name with every attachment in the vault. It looks at:
.jpeg and .jpg,photo 1.png, photo-copy.png),results-table-v2 and results-table-v3,Each suggestion shows the reasons that apply. A file of a different type is marked in orange. Similar names are a hint, not proof, so check the preview before you choose.
| Line | Meaning |
|---|---|
| Source | The note, board or base that contains the link, and where in it (a line, a property, a Canvas card or a Bases formula). |
| Reference | The kind of link: an embed or link in wikilink or Markdown style, a property, a Canvas card, a Bases function. |
| Original target | What the link points at now, marked Missing. |
| New target | The file you chose. |
| Written as | How the new link will be spelled. It keeps your style: a short name stays short, a relative path like ../images/x.png stays relative, and a full path stays full. If a short name would open a different file with the same name, the full path is used and the dialog tells you why. |
| File type | Whether the type changes, for example from a PDF to an image, which changes how an embed looks. |
| The change | The surrounding lines, with the removed and added characters highlighted. Sizes like |400, captions, aliases and #page=3 links are kept. |
| Checks | What was confirmed: the file hasn't changed, the new file exists, and the new link opens it. These run again at the moment of writing. |
If a Canvas board or base is open in a tab, close it first: an open board can save over changes made outside it. The dialog tells you when that's needed and has a Check again button.
Some values look like file names without being links, such as banner: dune-cover.jpg in a note's properties. Obsidian doesn't treat these as links, but a theme or plugin might read them. Attachment Lens lists them as uncertain and can repair them too, after you tick I confirm this property refers to an attachment.
If a file couldn't be read completely, such as a Canvas board with invalid JSON or a base with formulas computed at runtime, an orange banner says so. Show details lists each file and what was skipped. That's why files without references are labelled No references detected in supported sources and not "unused".
Drag the tab into a sidebar like any other view. In a narrow panel the list and the details take turns: press Enter or click a row to open the details, and Back to list (or Escape) to return. From the file explorer, right-click an attachment and choose Show in Attachment Lens.
| Key | Does |
|---|---|
| Ctrl/Cmd+F | Jump to search |
| ↑ ↓, Home, End, Page Up, Page Down | Move through the list |
| Enter | Open the details of the selected file |
| Escape | Close the picker, go back to the list, or close the review dialog without writing |
| ↑ ↓ in the suggestions | Choose a different file |
| Tab | Move between buttons, filters and menus |
The review dialog starts with nothing focused, so writing always takes a deliberate Tab to Apply repair and Enter.
| Command | Does |
|---|---|
| Attachment Lens: Open | Opens the panel, or switches to it |
| Attachment Lens: Scan vault | Scans, or scans again |
| Attachment Lens: Show broken references | Opens the panel on the broken links |
| Attachment Lens: Undo last repair | Undoes the most recent repair |
| Setting | Does |
|---|---|
| Excluded folders | Folders to leave out, one per line, such as Templates. Obsidian's configuration folder and .trash are always left out. |
| Number of suggestions | How many possible replacements to show, from 3 to 10. |
| Scan when the panel opens | Results are kept in memory, so after restarting Obsidian you scan again. Turn this on to do it automatically. |
| Where | Examples | Counted as |
|---|---|---|
| Notes | ![[photo.png]], ![[photo.png|300]], [[paper.pdf#page=3|p. 3]], , , [fig]: images/fig.png |
Links |
| Properties | cover: "[[photo.png]]", and lists of links |
Links |
| Properties | Plain text such as banner: dune.jpg |
Uncertain |
| Canvas boards | File cards, group backgrounds, links in text cards | Links |
Bases (.base files and base blocks in notes) |
image("covers/dune.jpg"), link("…"), file("…"), hasLink("…") |
Links |
Links inside code blocks are ignored, except base blocks. Links inside %% comments %% count, as they do in Obsidian. Links to notes are left to Obsidian, and links to websites or files outside the vault aren't checked.
Not scanned: HTML tags such as <img src>, Dataview and Templater code, CSS snippets, other plugins' file formats (such as compressed Excalidraw drawings), nested property objects, and anything a Bases formula computes at runtime.
No. Attachment Lens never deletes, moves or renames attachments. It shows which files have no detected references, so you can decide for yourself.
Only the target inside that one link. For ![[kyoto-temple.jpeg|400]] becoming ![[kyoto-temple.jpg|400]], the change is the e in .jpeg. The rest of the note, its properties, spacing and line endings stay byte-for-byte the same, and the review dialog shows you exactly that before anything is written.
Attachment Lens notices, writes nothing, and asks you to refresh the preview. The same happens if the file you chose is deleted in the meantime, or if a note has edits that haven't been saved yet.
Broken links to notes are left to Obsidian. A broken link counts as an attachment link when its target has an attachment extension such as .png, .pdf or .mp3. A broken [[John.Smith]] is treated as a link to a note.
Repairs are ordinary edits made through Obsidian, so sync picks them up like any other change you make. The undo point is stored in the plugin's own settings file, and undo always checks the file first, so an undo point that arrives from another device is never applied over different text.
Not yet. Version 1.0 is for desktop. A mobile version is planned.
No. It makes no network requests and has no accounts or telemetry. Its settings file stores your settings and one undo point: the file path, the few characters that changed, and fingerprints of the file before and after.
Attachment Lens is free and open source. If it saves you time, you can support its development:
Found a bug or have an idea? Open an issue. It helps to include the steps, your Obsidian version, and the text of the link involved.
npm install
npm run check # type check, lint, unit and integration tests, production build
npm run dev # rebuild main.js on change
npm run package # dist/attachment-lens-<version>/ and a .zip for manual installation
src/core holds the parsing, link resolution, suggestion ranking and repair planning, with no Obsidian imports. src/obsidian adapts it to Obsidian's API, and src/ui is the panel and dialogs.test-vault/. npm run fixtures regenerates its binary attachments.dev/harness/, which is never shipped: node scripts/dev-test.mjs --vault "path/to/a/test vault". The script copies the fixtures in, runs the checks, saves results to .dev-results/ and removes what it added.docs/demo-vault/: node scripts/dev-test.mjs --vault "…" --fixtures docs/demo-vault docs, then node scripts/make-docs-media.mjs.See docs/VERIFICATION.md for what has been tested.
MIT © 2026 MON.D.SAMA