Introduction¶
DeepSeek Harness (dsh) extends external capabilities for agents via plugins. For code repository tasks, a common problem is that the model lacks a stable codebase map: it doesn’t know which key files are in the current repository, and it’s not easy to quickly locate functions, classes, interfaces, and types.
dsh-code-index is a DSH plugin that provides three things to agents: a tree-sitter-based symbol index, symbol search sorted by relevance, and a repository map with a limited size that can be automatically updated.
What is this¶
dsh-code-index is a third-party plugin maintained by lemonxiny55, licensed under MIT, not officially affiliated with DeepSeek, and built on top of the public dsh plugin surface.
It provides the following tools for agents:
code_indexcode_symbolscode_searchcode_map
At the same time, it can also inject a repository map paragraph into the system prompt.
Core Capabilities¶
Indexing and State¶
code_index is used to view or rebuild the code index for the current workspace.
The index is lazily built on first use, then uses local cache, and performs incremental refreshes based on modification time (mtime).
Supported languages include:
- TypeScript
- JavaScript
- Python
- Go
- Rust
- Java
Parsing is performed via tree-sitter WASM.
Symbol List¶
code_symbols can list symbols, including functions, classes, interfaces, types, methods, etc., and returns file:line.
Filterable conditions include:
- Name
- Path
- Symbol Type
- Is Exported
Ranked Search¶
code_search performs a ranked search on symbols.
The ranking priority is:
- Exact match
- Prefix match
- Substring match
- Subsequence fuzzy match
Exported symbols take priority, and it returns a relevance score and file:line.
Repository Map¶
code_map generates a ranked repository map with a limited size.
It selects top files based on symbol density and import references, and lists key symbols with line numbers.
The optional auto-inject paragraph is:
code-index:repo-map
The order of this paragraph is 60, the TTL configuration option is mapTtlMs, defaulting to a refresh every 60 seconds.
Auto-injection targets the default workspace, which is the startup directory, matching headless/CLI modes. For multi-workspace Web UI sessions, it is recommended to use code_map or code_symbols instead, as they parse based on the current session’s cwd.
Installation and Usage¶
Requires dsh and Node >= 22. The plugin declares the peer dependency:
@deepseek-ai/cordis ^4.0.1
Installation command:
npx @deepseek-ai/dsh plugin --profile web add dsh-code-index
Restart the Web UI after installation:
npx @deepseek-ai/dsh web
Startup logs will confirm whether the various tools are registered.
You can also check the combined configuration before starting the UI:
dsh --profile web --dump-config
No API key is required to build the index. The model needs to be properly configured to call these tools.
Typical Usage¶
In a workspace session, you can ask the agent like this:
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.
A typical combination is to call code_map first, then call:
code_search { query: "extractSymbols" }
for locating definitions and context.
Use Cases and Notes¶
Suitable for code tasks that require DSH agents to understand repository structure, find symbols, locate functions or classes, and generate a repository overview.
Notes:
- The plugin runs with the current
dshprocess permissions and will read workspace files to build the index. You should check the source code, dependencies, and MIT license before installing. web-tree-sitteris pinned to^0.20.8. Documentation states that the new version of web-tree-sitter expects dylinked grammar WASM, whiletree-sitter-wasmsprovides static builds; this combination has been verified to work under Node >= 22/24.- Local variables are also indexed, which tends to improve recall;
code_searchranking will suppress them. - DSH is still in the developer-preview harness stage, and upstream harness/plugin APIs may change.
- The auto-inject paragraph is only for the default workspace; multi-workspace Web UI sessions should use
code_maporcode_symbols.
Conclusion¶
The core value of dsh-code-index is to provide symbol indexing, symbol search, and a restricted repository map for DSH agents, reducing the guessing the model has to do in code repository tasks.
GitHub repository:
https://github.com/lemonxiny55/dsh-code-index
Community directory link address:
https://www.skillhub.cn/plugins/lemonxiny55/dsh-code-index
The address of this directory page comes from the plugin link and is not directly confirmed in this documentation; please refer to the actual page on the directory when using it.