dsh-file-history: Snapshot DSH Workspace by Rounds, One-Click Restore Files or Conversations

Preface

In DeepSeek Harness (DSH), the common approach to letting agents modify code is to watch diffs, rely on git rollbacks, or manually fish files out of backups. A single conversation turn may touch many files, and may even write to disk indirectly through scripts. If you only want to undo “this turn’s” changes without touching the project’s commit history, you need to treat “a turn” as a time unit to record and revert.

Below is an introduction to the community plugin dsh-file-history (maintainer EmptyVessel-000, categorized as “Memory” on SkillHub). It snapshots the workspace after each conversation turn ends, displays change cards under replies that modified files, and supports restoring files only, restoring the conversation only, or both. The sidebar also provides a timeline and checkpoints. Data is stored in ~/.dsh/file-history/, without reading or writing the .git in the project directory.

What Is This

dsh-file-history is a file history plugin for the DSH Web client: at the end of each conversation turn, the plugin records the real state of the workspace on disk before and after that turn (not limited to files directly written by AI tools), and displays file lists, added/removed line counts, and diffs under replies that made changes, along with restore and branch operations.

Intro (consistent with the repository and directory page): Per-turn snapshot of your DSH workspace. Any turn can be restored — files, conversation, or both.

Core Features

Per-Turn Snapshots

Snapshots land in $DSH_HOME/file-history/ (default ~/.dsh/file-history/), not in the project directory. It works even if the project has no .git; when a git repository exists, the plugin still does not read or write the project’s .git, commits, branches, or staging area. Files with identical content are stored only once; old records beyond the retention policy are recycled.

Change Cards Under Replies

Only turns that actually modified files show cards: listing added / modified / deleted files, added/removed line counts per file, and the number of skipped large files. Clicking a filename shows that turn’s diff; at the bottom there are four actions — restore files only, restore conversation only, restore all, and branch from this turn; after restoring, you can “undo the restore”.

The “File History” page displays in reverse order: the top is “Now”, below are checkpoints and each turn. Details can be expanded and restored. Checkpoint dot colors distinguish origins (conversation start, fork, manual mark); turns on the parent branch are dimmed as read-only, and action buttons are unavailable.

Change Bar Above the Input Box

When a checkpoint exists and the workspace is inconsistent with the checkpoint, a diff summary is displayed (number of files, added/removed lines), which can be expanded to view per-file details and “Restore to checkpoint”. If another branch on the same line has modified the same file later, a hint appears and you can jump to that branch’s conversation.

Checkpoints

You can “Set as checkpoint” in the sidebar or on cards to save the current file tree. Checkpoints are bound to the conversation line; conversations forked from the same conversation share one line. Automatic pruning is calculated per branch: keeping the most recent keepRecentTurns turns, and pruning at the pruneAfterCheckpoints cutoff when that family’s checkpoints are sufficient.

The bottom of the sidebar provides “Clear turn snapshots” (keeping skeletons and branch nodes) and “Clear all branch history” (including checkpoints, returning to the state right after installation), which only affect the branch family of the current conversation line.

Restore Behavior Summary

Action Disk Files Conversation
Restore files only Write back content from before that turn Untouched
Restore conversation only Untouched Fork a new conversation from before that turn, keeping the original conversation
Restore all Write back content from before that turn Fork a new conversation and switch to it

“Branch from here” restores files to what they looked like at the end of that turn and starts a new conversation, without deleting the original conversation or subsequent turns. Files manually modified are not counted in plugin history, and will be overwritten by snapshots when restoring.

The plugin does not perform code review, nor does it replace git. Its implementation borrows the idea of VS Code’s sidebar “Timeline”, changing the unit from “one save” to “one conversation turn”, and can roll back along with the conversation within the conversation.

Installation and Activation

DSH 0.1.x is required (engines.dsh in package.json is ^0.1.5), Node.js ≥ 20, git ≥ 2.20. When git is not in PATH, you can specify the absolute path via the gitPath config or the environment variable DSH_FILE_HISTORY_GIT; if git is not found, conversations are not blocked, but cards will show it as unavailable.

Installation (Web profile):

dsh plugin --profile web add dsh-file-history

After installation, restart DSH. Uninstall:

dsh plugin --profile web remove dsh-file-history

Configuration is written to the profile’s cordis.patch.yml, and can also be modified in Settings → Plugins → File History, taking effect in the next turn without a restart. See the repository’s config.example.yml for example fields:

- insert:
    - id: file-history
      name: 'dsh-file-history'
      config:
        gitPath: ''
        excludes: []
        maxFileBytes: 5242880
        maxEntries: 100
        pruneAfterCheckpoints: 2
        keepRecentTurns: 20
        maxDirFiles: 20000
        maxRepoFiles: 20000
        maxBytes: 2147483648

By default, node_modules, .git, dist, build, .venv, etc. are excluded, and single files over 5 MB are not recorded; embedded git repositories within the workspace are recorded per-file and follow that repository’s ignore rules.

Typical Usage

  1. Install and restart DSH, then open “File History” in the sidebar (the panel does not auto-pop-up).
  2. Have a normal conversation with the agent; if a turn modified workspace files, view the change card under that reply and click the filename to check the diff.
  3. When things go wrong, click “Restore files only”, “Restore conversation only”, or “Restore all” as needed; when you want to keep the current conversation but try another path, use “Branch from here”.
  4. Click “Set as checkpoint” at a state you are satisfied with; afterwards the input box will continuously compare against the checkpoint, and you can “Restore to checkpoint” at any time.
  5. In the timeline, jump to any turn or checkpoint to view details; read-only turns on the parent branch require switching to the corresponding branch via the card on the change bar before operating.

Use Cases and Caveats

Suitable for developers who frequently let agents modify the same workspace in DSH, want to roll back by “turn”, and want to avoid touching the project’s git history. Also suitable for temporary directories without an initialized git.

Before using, please note:

  • The plugin reads and writes the workspace and ~/.dsh/file-history/ with the permissions of the current DSH process; it is recommended to review the GitHub source and the MIT license before installing.
  • It only follows the conversation’s working directory, with no cross-drive scanning; symbolic links are treated as regular files; changes made before installation are not in history.
  • After manually deleting data under file-history/, history cannot be recovered; this is not a never-lose archive tool.
  • It shares the position with dsh-better-sidebar’s “files produced this turn”; when both are installed, this plugin’s card takes precedence.

Known limitations and data policies are subject to the “Known Limitations” and “Data” sections of the repository README.

Conclusion

dsh-file-history aligns the change granularity of the DSH workspace to “each conversation turn”, completing diff viewing, file restoration, or conversation forking within the conversation, with history decoupled from the project’s git. The current version is 0.2.4 (see the repository’s package.json).

  • SkillHub directory page: https://www.skillhub.cn/plugins/EmptyVessel-000/dsh-file-history
  • Source code and documentation: https://github.com/EmptyVessel-000/dsh-file-history

The community plugin directory is maintained by sites such as SkillHub, and has no official affiliation with DeepSeek / High-Flyer; DSH itself follows the “everything is a plugin” extension approach, allowing you to select from the directory as needed and review the source code yourself.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye