Three-tier agent memory harness: L1 always-on CLAUDE.md, L2 index, L3 detail skeleton with templates, a gate that blocks writes to protected files without a one-time approval token, zero-judgement event logging, weekly distillation, and a TDD execution-loop skill.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:reatcat/l123-harness
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
中文 | English
A battle-tested agent methodology packaged as a plugin for both
Claude Code and DeepSeek Harness (dsh) — one codebase, two hosts.
Aligned with the "everything is a plugin" design: the host is the kernel;
this plugin only contributes capability components — context injection,
gates, event recording, memory distillation — each individually
understandable, all removable as a whole. Project knowledge does not live in
the plugin: after installation the project accumulates its own.
The four principles
- State outside the model — conclusions, plans and progress go to disk; the context window only holds what the current task needs.
- Objective observation — test red/green, command output and log data are evidence; reasoning is not.
- No divergence in the inner loop — the spec governs the plan, the plan governs step boundaries, TDD governs stop conditions.
- Upgrades require approval — memory is written freely; promotion to knowledge / skill / L1 / L2 requires explicit user approval.
Three-tier memory
| Tier | Carrier | Character |
|---|---|---|
| L1 always-on | CLAUDE.md |
Small, stable cache prefix: principles, priorities, safety floor, routing table |
| L2 index | .agents/INDEX.md |
symptom → one-line rule → L3 pointer; injected automatically by the SessionStart hook |
| L3 detail | .agents/** |
knowledge / pitfalls / runbooks / current / events / inbox |
Install
Claude Code
# A: local development
claude --plugin-dir /path/to/l123-harness
# B: permanent personal install
cp -r l123-harness ~/.claude/skills/
# C: git distribution (this directory is a single-plugin marketplace)
# /plugin marketplace add <git-repo>
# /plugin install l123-harness
DeepSeek Harness (dsh)
The repository is also a standard dsh bundle (package.json declares
dsh.bundle + a root cordis.patch.yml). Plain JavaScript, no build step —
git installs need no pnpm build approval:
dsh plugin --profile web add github:reatcat/l123-harness
Local development note:
dsh plugin add <local-path>uses a pnpmlink:, which does not install this plugin's bridge dependency — hooks degrade (skills only, with a startup warning). To test locally, use a tarball:npm pack && dsh plugin --profile web add ./l123-harness-*.tgz, or runpnpm installinside the plugin directory first.
On mount, two things happen automatically:
- Skills — the four methodology skills are registered on
ctx.skillsand surface through the standardskilltool; - Hooks bridge — the official
@deepseek-ai/dsh-hooks-claude-codebridge is mounted and runshooks/hooks.jsonas-is.
| hooks.json event | dsh bridge | Notes |
|---|---|---|
| SessionStart (L2 injection + event) | ✅ | JSON additionalContext output, dual-host compatible |
| PreToolUse (gate-guard) | ✅ | matcher includes DSH edit/write/str_replace_editor; exit 2 → deny |
| PostToolUse (tool_error log) | ✅ | observation-only |
| Stop (boundary event) | ✅ | observation-only |
| PreCompact (checkpoint rescue) | ⚠️ not bridged yet | config is safely ignored |
| SessionEnd (boundary event) | ⚠️ not bridged yet | same as above |
Usage
/l123-harness:init-harness # bootstrap a project: L1/L2/L3 skeleton + gate list
/daily work: L2 index injected automatically; the gate blocks protected
/files; events are recorded automatically
/l123-harness:event-review # weekly review: events → inbox candidates → triage
Under dsh the same skills are available as init-harness, event-review,
tdd and write-a-skill through the skill tool and user commands.
Discipline quick reference
- Changing a protected file: explain to the user → approval →
touch <project-root>/.claude/.gate-token→ retry. .agents/inbox/must not be read while working; candidates are not conclusions..agents/events/is read-only and immutable.- Knowledge promotion path: context → memory (freely) → inbox (weekly review) → knowledge / L2 (human-approved).
License
MIT
Links
More in this category
vectorize-io/hindsight#coding-agents★ 62276
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 42543
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12467
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3827
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2915
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1639
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.