CtxDrop
README.md
# CtxDrop
Drop files on it, get a menu of quick actions for what you dropped: video to GIF, convert or compress images, extract audio, hash, zip, and so on.
Windows 10/11 x64 · installer or single portable `.exe` · 10 languages · works with AI tools (MCP + CLI) · current version **0.4.0** ([changelog](CHANGELOG.md)) · [MIT License](LICENSE)
## Install
**Installer** (recommended): download `CtxDrop-v<version>-x64-Setup.exe` from [Releases](https://github.com/SeanShaffer88/CtxDrop/releases/latest) and run it. It installs for your account only (no admin), adds shortcuts and an uninstaller, asks which language you want (and sets CtxDrop to it), and offers to download FFmpeg when it isn't already on the PC. Silent install: `CtxDrop-v<version>-x64-Setup.exe --install --silent --lang de --optional all` (`--optional none` skips the FFmpeg download).
**Portable**:
1. Download `CtxDrop-<version>-win-x64.zip` or `.7z`. Both hold the same single `CtxDrop.exe`. Release notes list SHA-256 checksums.
2. Put `CtxDrop.exe` anywhere, for example `%LocalAppData%\Programs\CtxDrop\`.
3. Run it once and right-click the drop target → **Add to Send To menu** and/or **Create desktop shortcut**.
4. Video/audio/WebP/HEIC need FFmpeg: CtxDrop offers a one-click download the first time you pick one of those actions (see [FFmpeg](#ffmpeg)).
Windows SmartScreen may warn about an unsigned download on first run: **More info → Run anyway**.
## Ways in
All of these feed the same pipeline (ingest → detect type → contextual menu → run):
| How | What happens |
|---|---|
| Drag files/folders onto `CtxDrop.exe` or a shortcut to it | The menu opens at the cursor |
| Right-click files → **Send To → CtxDrop** | Same (add it from the drop target's right-click menu) |
| Start `CtxDrop.exe` with no files | A small always-on-top **drop target** appears; drop files on it |
| Click the drop target | File picker |
Only one CtxDrop process runs per user session. Later launches pass their files to it over a user-only named pipe, so all windows share one job queue and there's only ever one drop target.
### Floating drop target
- Drag it anywhere. Its position is saved to `config.json` and restored next time. A saved spot that's no longer on any monitor falls back to the bottom-right corner.
- Right-click it for **Lock position / Unlock position**, Choose files…, **Paste from clipboard**, Add to Send To, Create desktop shortcut, Open settings file, Language, **Theme**, **Window** (always on top, snap to screen edges, opacity), AI tools, FFmpeg location, and **Exit**.
- **Paste from clipboard** (or Ctrl+V on the drop target) opens the menu for copied files; a copied image or text is first saved to Downloads as `Clipboard <date>.png`/`.txt`.
- **Themes**: Same as Windows, Light, Dark, AMOLED black, Neon, Industrial, High contrast.
- It snaps to screen edges and corners when dragged near them (hold Shift to place it freely).
- When locked, dragging doesn't move it (a padlock shows); drops, clicks and right-click still work.
- Files dragged over it highlight it ("Release"). Moving the window uses the mouse, not drag-and-drop, so it never triggers the drop highlight.
- Exit closes everything. A menu that's still converting asks before stopping.
### The menu
Sections per file type, the type with the most dropped files first, then Custom, then File actions. Keys: ↑↓ and Enter, number keys 1–9, typing filters, Esc closes (or clears the filter). Actions ending in `…` open a small options dialog that remembers your last values. The last action you ran is offered first under **Recent** (to repeat it on the next files). Right-click an action to **Pin to top** or **Hide** it; right-click → **Show hidden actions** brings hidden ones back. During a job you get per-file progress and Esc cancels. Afterwards: **O** opens the folder, **C** copies output paths.
<img src="docs/images/menu-documents.png" width="330" alt="The CtxDrop menu for two Word documents: convert to PDF, OpenDocument, RTF, plain text or HTML, Compare documents, then file actions such as hashes, checksums and compress to zip">
| Type | Actions |
|---|---|
| Video | GIF (preset / small / custom), MP4 H.264, compress for sharing, WebM, remux to MKV, extract MP3/WAV, remove audio, trim, resize (4K–360p), rotate, save a frame, extract frames |
| Image | Convert to PNG/JPG/WebP, resize 50% / fit 1920 / fit 1280 / custom, compress, strip metadata (lossless for JPG/PNG), rotate/flip, black and white, invert, trim borders, pad to square, thumbnail, .ico, to PDF (several images → one PDF), combine (side by side, stacked, contact sheet), compare two images (differences in red); animated GIF to MP4 |
| Audio | Convert to MP3/M4A/WAV/FLAC/OGG, normalize loudness (EBU R128), convert to mono, waveform image, trim |
| Document | Word/Excel/PowerPoint/OpenDocument/RTF to PDF; DOCX ⇄ ODT ⇄ RTF, to plain text or HTML; XLSX ⇄ ODS, to CSV; PPTX ⇄ ODP; HTML to PDF/DOCX; CSV to XLSX/ODS; compare the text of two documents side by side (needs [LibreOffice](#libreoffice)) |
| Archive | Extract .zip, .tar, .tar.gz/.tgz, .gz (blocks path-traversal entries; .zip checks free space first), copy a .zip's contents list |
| Text | Sort and clean lines (sort, dedupe, reverse, shuffle, trim, remove empty, number), change case (UPPER, lower, Title, Sentence, camelCase, PascalCase, snake_case, kebab-case), extract emails/links/IPs/numbers, strip HTML, word count, compare two files (side by side or unified diff); SRT ⇄ WebVTT, format/minify JSON, CSV ⇄ JSON, convert to UTF-8, LF/CRLF line endings, open in Notepad |
| Any | SHA-256 or another checksum (MD5, SHA-1, SHA-512, CRC-32) to clipboard, save a `.sha256` checksum file, size report, find duplicates, zip or .tar.gz, Base64/hex/URL encode and decode, program details for .exe/.dll (version, architecture, signature present, ASLR/DEP/CFG), copy path(s) / quoted paths / names, show in Explorer |
Type detection reads the file header (magic bytes) first and only falls back to the extension, so misnamed and extensionless files are classified correctly.
### Comparing two files
Select exactly two files and the menu offers **Compare images…**, **Compare files…** (text) or **Compare documents…** (Word, OpenDocument, RTF; needs [LibreOffice](#libreoffice)). The result is saved beside the first file as `<first> vs <second>`, and a one-line summary is copied to the clipboard.
Images: the first image, the differing pixels in red with a box around them, and the second image. Small color changes up to the tolerance you choose are ignored.

Text and documents: a side-by-side report with changed words highlighted (follows the system's light or dark mode), or a unified `.diff` if you prefer. Documents are compared by their text only.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/compare-text-dark.png">
<img src="docs/images/compare-text-light.png" alt="Two drafts of a Word document compared side by side: changed lines in red and green with the changed words highlighted, and an added line">
</picture>
## Output rules
- Written beside the source by default (`outputLocation`: `beside`, `subfolder`, or `folder`).
- Never overwrites anything: on a name collision it adds `_2`, `_3`, and so on.
- Work goes to a temp name (`name.ctxdrop-xxxxxx.partial.ext`) and is renamed only when it succeeds and isn't empty. Failed or canceled jobs leave nothing behind.
- If the source folder is read-only, output goes to `Documents\CtxDrop Output`.
- Stops early if the drive has less than 64 MB free.
## FFmpeg
Video, audio, WebP, HEIC and AVIF work needs FFmpeg, which isn't bundled (it's large and GPL-licensed). Those actions still appear without it, marked "needs FFmpeg". Picking one (or right-clicking the drop target → **FFmpeg not found — set up…**) offers:
- **Download FFmpeg (~114 MB)**: fetches the pinned [FFmpeg 9.1 essentials build](https://github.com/GyanD/codexffmpeg/releases/tag/9.1) from Gyan's GitHub releases over HTTPS, refuses it unless the SHA-256 and size match the values built into CtxDrop, checks that it runs, and keeps only `ffmpeg.exe` (plus its license) in `%LocalAppData%\CtxDrop\tools`. Nothing is downloaded unless you click it. To remove it, delete that folder.
- **Locate ffmpeg.exe…**: use a copy you already have.
- **Copy winget command**: `winget install --id Gyan.FFmpeg -e`.
CtxDrop looks in the configured path, next to the exe, `%LocalAppData%\CtxDrop\tools`, then PATH, WinGet, Chocolatey and Scoop. PNG, JPG, GIF, BMP, TIFF and ICO are handled by Windows' built-in GDI+.
## LibreOffice
Document conversions run the free [LibreOffice](https://www.libreoffice.org) office suite in the background (headless, with a throwaway profile, so it works even while you have LibreOffice open). It isn't bundled and CtxDrop never downloads it (~350 MB): install it yourself, for example `winget install TheDocumentFoundation.LibreOffice`. Until then the document actions are marked "needs LibreOffice" and picking one explains where to get it. CtxDrop looks in `officePath`, `Program Files\LibreOffice`, Scoop and PATH. Images to PDF and all text/data conversions are built in and need nothing.
## Languages
English, Español, Français, Deutsch, Italiano, Português (Brasil), Русский, 日本語, 한국어 and 简体中文. CtxDrop follows the Windows display language by default; change it from the drop target's right-click menu → **Language**, with `CtxDrop.exe language <code>`, or with `"language"` in the settings file (`auto` = follow Windows). Command-line and MCP output stays English so scripts and AI tools can rely on it.
## AI tools (Claude, Codex, ChatGPT and others)
CtxDrop works from AI assistants as well as by hand:
- **MCP server**: `CtxDrop.exe mcp` (stdio). Claude Code: `claude mcp add ctxdrop -- "C:\path\to\CtxDrop.exe" mcp`. The drop target's right-click menu → **AI tools** copies ready-made setup for Claude Code, Claude Desktop/Cursor/VS Code (JSON) and Codex (TOML), with the right path filled in.
- **CLI with JSON output** for any agent that can run commands (Codex, ChatGPT with a shell, scripts): `CtxDrop.exe actions --json`, `CtxDrop.exe run video.gif clip.mp4 --set fps=12 --json`, `CtxDrop.exe detect --json`, `CtxDrop.exe ffmpeg status --json`, `CtxDrop.exe libreoffice --json`. Stable exit codes: 0 ok, 1 failed, 2 usage, 3 FFmpeg needed, 4 LibreOffice needed.
- `CtxDrop.exe guide` prints the full agent guide; it's also at [docs/AI.md](docs/AI.md).
Outputs never overwrite existing files, and the same action ids, parameters and error codes are used by the menu, the CLI and MCP.
## Settings
`%AppData%\CtxDrop\config.json` (comments and trailing commas allowed). If you put a file named `CtxDrop.portable` next to the exe, everything is kept beside the exe instead. A config file with errors is never overwritten; CtxDrop uses defaults and says so in the menu.
```jsonc
{
"outputLocation": "beside", // beside | subfolder | folder
"subfolderName": "CtxDrop",
"outputFolder": null, // used when outputLocation is "folder"
"language": "auto", // auto | en es fr de it pt-BR ru ja ko zh-Hans
"closeOnFocusLoss": true,
"closeWhenDone": false,
"ffmpegPath": null,
"officePath": null, // soffice.com, or LibreOffice's program folder
"maxParallelJobs": 2,
"jpegQuality": 90,
"maxFolderFiles": 2000,
"theme": "system", // system light dark amoled neon industrial contrast
"dropTarget": { "x": 1700, "y": 900, "locked": false, "alwaysOnTop": true, "opacity": 100, "snapToEdges": true },
"pinnedActions": [], // action ids shown first, e.g. ["image.compress"]
"hiddenActions": [], // action ids left out of the menu
"customActions": [
{
"title": "Optimize PNG (oxipng)",
"appliesTo": [".png"], // kinds: video image audio document archive text any; or extensions
"exe": "C:\\tools\\oxipng.exe", // absolute path, or a name found on PATH (never the current folder)
"args": ["-o", "4", "--out", "{output}", "{input}"],
"outputExt": null, // null = same as input, "" = no output file
"outputSuffix": "_opt"
}
]
}
```
Custom commands get an argv array (`{input} {output} {inputDir} {name} {stem} {ext}`). No shell is involved, so a filename can't inject commands. `{output}` is the temp path; CtxDrop renames it after the command exits successfully.
## Limits
- Explorer passes dropped files on one command line, capped at 32,767 characters. With hundreds of long paths, Windows refuses to launch. Drop the folder instead, or use the floating target, which has no such limit.
- If CtxDrop runs as administrator, Windows blocks drops from Explorer. The drop target shows a warning; use Choose files…
- HEIC/AVIF decoding depends on your FFmpeg build.
## Build
```powershell
dotnet test CtxDrop.slnx
./tools/publish.ps1 # dist/CtxDrop.exe (self-contained, ~50 MB) and dist/CtxDrop-lite.exe (~0.4 MB, needs .NET 10 Desktop Runtime)
./tools/package.ps1 # release archives (.zip, .7z; needs 7-Zip) and the installer (needs CrimsonInstall, below)
./tools/make-icon.ps1 # regenerates the app icon
```
Requires the .NET 10 SDK (pinned in `global.json`). Version and metadata live in `Directory.Build.props`.
The installer is packed with [CrimsonInstall](https://github.com/SeanShaffer88/CrimsonInstall) (v0.10.0+) from `installer/installer.toml`. `package.ps1` uses `-CrimsonInstall <exe>`, `%CRIMSONINSTALL_EXE%`, or a sibling `..\CrimsonInstall` build, and skips the installer with a warning when none is found. A local CrimsonInstall build made without `windres` has no resource section, so add `-NoStamp` (the installer then keeps the stub's icon and version info).
Translations are `src/CtxDrop/Localization/<code>.json`; English lives inline in the code as the fallback. The tests fail if a language misses a key or a `{0}` placeholder.
## Releasing
1. Move the `[Unreleased]` notes in `CHANGELOG.md` under a new `## [x.y.z] - date` heading, and bump `<Version>` in `Directory.Build.props`.
2. Commit, then tag and push:
```powershell
git tag v0.2.0
git push origin main v0.2.0
```
3. `.github/workflows/release.yml` runs the tests, builds the self-contained exe with that version, checks that both archives contain exactly `CtxDrop.exe` (byte-identical), builds CrimsonInstall at the ref pinned in the workflow (`CRIMSONINSTALL_REF`), packs and verifies the installer, and publishes a GitHub release with the installer, the `.zip`, the `.7z` and that version's changelog section plus SHA-256 checksums. A tag with a suffix (`v0.2.0-beta.1`) becomes a pre-release.
You can also run it from the Actions tab (**Release → Run workflow**) with a version; that creates the tag at the chosen commit.
Layout: `Core/` (ingest, detection, actions, jobs, FFmpeg, image ops; no UI), `Platform/` (Win32, single instance, shell), `UI/` (menu, drop target, options dialog, theme). The log is at `%LocalAppData%\CtxDrop\ctxdrop.log`.
## License
[MIT](LICENSE) © 2026 Sean Shaffer. FFmpeg is not included; it is a separate program under its own license (GPL for the build CtxDrop can download), fetched only when you ask.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues