DeepSeek Harness plugin

dsh-code-index

Semantic repo index for DeepSeek Harness — tree-sitter symbol index, code search, and a bounded ranked repo map injected into agent context.

Jump to install

Source facts

Repository
lemonxiny55/dsh-code-index
Latest update
Aug 22, 2026
Category
Workflow & Automation
GitHub stars
2
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-21

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/lemonxiny55/dsh-code-index
Plugin: dsh-code-index
Author: lemonxiny55

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

dsh-code-index

![npm version](https://www.npmjs.com/package/dsh-code-index) ![CI](https://github.com/lemonxiny55/dsh-code-index/actions)

English | 中文

Semantic repo index — a DeepSeek Harness (dsh) plugin that gives the agent a codebase map: a tree-sitter symbol index, ranked symbol search, and a bounded auto-updating repo map in the system prompt.

Fills a real ecosystem gap: search of the dsh-plugin topic (2026-08) shows git/voice/browser/memory plugins galore, but no native, model-usable code index / repo-map capability — the kind of thing aider's repo-map and Cursor's @Codebase do for their agents.

What the model gets

ToolPurpose
code_indexStatus / (re)build the index for the current workspace
code_symbolsList symbols (functions, classes, interfaces, types, methods…) with file:line — filtered by name, path, kind, exported
code_searchRanked lookup: exact > prefix > substring, exports first, relevance score + file:line
code_mapBounded ranked repo map (top files by symbol density, key symbols + lines)

Plus an optional auto-injected system prompt section (code-index:repo-map, order 60): a compact ranked map of the default workspace, refreshed with a 60s TTL. Set autoInject: false to disable and rely on the code_map tool only.

Install

Requires dsh (any install path — npx, npm, or source) and Node ≥ 22.

# from npm (prebuilt)
npx @deepseek-ai/dsh plugin --profile web add dsh-code-index

# or from a directory containing this checkout
npx @deepseek-ai/dsh plugin --profile web add ./dsh-code-index

Restart the Web UI (npx @deepseek-ai/dsh web) — startup logs confirm each tool:

[dsh-code-index] plugin loaded
[dsh-code-index] registered tool: code_index
...

Verify the composed config without booting: dsh --profile web --dump-config.

Using it

In a workspace session, ask the agent:

  • "Which repo are we in — run code_map first."
  • "Find every function whose name contains parse and where it lives."
  • "List the exported symbols in src/core."
  • "Rebuild the code index."

No API key is needed to index; the model must of course be configured to call the tools.

Example (input → output)

User prompt:

> Which repo are we in? Run code_map first, then find where extractSymbols is defined.

The agent calls the tools in turn:

code_map
# repo map
## src/extract.ts (14)
  function extractSymbols(code, id) :121
  function languageForFile(filePath) :37
  ...

code_search { query: "extractSymbols" }
export function extractSymbols(code, id) — src/extract.ts:121

The index builds lazily on first use; later calls are served from the on-disk cache with mtime-incremental refresh.

Configuration

Options are passed as the plugin row's config in the profile patch (or defaults are used if absent):

# $DSH_HOME/profiles/<name>/cordis.patch.yml — a bare row overrides by id.
- id: code-index
  config:
    excludeDirs: [generated, playground]
    mapTopFiles: 30
    mapMaxChars: 4000
    autoInject: true
KeyDefaultMeaning
excludeDirs[]Extra dirs appended to the built-in excludes (node_modules, .git, dist, build, out, coverage, .next, .nuxt, .cache, target, vendor, …)
mapTopFiles24Max files in a ranked map
mapMaxChars3200Hard cap on rendered map characters
autoInjecttrueRegister the system prompt section

Supported languages

TypeScript + JavaScript + Python (.ts .tsx .mts .cts .js .jsx .mjs .cjs .py .pyi) via tree-sitter WASM — pure parsing, no native build. The symbol provider seam (src/extract.ts + grammars) is where other languages/embeddings plug in later.

How it works

  • Index build (src/buildIndex.ts): recursive scan (excludes applied), per-file tree-sitter extraction (src/extract.ts), JSON cache under <repo>/.dsh-code-index/, incremental refresh by mtime (only touched files re-parse).
  • Search (src/search.ts): pure scoring — exact 1 / prefix 0.8 / substring 0.5, export boost, name order tiebreak.
  • Repo map (src/repomap.ts): density-aware file score (class/interface/function weighted, mild anti-bloat), top-N files, per-file symbol cap, hard char truncation.
  • Workspace resolution: each tool resolves the session cwd (agent.session.header.cwd) and walks up to the nearest .git (bounded — a directory without a repo marker is never indexed).

Known limitations

  • web-tree-sitter pinned to ^0.20.8 — newer releases expect dylinked grammar wasm while tree-sitter-wasms ships static builds; this pair is verified working under Node ≥ 22/24.
  • Auto-injected section targets the default workspace (launch directory, matching headless/CLI mode). Multi-workspace Web UI sessions should use code_map/code_symbols (they resolve per-session cwd).
  • Local variables are indexed too — recall over precision; code_search ranking keeps them low.
  • Developer-preview harness: expect breaking harness/plugin API changes upstream.

Development

pnpm install
pnpm test        # vitest — extractor, scan, cache, search, repo map (35 tests)
pnpm typecheck
pnpm build       # tsup → dist/index.js (ESM, external deps)

License

MIT. Not affiliated with DeepSeek; built on the public dsh plugin surface.