Introduction

The DeepSeek Harness (DSH) plugin ecosystem aims to extend an agent’s code manipulation capabilities. When writing code, an agent needs to answer three structured questions: where is a symbol declared, who calls it, and what impact will modifying it have. Traditional text search (such as grep) cannot answer relational questions like “who calls it,” while LSP may be precise but depends on cursor position and requires running a separate service for each language. dsh-plugin-codegraph solves this problem by building a local code symbol graph and providing agents with two tools, codegraph and codegraph_index, so that such questions can be answered based on graph structure rather than text search.

Core Capabilities

This plugin provides agents with two main tools, which are independent in both functionality and design.

codegraph: read-only query tool

codegraph provides 10 read-only operations for retrieving information from a prebuilt index:

  • search: Find where a symbol is declared.
  • node: Get a symbol and its direct callers and callees.
  • callers: List all locations that call the current symbol.
  • callees: List all targets the current symbol calls.
  • impact: Analyze the potential impact of modifying the current symbol.
  • trace: Trace the path between two symbols.
  • files: List indexed files, supporting directories or wildcards.
  • status: Check the index size and freshness.
  • explore: Explore multiple declarations related to a query and their source code.
  • context: Retrieve all context information related to a specific task.

codegraph_index: index building tool

This tool is responsible for building or refreshing the code graph index. The indexing process is separated from querying because building an index for a large workspace can take several minutes, whereas queries only require milliseconds. Combining them would make timeout budget configuration difficult: it would either be too tight to allow indexing to complete or too loose, causing query stalls to go unnoticed.

Installation and Activation

The installation process is completed with a single command, which automatically fetches the package and configures the plugin in the specified Profile:

dsh plugin --profile <name> add dsh-plugin-codegraph

After installation, the agent can directly use the two tools above. If the index has not been built yet, the status operation will explicitly state that the index does not exist and indicate that codegraph_index needs to be run.

Typical Usage

  1. Find a symbol declaration:
    codegraph search query
  1. Inspect a symbol’s call relationships:
    codegraph node symbol
  1. Check modification impact:
    codegraph impact symbol
  1. Trace a path:
    codegraph trace from to
  1. List indexed files:
    codegraph files
  1. Build or refresh the index:
    codegraph_index

Technical Details

  • Language support: The built-in indexer supports TypeScript, TSX, JavaScript, JSX, Python, Go, Java, C, C++, C#, PHP, Rust, Ruby, Zig, Kotlin, Swift, Dart, and Scala. Syntax parsers are loaded lazily per language, with the corresponding parser loaded only when matching files are used.
  • Storage format: The plugin shares the disk format (schema version 4) with the codegraph CLI, with the storage path <projectRoot>/.codegraph/codegraph.db. This means the index can be built either with the plugin or with the CLI, and the two are interoperable.
  • Call resolution logic: The plugin does not guess unresolved calls. The resolution order follows fixed rules: first match imported files, then match globally unique names. If neither matches, the call is recorded as unresolved instead of generating an incorrect edge.

Notes

  • Separation of read-only and building: The codegraph tool is always read-only, while codegraph_index is the dedicated tool for building indexes. No query implicitly triggers index building, in order to prevent long-running indexing tasks from being confused with queries.
  • Unresolved entries: Unresolved calls are explicitly marked as unresolved. Agents should not rely on these marks to assume the existence of a call, but should treat them as information requiring further confirmation.

Conclusion

dsh-plugin-codegraph provides DeepSeek Harness with a different dimension of code understanding compared to LSP by using in-process indexing and graph queries. It does not guess call relationships; instead, it provides structured data based on explicit resolution rules. For more information or to contribute code, please visit the project repository.