Skip to content

Releases: ZeR020/omp-hooks

omp-hooks v0.0.4

Choose a tag to compare

@ZeR020 ZeR020 released this 07 Jul 19:55

What's new

Parallel hook execution (Claude Code behavior)

  • All matching hooks now run in parallel via Promise.allSettled
  • Identical handlers deduplicated by command+args across groups
  • Deny-wins: one deny/exit-2 blocks regardless of allow from others
  • stopProcessing wins over deny; updatedInput merges in config order
  • additionalContext concatenated in config order (deterministic)
  • PostToolUse patches: first non-undefined content/details/isError wins
  • Single-hook calls skip allSettled overhead

updatedToolOutput field (PostToolUse)

  • extractToolResultPatch now reads Claude Code's actual updatedToolOutput field as the highest-priority content source
  • Above legacy updatedToolResult.content and updatedMCPToolOutput
  • This was effectively a bug fix — hooks using the documented Claude field were silently ignored before

Type cleanup

  • CommonHookOutput named type (replaces ReturnType<typeof> usage)
  • CollectedHook/HookExecResult named types for parallel helpers

Full Changelog: v0.0.3...v0.0.4

omp-hooks v0.0.3

Choose a tag to compare

@ZeR020 ZeR020 released this 07 Jul 18:42

omp-hooks v0.0.3

Bug fixes and compatibility improvements over v0.0.2.

What's changed

Bug fixes

  • Fix: inject additionalContext for SessionEnd, PreCompact, PostCompact, and non-blocked Stop hooks — these 4 event handlers collected additionalContext from hook command output but never injected it into the LLM. Now all events inject their additionalContext through injectHiddenContext, matching PreToolUse and PostToolUse behavior.
  • Fix: case-insensitive exact matchermatcherMatches('Read', 'read') was returning false because exact-match used === instead of case-insensitive comparison. Fixed by lowercasing both sides. Matters because Claude configs use "Read"/"Bash" while OMP may emit lowercase "read"/"bash".

Features

  • Claude-compatible field aliases in buildHookInput — omp-hooks now emits both OMP and Claude Code field names in the hook JSON payload:

    • Glob: .path + .pattern (Claude Code uses .pattern)
    • Read/Edit/Write: .path + .file_path (Claude Code uses .file_path)
    • Read (URL): .path + .url + .prompt (some Claude scripts use .url/.prompt)
    • PostToolUse: .tool_response.content[].text + .tool_response.result (string)

    This eliminates the need for bridge scripts that only do field-name mapping. Plugin-specific routing (calling a specific binary or marketplace script) may still need a bridge.

Docs

  • README rewrite — shorter, professional structure with install, quick start, supported subset tables, examples, and compatibility notes.

Verified

  • bun run typecheck
  • bun run build
  • 64 unit/smoke tests ✅ (matcher, tool names, all events, execution, async, JSON output)
  • Live session testing ✅ (19 omp-hooks injections in session JSONL, CBM/agent-skills/ponytail all firing)

omp-hooks v0.0.2

Choose a tag to compare

@ZeR020 ZeR020 released this 07 Jul 17:23

omp-hooks v0.0.2

Compatibility-focused patch release for Claude Code command hooks on OMP.

What's changed

  • Normalize OMP tool names to Claude-style names for hook scripts and matchers (bashBash, writeWrite, etc.) while preserving lowercase matcher compatibility.
  • Match current Claude Code matcher semantics: omitted/empty/star match all, plain names exact-match, pipe/comma lists match exact alternatives, and regex syntax still works for patterns like mcp__.*.
  • Add command exec-form support with args; when args is present, command is spawned directly without a shell.
  • Add shell support for command hooks (bash by default, powershell supported for shell form).
  • Add background command hook support with async and best-effort asyncRewake.
  • Align default timeouts closer to Claude Code: 600s for command hooks, 30s for UserPromptSubmit, 1.5s for SessionEnd.
  • Update README compatibility docs to describe the supported Claude command-hook subset and explicitly list unsupported handler types/events.

Still unsupported

  • Handler types: http, prompt, agent, mcp_tool.
  • Newer Claude events outside the mapped subset, including PostToolBatch, PermissionRequest, PermissionDenied, Notification, MessageDisplay, SubagentStart, SubagentStop, and StopFailure.

Verified

  • bun run typecheck
  • bun run build
  • Direct smoke tests for matcher behavior, tool-name normalization, hook input shape, timeout defaults, shell-form execution, exec-form args, and async additionalContext delivery.

v0.0.1

Choose a tag to compare

@ZeR020 ZeR020 released this 07 Jul 15:36

omp-hooks v0.0.1

Claude Code-compatible command hooks for the OMP (Oh My Pi) coding agent.

Features

  • 9 Claude Code hook events mapped (SessionStart, SessionEnd, PreCompact, PostCompact, PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop)
  • Hidden context injection via sendMessage({ display: false }) — the mechanism OMP's native tool_call lacks
  • Claude Code settings.json hooks config format compatibility
  • Settings from ~/.omp/agent/settings.json (env-overridable via OMP_HOOKS_SETTINGS) + project-local <cwd>/.omp/settings.json
  • Debounce buffer for parallel grep/glob injections (50ms window)
  • Bridge-script compatible (bash -c + JSON stdin/stdout + exit-code semantics)

Install

omp install omp-hooks

Or from source:

omp install git:github.com/ZeR020/omp-hooks

Requirements

  • OMP (Oh My Pi) coding agent
  • @oh-my-pi/pi-coding-agent peer dependency