The core of DeepSeek Harness (DSH) lies in its “everything is a plugin” architecture. When developing agents or performing code assistance, enabling a model to accurately obtain code call relationships, file locations, and structured context is a common pain point. dsh-graft-plugin solves this problem by placing graft (a prebuilt code graph) directly into the DSH environment, making it available to both users and models.

Plugin Overview

This is a DeepSeek Harness plugin designed to expose code symbols, file line numbers, and call graphs upfront. It mainly addresses how to allow a model, while editing code, to understand code structure and take advantage of precise contextual information.

  • Name: dsh-graft-plugin
  • Maintainer: adithyanraj03
  • Category: Client
  • License: MIT
  • Core Value: Provides code indexing tools for the model and displays graft index status and token savings in Composer.

Installation and Prerequisites

Before installing, make sure the global graft CLI tool is installed:

npm install -g @nanonets/graft

Web Profile Installation

Use the official DSH CLI to install the plugin:

dsh plugin --profile web add dsh-graft-plugin

Note for pnpm 10+ users: pnpm 10+ blocks unapproved postinstall scripts. If installation fails, approve builds first:

cd ~/.dsh/profiles/web && pnpm approve-builds      # 勾选 dsh-graft-plugin
dsh plugin --profile web add dsh-graft-plugin      # 重新运行以写入 bundle 行

Desktop App Installation

The desktop version of DSH does not use CLI installation; it must be installed through the settings interface:

  1. Open Plugins (in the left sidebar settings).
  2. Click Add plugin.
  3. Enter the repository URL or package name:
    https://github.com/adithyanraj03/dsh-graft-plugin
  1. Click Install.

Plugins installed in the desktop app currently do not auto-update. To upgrade, uninstall and reinstall them.

Core Features

The plugin integrates a chip into Composer and provides a toolchain.

Composer Chip

In the Composer area, the chip displays the graft index status and token savings for the current session:
* ● in sync: The index is synchronized and matches the current code
* ◐ syncing: The index is being rebuilt
* ▲ stale: The index is stale, and the code has changed

Hover over (or click) the chip to view the number of root nodes, number of edges, index freshness, and token savings statistics. It also includes a graft viz button.

Model Tools

The plugin provides the model with the following tools, all resolved on demand during a session:
* graft_ask: Ask how the code works or locate positions, returning matching results with code snippets.
* graft_grep: Search all instances, grouped by symbol.
* graft_callers: View callers, callees, and call chains for a symbol.
* graft_skeleton: Get the complete API structure of a file.
* graft_map: View the hierarchical structure of the code tree.

Command-line Tools

Use the following commands in a conversation to manage the index:
* /graft: Build or rebuild the index.
* /graft status: View the chip text information.
* /graft deep: Fully rebuild the index.

Automatic Rebuild and Visualization

  • Automatic Rebuild: After the model edits files, the plugin automatically rebuilds the graft index in the background (with debounce logic).
  • Visualization: Click the graft viz button to open the code graph. Supports the DSH built-in sidebar (0.1.5+), the dsh-better-sidebar plugin, or a browser tab.

Usage Examples

In a DSH conversation, you can directly call tools or use commands:

# 重建索引
/graft

# 查看状态
/graft status

# 完全重建
/graft deep

# 模型工具调用示例
graft_ask: "如何处理用户登录逻辑?"
graft_callers: "查看 auth 模块的调用关系"
graft_skeleton: "获取 src/api/user.js 的 API 定义"
graft_map: "查看整个项目的目录树结构"

Notes and Limitations

  • Dependency Conflicts: If dsh-better-sidebar 0.18.x and a newer version of DSH are used simultaneously, mounting may fail due to the missing @deepseek-ai/dsh-client-ui-primitives. The plugin does not actively add the dsh-better-sidebar entry to avoid conflicts.
  • Permissions: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.

Summary

dsh-graft-plugin introduces the code graph concept and provides structured code context for DeepSeek Harness. It not only helps the model understand code more accurately, but also intuitively displays index status and efficiency through the Composer chip. For developers who need deep code interaction, this is a practical plugin worth installing.

  • GitHub: https://github.com/adithyanraj03/dsh-graft-plugin
  • Plugin Directory: https://www.skillhub.cn/plugins/adithyanraj03/dsh-graft-plugin