Introduction¶
When using DeepSeek Harness (dsh), increases in disk usage by the data directory are often hard to notice. Session logs are appended, making them easy to accumulate to several hundred MB, or even close to the ~512 MB stringify limit reported by the community. Before disk space is filled up or errors occur, there is often no intuitive monitoring method. dsh-disk-audit aims to solve this problem by providing a read-only audit capability for the dsh data directory.
Plugin Introduction¶
dsh-disk-audit is a disk usage audit plugin for the DeepSeek Harness (dsh) data directory. It provides total size, per-directory breakdowns, largest directories and files, oversized file warnings, and cleanup recommendations. The plugin has zero runtime dependencies, performs read-only operations, and never deletes or moves data. It provides support through a CLI tool and an Agent-callable disk_audit tool.
Core Features¶
- Directory audit: Audits the total size and directory distribution of the dsh data directory.
- Largest files/directories: Lists the largest directories and files.
- Threshold detection: Detects oversized files and provides cleanup recommendations.
- Zero dependencies and read-only: Zero runtime dependencies and read-only operations; never deletes or moves anything.
- Tool support: Provides a command-line interface (CLI) and an Agent-callable tool (disk_audit).
Installation¶
Install it through the DSH plugin system:
dsh plugin add dsh-disk-audit
Typical Usage¶
Run the CLI standalone:
npx dsh-disk-audit ~/.dsh
Set a per-file alert threshold:
npx dsh-disk-audit ~/.dsh -- --large-file 52428800
Output a machine-readable report:
npx dsh-disk-audit ~/.dsh --json
Using It in Harness¶
You can call the disk_audit tool directly through the Agent in Harness. For example, ask the Agent:
Check how much disk space my dsh data directory is using and which files are the largest.
The tool returns a report in the dsh-disk-audit/v1 format, including total size, directory details, largest files, and cleanup recommendations.
Applicable Scenarios and Notes¶
- Use cases: Regularly check disk space usage and prevent storage issues caused by oversized session logs.
- Notes:
- Session logs are appended and can grow silently.
- The plugin performs read-only operations and does not delete or move files.
- No API key is required.
- Exit codes: 0 means no issues, 1 means warnings (such as oversized files or total size exceeding the threshold), and 2 indicates usage or I/O errors.
Summary¶
dsh-disk-audit provides a low-cost way to monitor DSH disk health. For more details and source code, see the project homepage:
* GitHub repository
* Community directory