DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Code Index — DSH Plugin for DeepSeek Harness
← Plugins

dsh-code-index

Code Index

Structural context engine for DSH — tree-sitter symbol index, ranked search, repo map, call graph, and change-aware context.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add dsh-code-index@0.7.0
READMECompatibilityVersions
code_refs on dsh-code-index: definitions, 7 callers with their enclosing function, and callees resolved to file:line

Compatibility and provenance

Code Index is published as dsh-code-index and currently resolves to version 0.7.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
npm
Registry updated
9/20/2026

Versions

0.7.0stable
9/19/2026
0.6.1stable
9/18/2026
0.5.0stable
9/13/2026
Show 6 more versionsCollapse versions
0.4.0stable
9/8/2026
0.3.1stable
9/5/2026
0.3.0stable
9/3/2026
0.2.0stable
8/28/2026
0.1.1stable
8/22/2026
0.1.0stable
8/21/2026

Related plugins

Loading related plugins…

Latest
0.7.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
512.8 kB
Files
12
Surface
web
License
MIT
Source
npm
GitHub
★ 4
Weekly downloads
719
Security scan
✓ v0.7.0 scan passed
Last push
9/19/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

Related plugins

More verified plugins in developer-tools.

Web App@deepseek-ai/dsh-web-appThe dsh browser-surface bundle: the web patch layer over dsh-base plus the runtime glue plugin (frontend dist serving, web-surface prompt, bash runtime variables, URL line)Sdk Minimal@deepseek-ai/dsh-sdk-minimalThe standalone minimal SDK profile bundle: JSON-RPC, one DeepSeek adapter, persistent shell, and JSONL sessionsSdk App@deepseek-ai/dsh-sdk-appThe dsh SDK profile bundle: stdio JSON-RPC serving and process lifecycle over dsh-baseSubagent Codex@deepseek-ai/dsh-subagent-codexOne-shot Codex subagent provider over the official app-server protocol

README

dsh-code-index

English | 中文

Structural context engine for DeepSeek Harness (dsh): a local, no-service, no-API-key tree-sitter index that gives agents the smallest useful structural context for the task at hand.

Fits a niche the ecosystem took a while to fill: alongside git/voice/browser/memory plugins, several code-intelligence plugins have appeared (graph-based, embedding-based), while this one stays deliberately dependency-free — pure in-process tree-sitter over WASM, the aider repo-map / Cursor @Codebase style for dsh 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 > subsequence-fuzzy, exports first, relevance score + file:line
code_mapBounded ranked repo map (top files by symbol density + import-graph PageRank, key symbols + lines)
code_refsTrace a symbol through the call graph: callers (who calls it) and callees (what it calls), resolved to file:line
code_change_contextStart from the working-tree or an explicit diff and return changed symbols, callers, import dependents, bounded impact paths, and likely tests
code_contextTask-aware unified entry point: routes a plain-language task across search, repo map, call/import graph, change context, tests, and a hard character budget
code_healthOpt-in (codeHealth: true): circular dependencies (import cycles) and orphan modules

Plus an optional auto-injected system prompt section (code-index:repo-map, order 60): a compact ranked map of the default workspace, refreshed on a TTL (mapTtlMs, default 60s). 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."
  • "What changed in the working tree, who calls it, and which tests are likely affected?"
  • "Fix duplicate configuration loading during startup." (the router selects the smallest useful context automatically)

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.

Call graph

code_refs traces a symbol through the call graph — the run below is on this repo itself (getIndex is defined at src/tools.ts:105, called from 7 sites, and its callee resolves to src/tools.ts:74):

code_refs on dsh-code-index: definitions, 7 callers with their enclosing function, and callees resolved to file:line

Change-aware context

code_change_context defaults to the current Git working tree against HEAD. It also accepts an inline unified diff, repo-relative files, or stable symbols IDs. Results are bounded and each inferred relationship carries a provenance label: exact, import-scoped, or name-only. Deletions and renames use the baseline ref when available; untracked non-ignored files are included in working-tree mode.

Task-aware context

code_context is the high-level entry point for agents that have a task rather than a symbol query. The deterministic router recognizes change, symbol, architecture, test, exploration, and ambiguous tasks, then ranks existing primitives into one bounded package:

code_context { task: "Fix duplicate configuration loading during startup" }

Task context — change
Primary symbols:
- [exact] function loadConfig() — src/config.ts:42
Relevant files:
- src/config.ts (current change)
- src/bootstrap.ts (entry path)
Relationships:
- bootstrap → loadConfig at src/bootstrap.ts:18 [exact; explicit-import-binding]
Current changes:
- modified function loadConfig() src/config.ts:42 [exact]
Likely affected tests:
- tests/config.spec.ts
Budget: 3720 / 5000 chars

The budgetChars, maxFiles, and maxSymbols arguments are optional. code_context does not call an external model or API; exact, import-scoped, and name-only provenance remains explicit for inferred relationships.

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
    toolSurface: full
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
mapTtlMs60000Refresh interval for the auto-injected map (ms, min 1000)
autoInjecttrueRegister the system prompt section
codeHealthfalseRegister the code_health tool (cycles / orphan modules)
toolSurfacefullExperimental compact mode exposes code_index, code_context, and enabled code_health; full preserves all tools

Supported languages

TypeScript, JavaScript, Python, Go, Rust, Java, C++ and C (.ts .tsx .mts .cts .js .jsx .mjs .cjs .py .pyi .go .rs .java .cpp .cc .cxx .c++ .hpp .hxx .hh .h .ipp .tpp .inl .c) 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. C/C++ symbol extraction resolves names through the declarator chain (templates, qualified ns::name definitions, in-class methods), and #include "…" specifiers feed the repo-map reference graph.

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): personalized PageRank over the import graph (teleport = per-file density share, so hub files that are themselves imported by other hubs rise above flat in-degree counting), seeded by the density-aware file score (class/interface/function weighted, test paths damped), top-N files, per-file symbol cap, hard char truncation.
  • Call graph (src/refgraph.ts): call sites extracted per file (per language, with their enclosing function) are resolved by name into callers and callees — code_refs exposes this directly, and code_search uses call fan-in as a ranking tie-break.
  • Change context (src/change-context.ts): maps Git hunks to stable symbols, then follows bounded provenance-labeled callers, import dependents, entry paths, impact, and likely affected tests without returning the whole repository.
  • Task-aware context (src/context.ts): deterministically routes a task across the existing search, map, call graph, change context, and test signals, then deduplicates and trims them to a hard character budget.
  • Health (src/health.ts): Tarjan SCC over the import graph yields circular dependencies; orphan-module detection lists symbol-bearing files with no inbound or outbound imports (entry points and tests excluded).
  • 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.25 (ESM) — the 0.25 line uses ESM named exports (Language/Query); this pairing with tree-sitter-wasms static builds 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, call graph, health
pnpm typecheck
pnpm build       # tsup → dist/index.js (ESM, external deps)
pnpm build && pnpm release:smoke # pack, clean-install the tarball, boot the plugin, and exercise core tools

The benchmark harness under bench/ compares stock DSH, the published 0.5 baseline, the v0.6 change-aware treatment, and the v0.7 task-aware treatment. It records task completion, input tokens, tool calls, turns, and wall time; it does not invent missing provider usage. The repository contains infrastructure and sample tasks, not measured performance claims.

WSL → Windows checkouts: running pnpm install from WSL against a checkout on /mnt/c leaves Linux-style symlinks that Windows Node cannot traverse (Cannot find package 'web-tree-sitter', EACCES). Repair without a reinstall from the Windows side:

node.exe scripts\fix-wsl-links.mjs            # this repo's node_modules
node.exe scripts\fix-wsl-links.mjs C:\Users\you\.dsh\profiles\web   # a dsh profile install

It re-points every dead link at its real .pnpm store entry as a junction; safe to re-run (idempotent, reports fixed: 0 when clean).

Feedback

Found a bug, or the map ranks something badly? Please open an issue — real-world usage reports (repos where the ranking misbehaves, languages you want next) directly drive the roadmap.

License

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