Skip to main content
Last updated on

Claude Code Hooks

🆕 New page in this review

Everything on this page is new.

The OpenBox Claude Code integration connects a Claude Code session to OpenBox through Claude Code's own hooks system. It handles event capture, telemetry collection, and trust evaluation, with no changes to how you use Claude Code.

GuideDescription
ConfigurationHook commands, environment variables, and observe vs. enforce modes
Integration WalkthroughEnd-to-end guide for wiring OpenBox into a project
TroubleshootingDiagnose hook, configuration, and UI interpretation issues
What the Integration Does

The integration's job is to connect Claude Code's hook events to OpenBox and send them to the platform. All trust logic, policies, and UI management happen on the platform, not in the hook commands.

Philosophy

  • Zero session changes: keep using Claude Code exactly as you do today; only .claude/settings.json changes
  • Hook-native: uses Claude Code's own UserPromptSubmit, PreToolUse, and PostToolUse hooks; no forked CLI, no wrapper process
  • Observe before enforce: new integrations default to recording and scoring without blocking anything, until you opt in to enforcement

Installation

Package: openbox-claude-code Requires: Node.js 18+ (run via npx, no separate install step required)

npx openbox-claude-code --version

Hook Commands

CommandBound toPurpose
openbox-claude-code hook user-prompt-submitUserPromptSubmitGoverns the session's stated goal before the session acts on it
openbox-claude-code hook pre-tool-usePreToolUseGoverns a tool call before it runs: file writes, shell commands, MCP calls
openbox-claude-code hook post-tool-usePostToolUseRecords the tool call's actual result against the pre-execution decision

See Configuration for environment variables and the full .claude/settings.json shape.

What The Integration Captures

  • User prompts, evaluated on UserPromptSubmit
  • Tool calls (file read/write, shell command, MCP tool), evaluated on PreToolUse and completed on PostToolUse
  • Governance decisions per hook invocation: ALLOW, CONSTRAIN, BLOCK, REQUIRE_APPROVAL, or HALT
  • Commits produced during the session, tagged with an OpenBox-Session trailer

All captured data is evaluated against your trust policies on the OpenBox platform, same as any other integration.

Observe And Enforce

ModeBehavior
observe (default)Every prompt and tool call is recorded and scored. Nothing is ever blocked.
enforceGovernance decisions are enforced: a tool call can be blocked, constrained, or paused for approval.

Mode is set per developer, not just per project; see Configuration → Observe vs. Enforce.

Next Steps

  1. Configuration: Hook commands, environment variables, and mode settings
  2. Integration Walkthrough: Wire OpenBox into a real project