Skip to content
XiamiYoungPublic

About

Region screenshot capture for terminal AI agents (Claude Code, Cursor, Aider). Drag a region, the path lands in your clipboard.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

ctx-shot

Snap context into your terminal AI. Region screenshots for Claude Code, Cursor, Aider, and any terminal AI agent.

License: MIT Platform Electron

Terminal AI agents can read text but they can't see your screen. Pasting a screenshot into the terminal does nothing — Ctrl+V only handles text.

ctx-shot bridges that gap. Snap a region, the file path lands in your clipboard, paste it into the terminal — Claude Code (or any agent) reads the image automatically.

[ Press hotkey ] → [ Drag a region ] → [ Ctrl+V in terminal ] → [ AI sees it ]

Demo

ctx-shot demo


Install

git clone https://github.com/XiamiYoung/ctx-shot.git
cd ctx-shot
npm install
npm start

Or use the platform launcher (auto-installs on first run):

# Windows
.\run.bat

# macOS / Linux
./run.sh

A coral system tray icon appears. The app runs in the background — close the launcher terminal anytime.


Usage

Action Windows macOS
Capture region Ctrl+PrintScreen or double-tap Ctrl Cmd+Shift+1 or double-tap Ctrl
Cancel selection Esc or right-click Esc or right-click
Quit Tray → 🚪 Quit Tray → 🚪 Quit

Tray menu

ℹ️ About App info, hotkeys, GitHub link
📂 Open Folder Reveals the screenshot directory
🗑️ Clear All Wipes every saved screenshot (with confirmation)
🚪 Quit Exit the app

About dialog


How it works

  1. Pre-warmed overlay windows — at startup, one hidden BrowserWindow per display, HTML pre-parsed. Show latency ≈ 0ms.
  2. Capture warmup — a dummy desktopCapturer call at boot eliminates first-call cold-start.
  3. All-monitor selection overlay — every screen dims simultaneously; drag on whichever screen has your target. The selection is constrained to a single monitor (Snipping Tool style).
  4. Coral shimmer animation — the selection border uses Anthropic's brand palette: a static coral underline plus a traveling cream-cored halo (2.4s cycle), corner brackets, and a live dimensions pill.
  5. Clipboard handoff — the cropped PNG is saved, the absolute path is written to the OS clipboard as text. Your terminal AI reads images automatically when it sees a path in your prompt.

Where are screenshots stored?

Platform Path
Windows %LOCALAPPDATA%\ctx-shot\shots\
macOS ~/Library/Application Support/ctx-shot/shots/
Linux ~/.local/share/ctx-shot/shots/

Auto-cleanup

Screenshots older than 5 minutes are deleted every 5 minutes — and once on startup. Use 🗑️ Clear All in the tray menu for an immediate purge.

This is intentional: your screenshots are ephemeral context for an AI conversation, not a personal archive.


Permissions

Windows

None required.

macOS

Permission Why Where to grant
Screen Recording desktopCapturer access System Settings → Privacy & Security → Screen Recording
Accessibility Double-tap Ctrl detection System Settings → Privacy & Security → Accessibility

After granting, restart the app (an Apple requirement, not ours).

If Accessibility is denied, the Cmd+Shift+1 fallback still works — only the double-tap shortcut is disabled.


Privacy

Screenshots stay on your machine. ctx-shot does not phone home, upload, or telemeter anything. The only network call is when you click the GitHub button in the About dialog.

The clipboard write contains a local file path. Whether your AI agent uploads that file is determined by your AI's behavior, not ours.


Tech stack

  • Electron 31 — cross-platform shell, globalShortcut, desktopCapturer, nativeImage cropping
  • uiohook-napi (optional) — global low-level keyboard hook for double-tap Ctrl
  • Pure-JS PNG encoder (~50 LOC) — generates the tray icon at runtime, zero asset files
  • Canvas2D — selection overlay, shimmer animation, dimensions label

No native modules required for core features. uiohook-napi is an optional dependency — if it fails to install (rare), the keyboard combo Ctrl+PrintScreen / Cmd+Shift+1 keeps working.


Compatible AI agents

Tested with — and the screenshot-path-in-prompt convention works for:

Anything that reads file paths from a prompt and supports image inputs.


Contributing

Issues and PRs welcome. Some areas where contributions land easily:

  • Linux testing & packaging (untested by author)
  • Configurable hotkeys (currently hardcoded)
  • electron-builder packaging → .exe / .dmg releases
  • Settings window (TTL, cleanup interval, hotkey customization)

More from the author

🛋️ ClanKit — your desktop AI workspace

Chat, agents, voice, and tools — all in one local-first desktop app. Bring your own keys (Anthropic, OpenAI, DeepSeek, Google, OpenRouter, …) and run them side by side.

🌐 clankit.app  ·  📦 GitHub


Credits


License

MIT © 2026 XiamiYoung

About

Region screenshot capture for terminal AI agents (Claude Code, Cursor, Aider). Drag a region, the path lands in your clipboard.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages