Skip to content

Hook auto-update: warn when rtk-rewrite.sh is outdated #344

@pszymkowiak

Description

@pszymkowiak

Problem

Users who installed the hook before v0.25.0 (PR #241) still have the old 200+ line bash hook that:

There's no mechanism to detect or update stale hooks. Users stay on the old version silently.

Proposal

Add a hook version check on rtk startup:

  1. Add a version comment at the top of the hook: # rtk-hook-version: 2
  2. On startup (or on rtk rewrite), check the installed hook file
  3. If the hook is outdated (missing version tag or old version), print a one-line warning to stderr:
    [rtk] Hook outdated — run `rtk init -g` to update
    
  4. Show the warning at most once per day (marker file, same pattern as telemetry)

Why not auto-patch?

The hook file lives in user space (~/.claude/hooks/). Silently modifying it could break custom modifications. A warning is safer and lets the user decide when to update.

Acceptance criteria

  • Hook file has a # rtk-hook-version: N header
  • rtk rewrite checks installed hook version
  • Warning printed to stderr if outdated (max 1/day)
  • rtk init -g bumps the version header
  • rtk init --show displays hook version status

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-importantDevrait être fixé bientôtenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions