Introduction¶
The system clipboard retains only the last item. If you copy a log in the terminal and then copy an error, the first one is gone. For agent developers, this means when asking DSH to handle “that thing copied just now,” it only gets the latest one.
dsh-clipboard-history solves this problem: it monitors the system clipboard in the background, records every text change to a persistent file, and provides it to the agent as a tool, retrievable anytime by ID.
Below is an introduction to the plugin’s features, installation method, and configuration options.
What is it¶
dsh-clipboard-history is a DeepSeek Harness (DSH) plugin by kuangre123, version 0.1.0, licensed under MIT. Its positioning can be summarized in one sentence: it monitors the system clipboard and retains multiple retrievable history records.
The operation is divided into two parts:
- Background polling of the system clipboard—
pbpasteon macOS,xclipon Linux, PowerShell on Windows—recording it whenever text changes are detected. - History is written to a persistent file at
$DSH_HOME/clipboard-history.json, persisting across restarts.
The plugin runs within the host process and does not require native plugins to access the logged-in user’s clipboard.
The Five Tools Exposed to Agents¶
After installation, the agent gains the following tools:
| Tool | Function |
|---|---|
clipboard_list |
Lists recent history entries (id, time, size, preview) |
clipboard_get |
Retrieves a single complete text entry by ID |
clipboard_current |
Reads the current real-time clipboard content |
clipboard_copy |
Writes text to the system clipboard and records it |
clipboard_clear |
Clears stored history (keeps real-time clipboard) |
clipboard_list only returns a preview (default 160 characters). After confirming the target entry, use clipboard_get to retrieve the full content. This is the standard path for recalling a history item.
Installation and Usage¶
First, prepare the environment. The dsh plugin manager relies on pnpm; enable it via corepack if missing:
corepack enable
Then install the plugin. The installation command is provided in the README:
# from npm (once published)
dsh plugin --profile web add dsh-clipboard-history
# from a local checkout
dsh plugin --profile web add file:/absolute/path/to/dsh-clipboard-history
It should be noted that the npm installation command in the README is marked “once published,” so it cannot be confirmed whether the package is currently published on npm; if npm installation is unavailable, installing from a local checkout is the safe path.
The dsh plugin command forwards to pnpm inside the profile directory and automatically organizes dsh.profile.bundles. This package declares the following in package.json:
"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
Therefore, after installation, it is automatically added to the profile’s patch layer stack; no manual registration is required.
After installation, restart the web application to make the new host plugin effective:
dsh web
Configuration¶
Editing the profile’s cordis.patch.yml (or the config block inserted by the bundle) allows you to adjust polling and storage behavior:
- id: clipboard-history
config:
pollIntervalMs: 700 # clipboard poll interval in ms
maxHistory: 200 # max stored entries
maxEntryChars: 50000 # max stored characters per entry
previewChars: 160 # preview length in clipboard_list
historyFile: clipboard-history.json # relative to the DSH home
poll: true # false disables background monitoring
Meaning of some default values:
pollIntervalMs: 700: Clipboard polling interval 700 milliseconds.maxHistory: 200: Maximum 200 history entries retained.maxEntryChars: 50000: Maximum 50000 characters stored per entry.historyFile: History file name, relative to the DSH home directory.poll: false: Disables background monitoring.
Environment Requirements and Dependencies¶
- Node >= 18.
- peerDependencies is
^4.0.1on top of@deepseek-ai/dsh-tools ^0.1.0-rc.6and@deepseek-ai/cordis ^0.4.1(based on package.json:@deepseek-ai/cordis ^4.0.1). - macOS is the primary target platform; Linux requires installing
xclip, Windows uses PowerShell.
Use Cases and Notes¶
Suitable scenarios: frequently moving text between terminal and editor, wanting the agent to have access to “previously copied” content, or needing to write session text back to the clipboard for manual operations.
A few things to know before using:
- Only text is supported. Image and file clipboard content is ignored and read as empty text.
- The plugin runs with the permissions of the current dsh process and can directly access the logged-in user’s clipboard. This means it can read all text you copy in the system—before installing any third-party plugin, you should check the source code and license first. This plugin is MIT licensed, and the source code is available on GitHub.
- History has upper limits: default 200 entries, 50000 characters per entry. It is trimmed after exceeding the limit; it is recommended to retrieve important content in time using
clipboard_get.
Conclusion¶
dsh-clipboard-history does a small but substantial job: turning a one-time clipboard into retrievable history, allowing DSH agents to get “previously copied” content. If you use DSH daily on macOS, it is worth a try.
- Community plugin directory page: https://www.skillhub.cn/plugins/kuangre123/dsh-clipboard-history (This directory is an independent community site with no official affiliation to DeepSeek / Hackflow)
- GitHub repository: https://github.com/kuangre123/dsh-clipboard-history