Introduction¶
In the DeepSeek Harness (DSH) Web interface, when using the write or edit tools, files are typically opened as plain text. If you want to visually see the exact changes made to a file during the current conversation (such as added or deleted lines), the default view is often not intuitive enough. This requires a solution that can automatically identify session changes and provide a git-style diff view.
What Is This¶
dsh-session-diff is a client-side plugin maintained by 2002XiaoYu. Its core function is to provide session-scoped git-style diff decorations in the DSH Web right sidebar. It solves the problem of being unable to quickly inspect code change details during a conversation, turning the ordinary text viewer into a code diff view with highlighting.
Core Features¶
The plugin provides the following core capabilities:
- Decorated file view: Renders files in the right sidebar with git-style highlighting (added/deleted line backgrounds, +/− markers) and syntax highlighting.
- Session Changes page: Lists all files changed in the current conversation along with their change statistics (+/− counts and directories).
- Real-time updates: Every new edit re-reads the file and recalculates the diff.
- Untouched files keep original behavior: Unchanged files continue using the original text viewer, without affecting the rendering of other documents (such as images or PDFs).
- No host-side behavior: The plugin does not run shell, git, or directly access the filesystem; it only retrieves content remotely via DSH’s
workspaceFiles. - Handwritten tokenizer for common languages: Built-in syntax highlighting support for many mainstream programming languages.
Installation and Activation¶
Since there is currently no npm release, it must be installed from the repository. After installing or upgrading, you must restart dsh web and refresh the browser.
dsh plugin --profile web add github:2002XiaoYu/dsh-session-diff
Typical Usage¶
- Open a file changed in the current conversation; the sidebar will display a git-style diff view.
- Click an entry in the Session Changes page to open the decorated view.
- Use the header buttons to switch between “Changes only” and “Entire file” views, or re-read the file.
Use Cases and Notes¶
- Current conversation only: Only changes from the current conversation are shown; changes from other conversations or manual edits are not shown.
- Long conversation limitation: In long conversations, the earliest change entries may be lost because the list is calculated based on the client-retained conversation window.
- File read limit: The file read limit is 20,000 lines.
- Path matching: Fragment paths are matched to address paths by suffix; invalid matches are rejected.
- Error handling: Rewritten file entries are marked as unlocated; deleted files report a read failure instead of crashing.
- Language support: The tokenizer supports Dart, JS/TS, JSON, YAML, Python, shell, CSS, HTML/XML, Markdown, SQL, Java/Kotlin/Swift/C-family, Go, Rust, PHP. Unsupported file suffixes are rendered without color.
Summary¶
For developers who need to quickly review code changes in the DSH Web interface, dsh-session-diff provides a lightweight and non-intrusive solution. It seamlessly integrates git-style diff views into the conversation flow through sidebar decorations and a session changes list.