Introduction¶
When developing agents with DeepSeek Harness (DSH), similar issues often recur across different sessions: tool exit code misjudgments, unset environment variables, or commands with inconsistent behavior between Windows and Linux. Common solutions include starting a new model turn for “review” or maintaining an ever-growing MEMORY file—the former incurs an extra API call and context drift, while the latter is difficult to version-control and hard to align with the host’s native skill system.
This article introduces the community plugin dsh-learn (maintained by xiex16070-jpg, categorized as “Memory” on SkillHub): it hooks into the session event stream and uses deterministic rules to propose candidates from user corrections, failures, and fixes. The actual persistence to disk is explicitly decided by the foreground model. The output consists of standard DSH skills under <DSH_HOME>/skills/learned/, without creating a secondary registry. The README explicitly states zero additional model calls.
What is this¶
dsh-learn is a Cordis plugin, currently at version 0.3.13 (MIT, package.json requires Node >=22.19 and DSH >=0.2.0-rc.1). It listens to session/event (user messages, assistant messages, tool results), maintains a bounded observation window in memory, performs a review after a turn ends, and writes candidates to <DSH_HOME>/learn/data/. The skill body and four “umbrella skills” (durable-preferences, tool-recovery, environment-facts, agent-engineering) are placed in the skills directory for retrieval via learn_skills and loading via /skill-name.
The central division of labor is clearly described in the README: regex and thresholds only generate candidates; writing skill files can only be triggered by the model calling learn_skill_manage create or learn action=note. The system prompt remains stable, while queues and rule excerpts are passed via the host runtime context without rewriting persistent session history.
Core Features¶
Learning Loop with Zero Additional Model Calls¶
| Phase | Behavior |
|---|---|
| Observe | capture desensitizes, compresses, and categorizes signals by source (user/assistant/tool have specific types; see SOURCE_KINDS in text.js) |
| Review | Runs runReview after agent/turn-stopping with a ~4-second debounce; only writes pending.json. The window requires ≥ review.triggerObservations (default 3) observations |
| Persist | After viewing learn action=pending, the model decides to create skills or record rules in umbrella skills. Existing rules with similarity ≥ review.similarity (default 0.6) are reinforced rather than duplicated |
| Maintain | curator checks for expiration every 10 minutes, marking stale items or moving them to archive when idle and interval requirements are met (move only, no deletion). Skills with load count ≥ 3 are not automatically archived |
Dedicated Skill Root and Self-Registering Provider¶
The host file system skill provider typically only scans one level deep under the skill root, so three-level paths like <skills>/learned/<name>/SKILL.md cannot be scanned by default. The plugin registers <DSH_HOME>/skills/learned/ with the host via registerProvider() in lib/provider.js with a rank of 330, requiring no profile changes. Before writing, it runs a probe skill learn-root-probe to ensure the directory is visible to the host before migrating plugin-managed skills.
Visible Feedback and Self-Checks¶
In the browser client, after each turn ends, a colored receipt is displayed below the reply (only counting model-initiated learn* write operations in that turn; auto-review enqueueing does not produce a receipt). Use the following for troubleshooting:
learn action=status
learn action=doctor
Developers can run npm test in the plugin directory (README: 23 host-side assertions + browser-side checks, zero dependencies).
Installation and Activation¶
In the DSH ecosystem, plugins are mostly integrated as Cordis bundles; this plugin is included in the awesome-dsh-plugin list. The README recommends installing from the repository’s pre-built package, available at:
https://github.com/xiex16070-jpg/dsh-learn/releases/latest/download/dsh-learn.tgz
The asset name does not include a version number, ensuring the releases/latest/download/ link remains valid long-term.
For manual installation, place the plugin directory in the profile’s node_modules/dsh-learn/ and list "dsh-learn" in the dsh.profile.bundles of the profile’s package.json. The plugin’s cordis.patch.yml only inserts a single loader with id: dsh-learn. The README also clarifies that since it is not yet published to the npm registry, installation via plugin_manager’s install_bundle package name is currently unavailable; manual copying is a workaround when the documented path is unusable, rather than a long-term recommendation.
After installation, do not declare peerDependencies for @deepseek-ai/dsh-* in package.json, otherwise the host may silently skip the entire bundle.
Typical Usage¶
Consolidating Skills into a Dedicated Root¶
First perform a dry run to view the plan, then execute the migration (no skills will be moved if the probe fails):
learn action=organize dryRun=true
learn action=organize dryRun=false
Model-Side Persistence Entry Points¶
- New standalone skill:
learn_skill_manage(create, etc.;descriptionis required as a controlled write entry) - Append rule to umbrella skill:
learn action=note(requiresstatement) - Browse candidate queue:
learn action=pending - Semantic retrieval of learned content:
learn_skills(read-only, requiresquery)
Candidates where the user explicitly requests “remember” and satisfy source conditions can be persisted directly by the review path; other candidates require the model to call the above tools based on the pending list.
Configuration Essentials¶
Configuration is parsed via normalizeConfig(), with relative paths relative to <DSH_HOME>. Common defaults include: dataDir is <DSH_HOME>/learn/data, capture.maxSessions 8, maxItemsPerSession 120, curator.staleAfterDays 14, archiveAfterDays 30. For the full key list, see the “Configuration” section in the GitHub README; the README emphasizes that every configuration key has a reader in the code, verified by npm test.
Use Cases and Notes¶
Suitable for: Long-term development of toolchains, environments, and workflows within the same DSH profile, where you want to distill “fixes for pitfalls encountered this time” into readable, editable, git-manageable SKILL.md files, rather than relying on additional review models or monolithic memory files.
Notes:
- The plugin reads and writes to the home directory with the current DSH process permissions; please read the source code and LICENSE before installation to ensure compliance with your security and compliance requirements.
- Deterministic paths have experienced false matches (the v0.1.0
REMEMBER_REincident); the current design deliberately returns the decision of “what is worth remembering” to the model. High candidates and low persistence are expected behaviors. - SkillHub (https://www.skillhub.cn/plugins/xiex16070-jpg/dsh-learn) is a community directory site with no official affiliation with DeepSeek / High-Flyer; metadata such as stars is subject to the display at the time on each page (the GitHub repository currently has 1 star).
Conclusion¶
dsh-learn converges “persistent learning” into a conservative loop: observe real event streams, queue candidates, explicit model persistence, output standard skill files, and use a curator for reversible archiving. If you repeatedly correct the same type of errors in DSH, you can install the bundle according to the README, use learn action=doctor to confirm the dedicated root is registered, and let the fixes in the session gradually enter skills/learned.
- Directory Page: https://www.skillhub.cn/plugins/xiex16070-jpg/dsh-learn
- Source Code & Docs: https://github.com/xiex16070-jpg/dsh-learn