Radix3 downloadsSelective attachment cleanup: detects images unlinked from a note and offers to send them to the trash.
Obsidian plugin that detects images and attachments that became unlinked from a note while you edit it, and offers to send them to the trash — respecting Obsidian's trash settings and keeping a trace log of every action.
.md files (with a 1.5 s debounce so it doesn't interrupt while you type) and compares attachments referenced before/after., ![[file]], [[file]] and Markdown links. External URLs are ignored..img/ (configurable in Settings); any attachment outside those folders is ignored.fileManager.trashFile() — never permanently deletes against the user's trash configuration..obsidian/plugins/img-cleanup/ inside your vault.manifest.json and main.js into it (already compiled in this repo).| Setting | Description |
|---|---|
| Enable plugin | Turns monitoring on/off |
| Watched folders | Comma-separated paths (default .img/). A bare name matches at any depth |
| Permanent action | State of the "Don't ask again" policy + button to reset to "Ask" |
| Trace history | Opens the modal with the action log |
The log lives in .obsidian/plugins/img-cleanup/data/appendix-log.jsonl.
Requires Node.js 18+.
npm install # dependencies
npm run build # typecheck + production bundle → main.js
npm run dev # watch mode (auto rebuild)
manifest.json
versions.json
esbuild.config.mjs
tsconfig.json
src/
main.ts # entry: events, policy, backlinks, trash
settings.ts # PluginSettingTab
diff.ts # reference parser + debounce + snapshot
log.ts # JSONL log + rotation
modal-delete.ts # batch confirmation modal
modal-history.ts # history modal
docs/
documento_de_lineamientos_para_el_desarrollo_del_plugin_de_obsidian.md
MIT