Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Img Cleanup

RadixRadix3 downloads

Selective attachment cleanup: detects images unlinked from a note and offers to send them to the trash.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

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.

Features

  • Live detection: listens for changes in the vault's .md files (with a 1.5 s debounce so it doesn't interrupt while you type) and compares attachments referenced before/after.
  • Supported formats: ![](path), ![[file]], [[file]] and Markdown links. External URLs are ignored.
  • Watched folders only: defaults to .img/ (configurable in Settings); any attachment outside those folders is ignored.
  • Backlinks: if another note still references the file, it is not offered for deletion.
  • Batch modal: a single window lists the unlinked files with a checkbox per file and Delete / Keep buttons.
  • "Don't ask again": persists the last action as a permanent policy (always delete / always keep). Resettable from Settings.
  • Obsidian's trash: uses fileManager.trashFile() — never permanently deletes against the user's trash configuration.
  • Trace log: JSONL with date, file, source note, destination and action. Rotated with a 1000-entry cap. History viewable from a modal (open file / clear).

Installation

  1. Create the folder .obsidian/plugins/img-cleanup/ inside your vault.
  2. Copy manifest.json and main.js into it (already compiled in this repo).
  3. Restart Obsidian → Settings → Community plugins → enable Img Cleanup.

Configuration (Settings → Img Cleanup)

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.

Development

Requires Node.js 18+.

npm install        # dependencies
npm run build      # typecheck + production bundle → main.js
npm run dev        # watch mode (auto rebuild)

Structure

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

Out of scope

  • Scanning for orphan files (attachments not referenced by any note).
  • Markdown notes linked to each other (attachments/images only).
  • Canvas.

License

MIT

HealthExcellent
ReviewPassed
About
Detect unlinked images and attachments while you edit and offer to move them to Obsidian's trash, respecting the app's trash settings. Monitor only configured folders, ignore external links, skip files referenced elsewhere, and keep a rotatable JSONL trace log with a batch modal to review and apply deletions.
AttachmentsFiles
Details
Current version
1.0.1
Last updated
14 hours ago
Created
2 days ago
Updates
2 releases
Downloads
3
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
RadixRadixradixtenshi
GitHubradixtenshi
  1. Community
  2. Plugins
  3. Attachments
  4. Img Cleanup

Related plugins

Pixel Perfect Image

Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.

File Cleaner Redux

Helps with cleaning up empty files and unused attachments in the vault.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Claudian

Embeds Claude Code/Codex and other local Agents as AI collaborators in your vault.

Advanced URI

Control everything with URI.

Thino

Quickly capture memos and display them in the sidebar with a heatmap. (Closed source)

Local REST API with MCP

Unlock your automation needs by interacting with your notes over a secure REST API.

ChatGPT MD

A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama into your notes.

Share Note

Instantly share/publish a note, with the full theme and content exactly like you see in Obsidian. Data is shared encrypted by default, and only you and the person you send it to have the key.

Custom Attachment Location

Customize attachment location with variables($filename, $data, etc) like Typora.