Introduction

The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In multi-session parallel development or complex task decomposition, developers often face context confusion, difficulty sharing memory across sessions, and significantly increased token consumption caused by long conversation histories. dsh-projects-mode is a client plugin built for the DSH Web GUI. It introduces a WorkBuddy-style “project mode,” aiming to address ambiguous session ownership, delayed instruction updates, and context redundancy through a unified project view and context management mechanism.

Core Features

Full-Screen Management Console and Sidebar Entry

The plugin adds a “📁 Projects” entry to the sidebar feature row. Clicking it opens a full-screen project management console in the middle panel. This console serves as the central hub for project management operations and supports creating, renaming, and deleting projects. Deletion requires secondary confirmation and only removes the grouping configuration without affecting underlying sessions.

Real-Time Context Injection

This is the plugin’s core differentiating capability. It allows you to author “instructions” and “memory” for a project:
* Instructions: Implemented through the system-prompt dynamic segment of DSH. Once written, instructions are injected in real time into the context of all sessions in the project. Changes take effect immediately without restarting the session.
* Memory: Memory blocks shared across sessions. After saving, the memory content is refreshed in place at the next model step, rather than being injected as a one-time snapshot, ensuring the context remains up to date.

Automatic Project Brief

To address the high token cost of dragging old session history when creating a new session, the plugin distills a brief from the actual history of recent sessions in the project (including titles, requirements, and session timestamps).
* Effect: A new session only needs a brief of approximately 1,000 tokens, saving more than 95% of the tokens compared with dragging the complete history.
* Mechanism: The brief is cached per session for 30 minutes, and then refreshed in place at each subsequent step.

Token Metering

In the input fields for editing instructions or memory, the plugin estimates the current content’s token usage in real time. If usage exceeds a threshold (for example, 1,500), a yellow warning is displayed; if it exceeds 4,000, a red warning is shown, reminding developers to trim the content.

Working Directory Auto-Assignment (v0.4)

After specifying a working directory path in project settings, sessions started in that directory or its subdirectories are automatically assigned to the project without manual dragging.
* Priority: When project paths overlap, the “longest prefix first” principle applies.
* Interaction: Manually assigning a session overrides automatic assignment, and if it is “removed from selection,” it will not be pulled back by automatic assignment.

Stale Ownership Cleanup and Maintenance
* Cleanup: The project details page provides a “🧹 Clean Stale Ownership” feature that removes records pointing to deleted sessions with one click. The plugin performs a cleanup pass automatically at startup.
* Activity Time: A session’s activity time is calculated based on the modification time (mtime) of its log file, reflecting the actual last activity moment.
* Status Line Hiding: The plugin automatically hides the “Cordis Plugin · N running” status line at the bottom of the sidebar.

API Hardening and Security
* Added Host header validation and Origin same-origin validation to prevent DNS rebinding and malicious pages from driving the API cross-origin.
* The brief cache is capped at 300 entries and trimmed upon ownership changes to prevent memory bloat during long-running operation.

Installation and Enablement

Please ensure the environment meets the dependency requirements: Node.js >= 20.

# 克隆插件到指定目录
git clone https://github.com/BertramWang12399/dsh-projects-mode.git ~/.dsh/plugins/dsh-projects-mode

# 通过 DSH CLI 注册插件
dsh plugin --profile web add link:$HOME/.dsh/plugins/dsh-projects-mode

After installation, the dsh web process must be restarted (DSH Desktop will automatically start the subprocess). In the browser, perform a hard refresh (Mac: Cmd+Shift+R, Windows: Ctrl+Shift+R) to clear the cache and load the new code.

Typical Usage

  1. Launch the Project Console: Click “📁 Projects” in the sidebar to open the full-screen management console in the middle panel.
  2. Manage Context: Author the project’s “instructions” and “memory” in the console. After saving, newly created sessions or the current session immediately receive this context.
  3. Create a New Session: Click “✨ New Session” on the project details page. The system automatically injects the project brief and immediately assigns the new session to the project.
  4. Monitor Tokens: While editing instructions or memory, watch the real-time token estimate above the input field to avoid exceeding model limits.
  5. Use Working Directory: Set the project working directory to /path/to/project. When opening a new session under that directory, the system automatically assigns it to the project without manual action.
  6. Switch Quickly: In the top-right corner of the conversation area, click the floating project badge to quickly switch the project of the current session or remove it from the project.
  7. Maintain the Session List: On the project details page, use “🔎 Filter Session Titles” to quickly locate a specific session, or use “🧹 Clean Stale Ownership” when needed to clean up data.

Notes

  • Data Storage: The plugin’s data file is stored at ~/.dsh/.dsh-projects.. When uninstalling, it is recommended to keep the file manually (or migrate it).
  • Compatibility: The plugin has been verified on macOS arm64 and DSH Desktop (DSH 0.1.1-rc.2), and should theoretically work on Linux and Windows.
  • Log Writing: The plugin does not write any custom events to the session log, avoiding read issues caused by upstream event allowlists.
  • Dependency: Node.js version 20 or higher is required.

Conclusion

By combining DSH session management with a project-based view, dsh-projects-mode provides a complete solution ranging from instruction injection and memory synchronization to token optimization. For developers who need long-term, multi-session collaboration in DSH, this is a practical tool.

More Details and Source Code:
GitHub Repository
Plugin Directory Page