The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin”; through extensions, it can take over various runtime behaviors. During use, caches generated by large model execution, downloaded installers, or exported files are often written to the C: drive by default, which can easily cause insufficient system drive space. dsh-disk-guard is a plugin that addresses this pain point. It redirects DSH’s downloaded artifacts and cache/temporary files from the C: drive to a user-specified directory, and injects a “path discipline” prompt into each session to prevent the C: drive from filling up.

Core Features

This plugin provides the following capabilities:

  • Specified directories: Uniformly manages the download directory (artifacts/installers) and cache directory (temporary files, npm cache).
  • Environment redirection: Redirects temporary environment variables such as TMP/TEMP/TMPDIR and npm_config_cache to the specified directory, taking effect for child processes.
  • Persistent inheritance: Writes configuration to $DSH_HOME/.env to achieve persistent inheritance.
  • Prompt injection: Automatically inserts the “path discipline” prompt before the first message in a session.
  • Management tool: Provides the disk_guard command-line tool, supporting status viewing, expired cache cleanup, and directory modification.
  • Smart defaults: If no directory is configured, automatically selects the non-C: drive with the largest free space (requires ≥5GB).

Installation and Activation

Run the installation script in the plugin package directory (the level that contains package.json):

powershell -ExecutionPolicy Bypass -File scripts\install.ps1

After installation is complete, you must restart DeepSeek Harness (both Web UI and Headless modes) for the changes to take effect.

Usage Examples

After successful installation, you can use the disk_guard tool in a session or on the command line.

View disk status

disk_guard status

Clean up expired caches

disk_guard clean

Modify directories

disk_guard set downloadDir:"E:\dsh\dl" cacheDir:"E:\dsh\cache"

The configuration file is located at $DSH_HOME/disk-guard.yaml. Paths support ~ (user home directory) and %VAR% expansion; relative paths are based on the DSH home directory.

Notes

  • Zero dependencies: The plugin has no third-party dependencies at runtime.
  • Cleanup boundaries: Cleanup operations only target directories managed by the plugin itself.
  • Restart required: You must restart DSH after installation.