Preface

In DSH (DeepSeek Harness), collaborating with agents often involves transferring screen content to them: an error log, a UI state, or an image visible only within a local application. The common practice is to manually screenshot and paste it into the dialog box—the image itself enters the conversation, making it difficult to locate the file afterwards. Conversely, getting an agent to “take a look at the screen” usually lacks a ready-made entry point.

@paicat1/dsh-screenshot merges these two tasks into a single plugin: users can screenshot using browser hotkeys, and after the screenshot, only the PNG path is passed to the agent; the agent can also self-screenshot via a tool. The entire implementation is pure PowerShell with zero dependencies and zero binaries. Below, I will introduce its features, installation, and usage.

What is This

One-sentence positioning: A lightweight DSH screenshot plugin that combines browser hotkeys with a self-service screenshot and image reading tool for agents.

  • Package name: @paicat1/dsh-screenshot, current version 1.1.2, MIT License
  • Author: paicat1
  • Platform: Windows (relies on PowerShell’s System.Drawing.CopyFromScreen)

Background worth mentioning: This screenshot capability was originally implemented as an enhancement for the dsh plugin of @liustack/modlens. Upstream marked this feature as “not planned” in issue #48, so the author forked it and split it into an independent plugin to decouple the impact of upstream updates on the screenshot functionality. Therefore, it does not break with modlens updates and does not depend heavily on modlens. Screenshotting and distribution are the plugin’s own capabilities, while image reading (OCR/layout/semantic) belongs to modlens (optional).

Core Features

Two Hotkeys

  • Ctrl+Shift+Alt+S: Direct fullscreen screenshot without interaction, capturing the entire virtual desktop.
  • Ctrl+Alt+S: Enters selection mode. After entering, the entire desktop remains operable; windows can be moved and resized freely, like arranging a scene before taking a screenshot. During selection: clicking the desktop = fullscreen; hovering the mouse over a window highlights a snap border; clicking = captures the full content of that window (even if occluded); dragging = free selection, Esc to cancel.

Upon completion of the screenshot, the PNG path is automatically inserted into the DSH input box and copied to the clipboard.

Window Snapping: Capture Full Content Even When Occluded

When hovering, the plugin enumerates the windows on the screen and highlights the one under the cursor. After clicking, it uses PrintWindow to let the target window render its own content—we are capturing the window itself, not the pixels visible on the screen, so being occluded by other windows or wrapped by DWM shadows does not affect the result. Finally, the shadow is cropped based on the content boundary, leaving clean edges.

Known exception: Standalone PowerShell windows. Their console (conhost) does not respond to PrintWindow, and does not render a GDI surface when occluded, so both “penetration” paths fail. When occluded, it can only capture the pixels visible on the screen (including occluded content). When encountering such a window, switch it to the foreground before screenshotting, or use drag selection directly. Other windows (including console windows like cmd) work normally.

Pass the Path, Not the Image

Screenshots are saved to a dedicated directory:

%USERPROFILE%\Downloads\modlens-screenshots\

Only the PNG path is passed to the agent, not the image itself. This way, the image exists in only one place, making cleanup as simple as deleting a directory. The path is a text string of tens of bytes, preventing hundreds of KB of binary data from flooding the context. Furthermore, the path is universal; any agent supporting images (native multimodal models or bridges like modlens) can read the image via the path, allowing a single screenshot path to be reused.

modlens_screenshot: Let the Agent Screenshot Itself

The plugin registers the modlens_screenshot tool for the agent. After the model calls it autonomously, the screenshot is completed. If modlens is installed, it will read the structured content (OCR/layout/semantic) on the spot and return the evidence along with the screenshot path.

modlens is optional: if the modlens CLI is not found, the modlens_screenshot tool is not registered, but the screenshot functionality works normally. In terms of capabilities, screenshotting (fullscreen/box selection/window snapping/window arrangement), distribution (passing path, clipboard, dedicated directory), and the two entry points are the plugin’s own capabilities and can be used independently; image reading belongs to modlens, which the plugin reuses for its image recognition pipeline.

Installation and Enablement

Installation command:

dsh plugin --profile web add @paicat1/dsh-screenshot

After installation, restart dsh web for it to take effect. With the steps above, browser hotkeys and the modlens_screenshot tool are enabled by default.

Typical Usage

Manually screenshot to show the agent:

  1. Press Ctrl+Alt+S to enter selection (or Ctrl+Shift+Alt+S for direct fullscreen) to complete the screenshot;
  2. The PNG path is automatically inserted into the DSH input box and copied to the clipboard;
  3. Send the message, and the agent reads the image based on the path.

To let the agent view the screen itself, simply tell it to use the modlens_screenshot tool in the conversation.

Configuration (Optional)

The plugin provides two optional cordis configuration items, all enabled by default:

route: false   # Disable browser screenshot routing
tool: false    # Disable modlens_screenshot tool

If you need to explicitly specify the modlens CLI path, set the environment variable MODLENS_DSH_CLI; otherwise, it defaults to probing ~/.dsh/profiles/{web,headless}/node_modules/@liustack/modlens/dist/main.js.

Suitable Scenarios and Notes

Suitable scenarios:

  • DSH web users on Windows who want to quickly hand screen content to an agent using hotkeys;
  • Workflows requiring the agent to autonomously screenshot and inspect the interface;
  • Scenarios where structured output (OCR/layout/semantic) is desired from screenshots; install modlens to enable this, but screenshots work normally without it.

Notes:

  • The plugin only supports Windows and relies on PowerShell’s System.Drawing.CopyFromScreen.
  • Standalone PowerShell windows (conhost) cannot penetrate occlusion when occluded; switch to the foreground or use drag selection.
  • The plugin runs with the permissions of the current dsh process; check the source code and license before installing (this plugin is MIT licensed).

Summary

One set of hotkeys for people, one tool for the Agent; screenshots only pass the path, keeping the context clean, zero dependencies, zero binaries; when image reading is needed, just connect to modlens; not installing it doesn’t affect the screenshot functionality itself. Repository and directory page:

  • GitHub: https://github.com/paicat1/dsh-screenshot
  • Plugin Directory: https://www.skillhub.cn/plugins/paicat1/dsh-screenshot