In DeepSeek Harness (DSH), archiving a session usually only hides it from the view list, while the underlying session log file (.jsonl.zstd) and accounting data remain unchanged, causing disk usage to keep growing. The dsh-archive-manager plugin adds a dedicated tab to the settings page, listing all archived sessions and providing true deletion capabilities to resolve disk space consumption.

Core Features

Settings Page Integration

The plugin adds an archive management tab to the settings page, alongside settings items such as “General” and “Models”. This tab lets users view and manage archived data directly in the browser without accessing the file system.

Session List and Deletion

The list displays the title of each archived session, its creation time, and whether its log file exists on disk. Each row provides a delete button. Clicking it opens a confirmation dialog. After confirmation, the session directory, workspace accounting records, and projection cache are removed.

Security and Compatibility

  • Strict validation: Only same-origin requests are accepted, and session IDs are strictly format-validated to prevent path traversal attacks.
  • Environment compatibility: Resolves UTF-8 BOM issues across different PowerShell versions, ensuring consistent file reading and writing.
  • Persistence first: Deletion operations persistently update workspace.json, ensuring the file system stays consistent with in-memory state.

Installation and Activation

1. Install the Plugin Package

Install the plugin package using npm:

npm install dsh-archive-manager-plus

2. Configure Dependency

Add the dependency to the dependencies field in <profile>/package.json:

{
  "dependencies": {
    "dsh-archive-manager-plus": "^0.1.0"
  }
}

3. Register the Bundle

Append the plugin name to the dsh.profile.bundles array:

{
  "dsh.profile.bundles": [
    "dsh-archive-manager-plus"
  ]
}

After installation, run npm install, verify that the package has been added to the configuration directory, then restart DSH and refresh the page.

Usage Steps

  1. Archive a session
    In the sidebar session menu, click the ⋯ menu on any session row and select “Archive session”. It is recommended to first archive 1-2 sessions for testing.

  2. Open the management page
    Click the settings icon (gear) in the top-right corner of the page, go to the “Settings” page, and click the “Archive Management” tab.

  3. Delete
    Find the archived session in the list and click the “Delete” button. In the confirmation dialog, click confirm. The session row will disappear from the list, and the corresponding disk log file and cache will also be cleared.

Notes

  • Scope: The plugin only provides functionality to delete archived sessions and cannot delete currently running sessions.
  • History retention: Deleting a session only cleans up session logs and accounting data; expenditure history (cost-meter/ledger.json) is retained.
  • State remnants: After deletion, in-memory state may persist briefly until the next connection or page refresh.
  • Technical implementation: The browser-side code is packaged as handwritten CommonJS, while the host-side code consists of pure ESM modules.
  • Security restriction: The plugin’s host side only accepts same-origin requests, ensuring legitimate request origins.

Summary

This plugin fills the gap left by DSH’s official archive feature, which only hides sessions without deleting them, by allowing users to directly clean up sessions that consume disk space from the settings page. Through strict validation mechanisms and persistence-first update logic, it ensures that file cleanup is performed while maintaining system state integrity.

View plugin directory
View source code and documentation