Introduction¶
When performing a productive task in DSH, such as modifying a batch of files or generating images, one often needs to explain “what was done and what was left behind” upon completion. The built-in /export command only retrieves the raw session.vN.jsonl and attachments referenced in the logs. It discards readable conversations and fails to copy files that were written to, modified within, or submitted via present in the working directory. Common community plugins for readable transcripts, conversely, focus solely on the conversation and ignore output files.
zhyunran/dsh-session-bundle fills this gap: a /bundle command that bundles readable conversations, raw logs, attachments, and session-produced/modified files into a ZIP archive, saving it to the host disk.
What is it¶
A DSH client plugin by maintainer zhyunran, categorized under ‘client’. It currently has 1 star on GitHub and 22 unit tests passing in the repository (node --test test/*.test.mjs). The README explicitly states: no build steps required, no runtime dependencies, and requires DSH 0.2.x.
It solves the problem of “incomplete export”: /export cannot retrieve conversation.md, nor can it retrieve files written by the session within the working directory; the latter is precisely the basis for judging the result of an Agent run.
What’s in the Export Package¶
The directory structure of the ZIP after saving is taken from the README “What’s inside”:
README.txt
conversation.md readable transcript
session.v4.jsonl raw durable event log (JSON Lines)
manifest.json machine-readable file index, counts, skips
files/
attachments/ bytes of every file/image attachment
produced/ files from present/write/edit/str_replace_editor
external/ changed files outside the working directory
workspace/ copies of files changed in working directory
The structure of conversation.md includes a header with the session ID, working directory, creation/export time, model, turns, and message/tool call counts; each turn is separated by ## Turn N; user messages carry source labels (user, agent message from <session>, schedule, etc.); tool calls and results are placed in collapsible blocks with complete arguments and truncated outputs; attachments point to files/attachments/; files presented via present and files modified in each turn contain links pointing to within the bundle; and finally, a complete file manifest table is provided.
System prompts, developer messages, request headers, reasoning, and injected runtime context are omitted from conversation.md by default (both can be configured to enable). session.v4.jsonl is the true source of raw data.
How to Determine “Session-Produced” Files¶
The collector takes the union in the order listed below, deduplicating by absolute path, as described in the README “How files produced by this session are found”:
- Attachments: All
file/imageblocks in user, assistant, and tool-result content; bytes sourced from attachment storage. - Presented files:
deliverables/presentedevents, withpresenttool calls as a fallback. - File tool writes:
write,edit,str_replace_editorcalls, parsed relative to the session working directory. - Workspace change summary:
workspace/changesevents plusctx.workspaceChanges.summary(), which are snapshots of changes recorded by the host git-worktree/file tools per turn. This step covers files produced by shell commands. Note that these summaries exist only in host memory and may be lost after a restart. - Modified file scan: Triggered when
includeWorkspace: autoand no summary exists (oralways), scanning files in the working directory with mtime newer than the session start time, skipping.git,node_modules, cache, virtual environments, etc.
Deleted files are only recorded in the skipped list of manifest.json as missing (deleted or moved). Their content cannot be recovered from disk, only their names and counts are present in the change summary. All content has size limits and includes SHA-256 hashes in the manifest.
Installation and Activation¶
Installation commands are taken from the original README. The npm method is marked as “if published”; do not concatenate dsh plugin add github:owner/repo based on the plugin name.
# local tarball (absolute path)
dsh plugin --profile <profile> add C:\path\to\dsh-session-bundle-0.1.2.tgz
# or GitHub tarball (git not required)
dsh plugin --profile <profile> add https://codeload.github.com/<owner>/dsh-session-bundle/tar.gz/<40-char-commit>
# or npm, if published
dsh plugin --profile <profile> add dsh-session-bundle
After installation, restart DSH and type /. The bundle command should appear in the command list. The repository’s package.json has version 0.1.2, license is MIT, the peer dependency range for @deepseek-ai/dsh-tools is >=0.2.0-rc.1 <0.3.0, and engines.node requires >=22.19.0.
Two Usage Modes¶
Triggered by a human: Simply type /bundle in the session to export, with no parameters.
/bundle
Without parameters, the ZIP is saved to Desktop/DSH-Exports/ on Windows and to <home>/DSH-Exports/ on other platforms. The command result echoes the exact path and does not open a browser or file selection dialog.
Triggered by an Agent: Instruct the Agent to call the export_session_bundle tool, for example by saying “Export this conversation and its produced files into a bundle”.
{
"include_workspace": true, // optional: force a modified-file scan
"include_raw_log": true, // optional
"output_dir": "D:/exports" // optional
}
All three fields are optional. The output directory and scope of inclusion can also be fixed via profile-level configuration.
Configuration¶
Configuration is written in <DSH_HOME>/profiles/<profile>/cordis.patch.yml. The example provided in the README is:
- id: dsh-session-bundle
config:
outputDir: 'D:/exports' # default: Desktop/DSH-Exports or <home>/DSH-Exports
includeWorkspace: auto # auto | always | never
includeAttachments: true
includeRawLog: true
includeReasoning: false
includeInjectedContext: false
maxFileBytes: 52428800 # 50 MiB per file
maxTotalBytes: 314572800 # 300 MiB per bundle
maxWorkspaceFiles: 300
maxWorkspaceBytes: 209715200 # 200 MiB for workspace copies
maxToolChars: 4000 # per tool call/result in conversation.md
maxMessageChars: 20000 # per message in conversation.md
maxRawLogBytes: 52428800
ignoreNames: ['.git', 'node_modules', '__pycache__', '.venv', 'venv', '.next', '.cache']
Field meanings are per the README table: When includeWorkspace is auto, it uses the summary if available, otherwise it scans; always does both; never skips workspace snapshots (explicitly produced files are still retained). includeReasoning and includeInjectedContext control whether conversation.md includes the reasoning block and injected user role context. When the configuration is invalid, it falls back to default values and logs a message, but does not prevent DSH from starting.
Use Cases and Considerations¶
Suitable for users who need to archive, hand over, or reproduce tasks after completion: a ZIP archive contains readable conversations, machine-readable indices, and the actual artifacts, making it more complete than manually copying information from the working directory. It is also suitable for scenarios where one needs to compare the actual changes in a session with the workspace/changes summary. The README states that end-to-end verification has been performed on DSH 0.2.0-rc.2.
Several points need attention. First, the plugin runs with the permissions of the current DSH process and can read files in the working directory. It is recommended to review the source code and the MIT license before installation, obtained from the skillhub directory page or the GitHub repository. Second, the export relies on change summaries in host memory. Summaries are lost after a process restart, causing includeWorkspace to degrade to an mtime scan, during which disk changes are not distinguished by source. Third, there is a size budget: 50 MiB per file, 300 MiB total for attachments and production, 300 files/200 MiB for workspace copies, and 50 MiB for raw logs. Parts exceeding the limit are only recorded in manifest.json. Fourth, there is currently only 1 star, indicating a project in its early stages. The statement regarding “end-to-end verification” in the README is also limited to the author’s own environment.
Summary¶
What dsh-session-bundle does is actually quite simple: it merges the session conversation, raw logs, attachments, and session-produced files into a ZIP archive, saving it to the host disk. Compared to the core /export, it adds readable transcripts and working directory artifacts. Compared to plugins that only handle transcripts, it adds output files. In this way, it precisely fills the gap in the middle. The directory page is at https://www.skillhub.cn/plugins/zhyunran/dsh-session-bundle , and the source code is at https://github.com/zhyunran/dsh-session-bundle .