Introduction

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When developing or operating agents with DSH, developers often already have hooks.json configured for Claude Code or Codex, and these existing configurations need to be migrated to DSH interception points.

Manual configuration is cumbersome and easy to overlook. The chenzhi-clude/dsh-hooks-pack plugin solves this pain point by automatically discovering existing Hooks configurations and running them on the official bridge plugin interception points. It allows developers to have DSH execute existing Hooks logic without writing code or modifying existing configuration files.

Plugin Overview

This plugin is maintained by chenzhi-clude and is released under the MIT license.

It performs underlying interception through official bridge plugins (@deepseek-ai/dsh-hooks-claude-code, @deepseek-ai/dsh-hooks-codex, and the shared protocol @deepseek-ai/dsh-hook-protocol). The plugin itself mainly provides configuration discovery, mounting, and execution mode management.

Core Features

  1. Automatic configuration discovery: The plugin probes standard directories and automatically finds hooks.json for Claude Code or Codex.
  2. Official interception point support: It runs hook definitions from official bridge plugin interception points.
  3. Single-line mounting: Claude Code and Codex dialects can be mounted simultaneously through a single configuration.
  4. Dangerous command defense: Built-in example hooks can block dangerous operations (such as rm -rf, force pushes, etc.).
  5. Audit logging: Built-in hooks can record tool call audit logs.
  6. Safe idle mode: When no configuration is found, the plugin does not register any hooks and does not change the Agent’s default behavior.

Installation and Enablement

Install the plugin via the CLI:

dsh plugin --profile web add github:REPLACE_ME/dsh-hooks-pack

After installation, restart the Profile (or reload the web application) to make the configuration take effect.

Typical Usage

After installation, the following configuration is usually required:

  1. Specify execution mode: Set executionMode in the configuration file. The default is direct, a fix introduced in v0.1.1 to resolve silent failure issues on Windows.
  2. Explicitly specify paths: If automatic discovery fails, you can explicitly specify configuration file paths via cordis.patch.yml:
    - id: hooks-pack
      name: dsh-hooks-pack
      config:
        claude:
          configPath: D:/my-hooks/claude-hooks.json
        codex:
          configPath: D:/my-hooks/codex-hooks.json
  1. Enable example hooks: The plugin directory includes examples, containing “dangerous command defense” and “audit logging” examples. Developers can copy them to the specified location and configure references.

Configuration Reference

The plugin supports the following configuration items:

  • executionMode (string, default: direct): Hook execution backend. direct means direct in-process execution (matching Claude Code semantics), while shim means traditional sandbox-compatible mode.
  • autoDiscover (boolean, default: true): Whether to probe standard locations when no explicit path is specified.
  • claude.configPath / codex.configPath (string): Explicitly specify configuration file paths.
  • auditFile (string): Optional absolute path to the audit log file.
  • claude.projectDir: Replacement for the ${CLAUDE_PROJECT_DIR} environment variable.

Applicable Scenarios and Notes

  • Applicable scenarios: Developers who already have Claude Code or Codex Hooks configurations and want to seamlessly migrate them to DSH; users who need dangerous command defense or audit logging through Hooks.
  • Only Shell-form hooks are supported: The plugin currently only supports command hooks of the Shell-form type; http/mcp_tool/prompt type hooks are skipped.
  • Configuration loading mechanism: Configuration is read when the process loads and does not support per-session project-local discovery.
  • Windows compatibility: On Windows, handling of complex quotes has limitations. It is recommended to encapsulate complex logic in .cmd or .mjs files and then invoke them from hooks.
  • Dependency requirements: It must satisfy the version requirement for the @deepseek-ai/cordis peerDependency (^4.0.1).

Short Conclusion

The dsh-hooks-pack plugin provides DeepSeek Harness users with a standardized path for migrating Hooks configurations from Claude Code/Codex. Through direct execution mode and automatic discovery, it addresses the pain point of manual configuration being cumbersome and error-prone. For DSH workflows that require security protection and auditing, it offers a low-cost integration solution.

View plugin directory
Visit GitHub repository