Zero-config per-turn git checkpoints: after every completed agent turn in a git workspace, stages all changes into one tagged \[turnsnap] commit (serialized queue, sandbox-policy aware), so any turn is a rollback point.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-turnsnap
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:yongshuai0314/dsh-turnsnap
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).
README
Zero-config per-turn git checkpoints for DeepSeek Harness (DSH). After every completed agent turn, if the session's working directory is a git repository with uncommitted changes, TurnSnap stages everything and creates one tagged [turnsnap] commit — a rollback point you never had to ask for.
Why
Long agent sessions rewrite many files. When a turn goes wrong you either reach for git by hand or lose the trail. TurnSnap makes the checkpoint automatic: one commit per turn, named after the turn number, file count and time:
[turnsnap] turn 12 · 7 files · 14:32:08
Install
dsh plugin --profile <your-profile> add dsh-turnsnap
No configuration, no client half, nothing to approve: the host half hot-reloads within seconds and starts guarding every session in a git workspace.
How it works
- Listens to the harness
agent/turn-stoppingevent. - Resolves the session workspace from
agent.session.header.cwd. - Skips silently when the directory is not a git repository or has a clean tree.
- Otherwise runs
git add -A && git commit -m "[turnsnap] turn N · M files · HH:MM:SS" --no-verify. - Checkpoints are serialized on one internal queue, so a parent session and its subagents closing turns at the same moment cannot race the git index.
- Git runs through the harness shell service; when the host exposes a sandbox-policy resolver, each request is stamped with the owning session's standing file policy.
Agent tools
| Tool | Effect |
|---|---|
turnsnap_pause |
Stop auto-commits until resumed |
turnsnap_resume |
Resume auto-commits |
turnsnap_status |
Report enabled state, counters and the last checkpoint message |
All three take no arguments. Ask the model to "pause turnsnap" mid-session, or call them yourself from any script that can invoke harness tools.
Caveats
git add -Afolds anything staged-but-uncommitted into the checkpoint. If you keep a deliberate partial stage across a turn boundary, pause first.- Ignored files stay ignored (
add -Arespects.gitignore). - Commits use
--no-verify, so your pre-commit hooks do not run on checkpoints. - One checkpoint per repository per turn: subagents sharing the workspace land in the same commit.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-git-graph★ 10686
Git branch selector and Git graph for the dsh web GUI: switch branches and explore branch-lane and commit history from the conversation header. Retired by the author in favour of the official workspace-changes plugin: the published npm package stays installable but is no longer developed.
Akimiya-z/codex-guard#dsh★ 131
Pre-submit pull-request hygiene checks inside DeepSeek Harness: scans the current diff for TODO leftovers, hardcoded secrets, and non-conventional commit subjects.
xbzbing/dsh-git-panel★ 65
IDE-style Git panel in the DSH Web GUI: a resident tab with a three-column overview (branch/tag list, searchable commit-history graph, commit detail with changed-file tree and message) and a changes page (stats bar, uncommitted list with per-file stage/unstage/discard, commit box with amend); side-by-side diffs carry lazy highlight.js syntax highlighting, on-demand between-hunk context expansion and word-level intra-line emphasis, with image files shown as before/after panes; plus a zsh-style branch marker in the input bar. Every git command runs as an argv array through the host subprocess service, cwd locked to the repo root.
Cerbur/clutch-dsh#clutch-dsh-worktree★ 49
Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
KannaKuron/dsh-ide-git★ 41
JetBrains-style Git tool window for the sidebar: branch tree with ahead/behind badges, commit graph with text/author/date/path filters, per-file line diff, changes list and commit box, plus branch, tag and stash actions, merge, rebase, cherry-pick, reset and fetch/pull/push.
Lenonss/DSH_VsCodeMode★ 36
VSCode-style editing experience for DeepSeek Harness: a Monaco-based central file editor (tabs, Ctrl+P quick open, status bar) and interactive diff review of agent edit/write results with per-change Keep/Undo, rollback and archiving, persisted across restarts.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.