Skip to content

fix: suppress hook warning during rtk init and verify#1422

Open
JackDanger wants to merge 1 commit intortk-ai:developfrom
JackDanger:fix/suppress-hook-warn-during-init
Open

fix: suppress hook warning during rtk init and verify#1422
JackDanger wants to merge 1 commit intortk-ai:developfrom
JackDanger:fix/suppress-hook-warn-during-init

Conversation

@JackDanger
Copy link
Copy Markdown

Problem

Running rtk init -g printed a spurious warning:

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

This happened because maybe_warn() fired before the init completed.

Fix

Skip maybe_warn() for Init and Verify commands — they manage the hook themselves and don't need the reminder.

if !matches!(
    cli.command,
    Commands::Gain { .. } | Commands::Init { .. } | Commands::Verify { .. }
) {
    hooks::hook_check::maybe_warn();
}

Test plan

  • rtk init -g no longer shows the hook warning
  • rtk verify no longer shows the hook warning
  • Other commands (e.g. rtk git status) still show the warning when hook is missing
  • cargo test --all passes (1606 tests)

🤖 Generated with Claude Code

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 20, 2026

CLA assistant check
All committers have signed the CLA.

@JackDanger JackDanger changed the base branch from master to develop April 20, 2026 19:04
Running `rtk init -g` showed a spurious "No hook installed" warning
because maybe_warn() ran before the init completed. Skip the warning
for Init and Verify commands — they manage the hook themselves.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@JackDanger JackDanger force-pushed the fix/suppress-hook-warn-during-init branch from 21da16d to 3b4ab87 Compare April 20, 2026 19:50
@JackDanger JackDanger marked this pull request as ready for review April 20, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants