DeepSeek Harness Plugin

Leonlee114514/dsh-turn-cleanup

Category Development & Runtime Added 2026-11-07

Blocks the end of a turn while temporary files from that turn are still lying around: it registers a listener on the serial agent/turn-stopping hook and, if anything is left, steers the model with the file list and two ways out — delete them, or justify each one and move it somewhere deliberate. Candidates come from two narrow temp-file sources, plus a backup-retention channel that is on by default and flags excess .bak copies of files touched this turn. The first is the .agent-tmp/ convention directory under the session cwd: whatever is left in it is reported outright, because that directory exists only for throwaway files. The second is the paths this turn actually wrote, captured through the fs/write-intent hook; those are reported only when they sit under that cwd, fall outside .git, node_modules, .tmp-sessions and out, match a temp-file pattern, and the file is still present — which is what keeps junk already sitting in the workspace from being resurrected as a complaint about this turn. One steer per turn, subagent sessions skipped, nothing deleted by the plugin in the default steer mode (only the opt-in mode: prune deletes backups), and the check is readdir plus stat only.

Install

# from a prebuilt release tarball

dsh plugin --profile web add "https://github.com/Leonlee114514/dsh-turn-cleanup/releases/latest/download/dsh-turn-cleanup.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:Leonlee114514/dsh-turn-cleanup

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.