Native CodeGraph tools for DSH: indexed code exploration, call paths, incremental synchronization, and configurable search guidance.
CodeGraph for DSH
CodeGraph for DSH connects DSH sessions to the indexed code knowledge graph provided by the CodeGraph CLI. Its native tools help you locate symbols, inspect relevant source, and follow call paths without starting with text search.
Tools
The default core surface registers four tools:
codegraph_status checks whether the current project has an index and reports its status.
codegraph_init creates the project index when you choose to initialize it.
codegraph_sync updates an existing index after code changes.
codegraph_explore finds relevant symbols, line-numbered source, and call paths from a natural-language request.
Set surface to full to register all 13 tools: codegraph_status, codegraph_init, codegraph_index, codegraph_sync, codegraph_uninit, codegraph_query, codegraph_node, codegraph_explore, codegraph_files, codegraph_callers, codegraph_callees, codegraph_impact, and codegraph_affected. In full mode, codegraph_uninit removes the project's index; use it only when that is intended. The remaining tools provide targeted symbol searches, source inspection, caller/callee graphs, impact analysis, and suggested tests for changed files.
Requirements
This DSH bundle is loaded by the DSH web application. The codegraph executable must be installed and available on PATH; the CLI must be version 1.0 or later. Compatibility details are listed in the plugin's compatibility field.
Install and get started
Install the external CLI with npm i -g @colbymchenry/codegraph and verify codegraph --version. Prefer installing CodeGraph 1.3.4 from Nano AI Marketplace, or use the fixed archive URL https://nano-ai.cn/v1/plugins/dsh-codegraph/versions/1.3.4/install.tgz in the official DSH plugin manager. Install into the profile you use and restart DSH when prompted. Call codegraph_status, initialize an index with codegraph_init when needed, then use codegraph_explore. The public npm package dsh-codegraph@0.1.3 has a different maintainer/source lineage and is not a substitute for this marketplace release.
The external @colbymchenry/codegraph CLI is a separate prerequisite. A successful first exploration returns project source and call paths. After editing source, run codegraph_sync.
Using CodeGraph
Open a DSH session in the project directory and check codegraph_status. If the project is not indexed, initialize it only when you want to create an index. Then use codegraph_explore to inspect code and its call paths. After changing source files, run codegraph_sync; with the full surface, codegraph_affected can identify relevant test files. Tools use the session's current working directory and follow directory changes. Pass a path when you need to target a different project.
The plugin adds a system-prompt guide by default so code exploration prefers CodeGraph tools. It does not initialize an index on its own. If the project is not indexed, the plugin leaves that decision to you.
Settings
In DSH Settings > Plugins > CodeGraph, you can change these options without restarting DSH:
| Setting |
Default |
Purpose |
guideSearch |
true |
Add the system-prompt guide that prioritizes CodeGraph for code exploration. |
frontload |
false |
Detect code-oriented prompts, query an existing index, and add the result as <codegraph_context> before tool use. |
surface |
core |
Register the four core tools or all 13 tools with full. |
Frontloading is off by default because it adds retrieved context to the conversation. When enabled, it only uses an existing .codegraph index, skips prompts that do not match its code-oriented checks, and silently does nothing when the index or CLI is unavailable. It never initializes a project automatically.
Deployment-level settings belong in the DSH composition layer rather than the user settings form: codegraphPath selects an executable by absolute path, and codegraphArgs supplies extra CLI arguments. User settings override composition-layer values, which override schema defaults.