Skip to content

RTK emits a false "No hook installed" warning when the Claude Code hook is configured at the project level rather than globally #2024

Open

Description

@iangchan

AI Slop bug report:

Version

rtk 0.39.0

Reproduction Steps

  1. Install the RTK hook in a project-level .claude/settings.json (not the global ~/.claude/settings.json):
    {
      "hooks": {
        "PreToolUse": [{
          "matcher": "Bash",
          "hooks": [{ "type": "command", "command": "rtk hook claude" }]
        }]
      }
    }
  2. Do NOT add the hook to ~/.claude/settings.json.
  3. Run any command that RTK intercepts (e.g., git show --stat HEAD).

Expected Behavior

No warning. The hook is installed and working — RTK is intercepting and rewriting Bash commands. Token savings are being recorded correctly (rtk gain shows saved tokens).

Actual Behavior

Every intercepted command emits this warning in its output:

[rtk] /!\ No hook installed — run `rtk init -g` for automatic token savings

Root Cause

RTK's "no hook installed" check only looks for a global hook registration. It does not check whether rtk hook claude is already running (which it demonstrably is, since the hook process itself is what emits the warning). Project-level Claude Code hooks are a valid and intentional installation path — teams version their .claude/settings.json alongside the codebase so all contributors get the hook automatically.

Impact

  • False warning pollutes every intercepted command's output.
  • Warning appears inside token-filtered output returned to the LLM, consuming the tokens RTK is trying to save.
  • No way to suppress it — rtk config exposes no option to disable this warning.

Suggested Fix

Before emitting the warning, check whether rtk hook claude is actually running (e.g., inspect RTK_HOOK_ACTIVE env var, or detect that stdin contains a hook payload). If the hook is active, suppress the warning regardless of global registration state. Alternatively, expose a [display] show_hook_warning = false config option.

Activity

  1. pszymkowiak commented on May 27, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 95%

    Summary

    RTK incorrectly emits 'No hook installed' warning when hook is configured at project level; fix should check if hook is actively running before warning.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  2. mkruglikov commented on Oct 30, 2026

    @mkruglikov

    @pszymkowiak still not fixed in 1.1.0, take a look please 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions