Skip to content

Hook silently fails when jq is not installed #430

@znagadeon

Description

@znagadeon

The rtk-rewrite.sh hook silently exits when jq is not installed on the system, causing rtk to appear as if it's working while all commands bypass the rewrite pipeline entirely.

Steps to Reproduce

  1. Install rtk (>= 0.23.0)
  2. Set up the Claude Code hook via rtk setup
  3. Do not have jq installed (or uninstall it)
  4. Run any command through Claude Code (e.g. git status)
  • Expected: Some indication that the hook is not functioning
  • Actual: Hook exits silently, commands run without rtk rewrite, and the user has no way of knowing

Root Cause

In rtk-rewrite.sh:

if ! command -v jq &>/dev/null; then
  exit 0
fi

This exits cleanly with no warning.

Suggestions

A few possible approaches:

  1. Print a warning when jq is missing, similar to the version guard
  2. Check for jq during rtk setup and warn the user before installing the hook
  3. Remove the jq dependency entirely

Environment

  • rtk 0.27.2
  • macOS (Apple Silicon)
  • Claude Code with PreToolUse hook

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