Introduction¶
A coding agent often asks the same or similar questions repeatedly within a project, but each time it must re-read files, search code, or scroll through conversation history, resulting in low efficiency. Cluster Memory records what the agent previously asked, where in which files it found the answer, and what conclusions it reached. The next time the same question arises, it can be answered with a single keyword lookup.
Plugin Positioning¶
Cluster Memory is a DeepSeek Harness plugin that provides memory capabilities to coding agents, categorized under “Memory.” It uses keyword trails (clues) combined with hierarchical search (trail → graph → files → history) to let the agent remember where answers come from within a project. The plugin is maintained by Granit1846, version 1.2.0, built on Node 20+, under the MIT license.
Core Features¶
Hierarchical Search¶
Cluster Memory searches in tiers from lowest to highest cost:
- Keyword trail: Look up keywords from recorded trails, cost approximately 230 tokens
- Code graph / grep: Search code structure using graphify or grep, cost 100–600 tokens
- Source files: Read the target file, cost 1.5–2.5k tokens per file
- Conversation history: Search session history, cost 3–6k tokens
Search stops at the first tier that yields a hit, avoiding unnecessary cost.
Recording Answers¶
After the agent answers a question, the answer can be recorded into the trail, including:
- The question content
- A conclusion summary
- A keyword list
- Related files
- Graph node names
- Outcome (useful / not useful)
Once recorded, subsequent identical or related questions can be answered directly via keyword lookup, without re-reading files or searching code.
Storage Structure¶
A .cluster-memory/ directory is generated in the project root:
- trail.jsonl: An append-only log, one JSON object per line
- index.json: A keyword index, generated by the rebuild command
trail.jsonl is the source of truth; index.json is a derived index. The index retains at most 1200 keywords, and the log is capped at 4 MB with automatic compaction. Each record holds up to 12 keywords.
Installation and Activation¶
Install via DSH Plugin¶
DSH 0.2.0-rc.1+ supports installing bundles directly from GitHub without building or npm publishing. In a DSH session, run:
Install the cluster-memory bundle from github:Granit1846/cluster-memory
This executes the plugin_manager’s install_bundle action with the target github:Granit1846/cluster-memory. It can also be done via the GUI: Plugins → Add plugin → enter the same spec → Install → restart as prompted.
Or use the command-line tool from the terminal:
dsh plugin --profile <name> add github:Granit1846/cluster-memory
After installation, it becomes active in the profile and will be automatically enabled the next time that profile is launched.
Configuration¶
The plugin is configured via profile patches or environment variables. Key configuration items:
| Key | Default | Effect |
|---|---|---|
trail |
true |
Whether to automatically record each settled tool call |
autobuild |
true |
Whether to automatically build the code graph on first read |
autobuildFileLimit |
4000 |
File limit for automatic building |
autobuildTimeoutMs |
300000 |
Timeout for automatic building |
bin |
auto | Path to the graphify executable |
captureDir |
OS temp | Directory for capturing CLI output |
historyHint |
auto |
Whether to suggest using the history tool |
tools |
all 15 | List of tools allowed to be used |
Environment variables use the DSH_GRAPHIFY_ prefix, e.g., DSH_GRAPHIFY_TRAIL=0.
Typical Usage¶
Manual Queries¶
# Tier 1: Look up keyword trails
node scripts/cluster-memory.mjs where "how is the invoice total computed"
# Record an answer
node scripts/cluster-memory.mjs remember \
--question "how is the invoice total computed" \
--answer "parseInvoice strips non-digits; total lives on the invoice object." \
--keywords invoice,total,parse \
--files src/invoice.js --nodes parseInvoice --outcome useful
# View summary and recent records
node scripts/cluster-memory.mjs summary
node scripts/cluster-memory.mjs recent --limit 10
# Rebuild the index
node scripts/cluster-memory.mjs rebuild
When the agent runs outside the project root, specify the project directory via --cwd DIR.
Use as an Agent Skill¶
As a skill, install it into the agent’s skills directory via git clone:
git clone https://github.com/Granit1846/cluster-memory.git ~/.claude/skills/cluster-memory
After installation, run node ~/.claude/skills/cluster-memory/scripts/cluster-memory.mjs summary to verify.
Supported agents include: Claude Code, Codex, Cursor, Gemini CLI, and others.
Use Cases and Caveats¶
Cluster Memory is well-suited for scenarios where project memory needs to be shared across multiple agents, such as:
- Multiple coding agents collaborating on the same project
- Scenarios requiring code structure and decisions to be remembered across sessions
Caveats:
- The plugin runs with the permissions of the current DSH process; review the source code and license before installing
- The trail only records explicitly written content; unrecorded decisions will not appear in memory
- The index uses lexical matching (prefix, stemming), not semantic matching; it cannot be queried via embeddings
- The plugin depends on Node 20+; it has no dependency on databases, servers, or model calls
Conclusion¶
Cluster Memory uses keyword trails and hierarchical search to let coding agents remember where answers come from within a project, reducing the cost of repeated reading and searching. As a DeepSeek Harness plugin, it integrates into the DSH workflow, works in conjunction with the graphify CLI, and can also be used independently as a skill.
For more details, see: GitHub Repository