Skip to content

Suppress missing 'entire' failures in Codex and Claude hooks #880

@sanogueralorenzo

Description

@sanogueralorenzo

Summary

When entire is no longer installed but repo-level agent hooks still exist, Codex and Claude Code surface noisy hook failures such as:

⏺ Ran 1 stop hook (ctrl+o to expand)
  ⎿  Stop hook error: Failed with non-blocking status code: /bin/sh: entire: command not found

OpenCode already behaves better here: missing entire failures are effectively suppressed, so users do not see this warning.

Problem

The generated Codex and Claude Code hook configs invoke entire directly.

Codex

{
  "type": "command",
  "command": "entire hooks codex stop",
  "timeout": 30
}

Claude Code

{
  "type": "command",
  "command": "entire hooks claude-code stop"
}

If the user later uninstalls Entire without also removing these hook entries, both agents still try to execute entire, and the shell-level command not found leaks into the UI as a hook error.

Comparison: OpenCode already suppresses this

The generated OpenCode plugin wraps the spawn and ignores stderr:

function hookCmd(hookName: string): string[] {
  return ["sh", "-c", `${ENTIRE_CMD} hooks opencode ${hookName}`]
}

async function callHook(hookName: string, payload: Record<string, unknown>) {
  try {
    const json = JSON.stringify(payload)
    const proc = Bun.spawn(hookCmd(hookName), {
      cwd: directory,
      stdin: new Blob([json + "\n"]),
      stdout: "ignore",
      stderr: "ignore",
    })
    await proc.exited
  } catch {
    // Silently ignore — plugin failures must not crash OpenCode
  }
}

That means OpenCode does not produce the same user-facing noise when entire is missing.

Requested change

Please update the generated Codex and Claude Code hook commands to no-op when entire is not available, so they match the practical outcome of the OpenCode integration.

For example, generate commands like:

Codex

{
  "type": "command",
  "command": "command -v entire >/dev/null 2>&1 && entire hooks codex stop || true",
  "timeout": 30
}

Claude Code

{
  "type": "command",
  "command": "command -v entire >/dev/null 2>&1 && entire hooks claude-code stop || true"
}

This would preserve current behavior when Entire is installed, while suppressing the command not found noise after uninstall or on machines where the repo config exists but the binary does not.

Why this helps

  • avoids confusing user-facing warnings for a non-critical missing integration
  • makes uninstall behavior cleaner
  • aligns Codex and Claude Code with OpenCode's current failure-tolerant behavior
  • reduces support/debug churn when the actual issue is just stale generated hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions