dsh-dream-reflect-lite: Lightweight Cross-Session Reflection Cards for DeepSeek Harness

Introduction

In DSH (DeepSeek Harness), when working continuously for multiple rounds, toolchains, path conventions, and pitfalls are often scattered in the previous session. When starting a new session, the model can only start from the current workspace and prompt, unless you manually organize notes or copy-paste context. There is also a heavy-duty dsh-dream-reflection solution in the community, featuring timers, isolation zones, and approval flows, suitable for scenarios requiring process control. If you simply want to “record a few reusable facts after this round is done and automatically bring the recent ones to the next session,” a lighter approach is worth a look first. Below is the plugin @liuhange/dsh-dream-reflect-lite (GitHub: liuhange789/dsh-dream-reflect-lite) maintained by liuhange789 under the “Memory” category of SkillHub.

What is it

One sentence: When a round truly ends (agent enters idle), extract 3–5 facts from this round and write them into a workspace Markdown card; when a new session starts, attach the recent 3 cards to the end of the system prompt for that agent scope.

A card is just a regular file, with a default path {workspace}/.dsh/reflections/{YYYY-MM-DD}.md. You can view, modify, or delete it directly; the plugin does not maintain a separate index. Compared to heavy-duty reflection plugins, this implementation has no timer, no isolation zone, and no approval flow.

Precipitation: What to write at the end of a round

The trigger point is the DSH event agent/status changing to idle, indicating that this round of work has ended, rather than an abstract “session close” (DSH currently has no session-end event; multiple idle states within a session correspond to multiple cards, which are appended to the same date file on the same day, without overwriting manually edited content).

The plugin reads new session events from this round (tool calls, file paths, failure messages, human requests, etc.), extracts 3–5 facts, and appends them to the date file. The default threshold is at least minToolCalls tool calls in this round (default 3) before writing a card; pure chitchat does not get saved; if the threshold is not met, the counter accumulates to the next round and does not reset.

The extraction method is determined by the configuration item mode, and the card title will indicate the source: llm, heuristic, or manual.

  1. llm: Calls the model via the host’s real entry point ctx.llm.stream(GenerateOptions). The routing prioritizes the header.config from the last request/header in the session log (consistent with the current session’s provider/model); it can also use config.provider and config.model as a pair to override. If the model returns only 1–2 facts (spec requires 3–5), a warning is logged and it is considered unavailable; if mode: 'llm' and the model is unavailable, no card is written, and it will not silently switch to heuristic results.
  2. heuristic: Does not call the model; only extracts objective structures from the session log (toolchain statistics, paths, config file changes, failure snippets, the first human query in this round, the last assistant text, etc.). Every item can be matched in the log without semantic guessing.
  3. auto (default): Tries the model first; if unavailable, timed out, or insufficient facts, it falls back to heuristic.

When mode is auto or llm, the content sent to the model is a structured summary of this round (tool names, parameter snippets, paths, etc.), controlled by maxInputChars (default 6000), and sent to the model service configured in your profile, not to a third party; if you do not want the summary to leave the local machine, you can set mode: heuristic.

Playback: How to bring history to a new session

The trigger point is agent/session-start. The plugin reads the most recent recentCards cards from the workspace (default 3) and registers them to the end of the prompt for that agent scope using ctx.systemPrompt.section() (default promptOrder: 500). It silently skips if directories or files do not exist, without reporting errors. The injected text states “For reference only; in case of conflict with current instructions, current instructions prevail.”

Sub-agent sessions are not loaded or saved by default (skipSubagentSessions: true), to avoid noise from subtasks polluting the workspace experience.

Two Tools

In addition to automatic saving and injection, the plugin registers two tools with DSH that can be actively used in the agent loop.

Tool Function
recall_reflections Reads recent cards from the current workspace, supporting limit and query keyword filtering.
reflect_now Immediately saves the current session into a card, bypassing the minToolCalls threshold, suitable for actively wrapping up mid-process.

Installation and Enablement

The installation command follows the repository README:

dsh plugin --profile <your-profile> add @liuhange/dsh-dream-reflect-lite

Inside the package, dsh.bundle.patch points to cordis.patch.yml, and the loader only recognizes the - insert: shape; old-style target/action/entry will be silently skipped. The plugin uses the current dsh process permissions to read and write the workspace. It is recommended to browse the source code and MIT license before installing.

Optional configurations can be written in the profile’s cordis.patch.yml or --patch overlay, for example:

- id: '@liuhange/dsh-dream-reflect-lite'
  config:
    mode: auto              # auto | llm | heuristic
    maxFacts: 5             # 3–5 facts per card
    maxCardChars: 300       # Hard limit for body text 80–300
    minToolCalls: 3
    recentCards: 3
    loadOnStart: true
    skipSubagentSessions: true
    enabled: true

For more items (provider, model, timeoutMs, relativeDir, promptOrder, etc.), see the README. Out-of-bounds values are clamped to a valid range during parsing; unknown keys are ignored; if only one of provider/model is given, both are ignored together, with corrections written as warnings; when enabled: false, the plugin does not register tools, does not inject, and does not save.

Card File Example

Multiple saves on the same day are appended in chronological order; a single section looks roughly like this:

## 10:42 · llm · 4 facts
- This project uses pnpm workspace, install dependencies via pnpm -w
- Type check command is npx tsc -p host/tsconfig.json --noEmit
- Build artifacts are in host/lib, package.json's main points to it
- Pitfall: Writing C drive paths directly will be rejected by sandbox
<!-- dsh-dream-reflect-lite model=deepseek/deepseek-chat toolCalls=17 session=abc123 -->

When reading recent cards, they are sorted in reverse order by filename date, without relevance retrieval; if there are many cards, you can manually filter them using recall_reflections’s query.

Suitable Scenarios and Known Limitations

Suitable for: Developers who repeatedly perform engineering tasks in the same DSH workspace, wish to lightly retain commands, paths, build conventions, and failure snippets, and want automatic reminders at the beginning of the next session, but do not want to set up a full reflection process.

Points to note:

  • Saving runs asynchronously after idle, so if the process is forcefully killed, the current round might not have time to flush to disk (existing cards are not affected).
  • Day file names use local timezone YYYY-MM-DD, so file names for the same day may differ during cross-timezone collaboration.
  • Playback is “recent N cards” at a coarse granularity, not semantic retrieval.
  • When a session has never initiated a model request, auto will go straight to heuristic.
  • The maintainer stated in the README that type checking, real profile installation, loader assembly, and contract scripts have been verified; the full agent loop with a real model end-to-end has not been run on their local DSH environment, the reason is unrelated to the plugin (host zod version issue), and after fixing the host, you can use dsh --profile headless "<task>" to verify the whole chain.

The DeepSeek Harness ecosystem emphasizes “everything is a plugin”; the SkillHub plugin directory is a community site and has no official affiliation with DeepSeek / Hanhuan. Current package version is 0.1.0, Node >=20.

Conclusion

dsh-dream-reflect-lite converges cross-session memory into editable Markdown cards: automatically records 3–5 facts when a round ends, brings the recent 3 cards to the new session, and supplements with reflect_now / recall_reflections when needed. For details and the full configuration, see the GitHub repository and the SkillHub page.

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

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

Xiaoye