In the plugin-based ecosystem of DeepSeek Harness (DSH), the default behavior of built-in tools can sometimes be too broad. When an agent needs to search for files, the default glob traverses bottomless directories such as node_modules, consuming tokens and slowing down execution. dsh-plugin-better-glob replaces the built-in glob through a per-agent shadowing mechanism and enforces an explicit allowlist policy to control the search scope.
Plugin Overview¶
This is a DSH workflow plugin maintained by HuanLinOTO. It shadows DSH’s built-in glob tool on a per-agent basis. Its core value is to automatically exclude common bottomless directories such as node_modules, dist, and build, and to require the model to explicitly pass an include allowlist when searching these directories.
Behavior¶
The tool parameters have the same semantics as the built-in glob, including pattern (required) and path (optional). The key difference lies in the exclusion mechanism:
- Automatic exclusion: By default, it excludes
node_modules,bower_components,vendor,Pods,.yarn,dist,build,out,target,obj,.next,.nuxt,.output,.svelte-kit,.turbo,.parcel-cache,.cache,coverage,__pycache__,.venv,venv,.tox,.mypy_cache,.pytest_cache,.ruff_cache,.gradle,.terraform, and.idea. - VCS always excluded: Version control directories such as
.git,.svn,.hg,.bzr,.jj, and.slare always excluded and cannot be configured. - Explicit allowlist: If these excluded directories need to be searched, an
includeallowlist array must be passed in the call parameters. For example,include: ['**']allows all directories. - Execution backend: It reuses the bundled ripgrep binary from the built-in
@deepseek-ai/dsh-tool-fs-searchpackage underneath.
Installation and Enablement¶
The plugin supports local development linking and npm package distribution. Enabling the plugin requires restarting DSH Web and performing a hard refresh in the browser.
dsh plugin --profile web add "link:D:/Projects/deepseek-harness/dsh-plugin-better-glob"
Note: Using link: references the local source code. After modifying the source code, run pnpm run build to rebuild lib/; the changes take effect without reinstalling.
Configuration Options¶
The plugin provides the following configuration options:
excludeDirs: Replaces the default exclusion list entirely. Only directory names are supported; separators are not allowed.globMaxResults: Limits the number of inline retained paths per operation; items beyond the limit are spilled.globMetaMaxBytes: Limits the byte budget for card metadata.rawOutputMaxBytes: Limits the maximum rg stdout size parsed per operation.sampleOverCapGlobResults: Whether to sample top-level entries for over-cap result pages (defaultfalse).
Known Limitations¶
- Shadow retention: After the plugin is disabled, shadow registrations for already live agents persist until those agents are destroyed.
- Hot reload effect: Configuration hot reload takes effect for agents already in a session through
resync. - Include granularity: The promotion granularity of an
includepattern is the directory name; subpaths do not affect the traversal scope. For example,node_modules/a/**still allows the entirenode_modulesdirectory.
Summary¶
This plugin uses mechanism design (shadowing and allowlisting) to solve the problem of runaway file search scope in the DSH environment, making agent operations more precise and efficient.