Skip to content

Support git -C <path> in rewrite registry #555

Closed

Description

@stefan-nagey-deel

Problem

rtk rewrite doesn't recognize git -C <path> <subcommand> commands. These are commonly used by Claude Code (and likely other LLM agents) when operating on repos from a different working directory.

# These all exit 1 (no rewrite):
rtk rewrite 'git -C /path/to/repo status'
rtk rewrite 'git -C /path/to/repo diff --name-only'
rtk rewrite 'git -C /path/to/repo log --oneline -5'

# But these work fine:
rtk rewrite 'git status'        # → rtk git status
rtk rewrite 'git log --oneline' # → rtk git log --oneline

Impact

In a real session with ~6 git commands, only 2 were rewritten because the others used git -C. The hook was working correctly but rtk rewrite didn't match the pattern.

Expected behavior

git -C <path> <subcommand> should rewrite to rtk git -C <path> <subcommand>, same as any other git command prefix.

Environment

  • rtk 0.26.0
  • macOS (Darwin 25.3.0)
  • Used via Claude Code PreToolUse hook

Activity

  1. aeppling commented on Mar 13, 2026

    @aeppling
    Contributor

    Will be resolved by #547

  2. added a commit that references this issue on Mar 14, 2026
    901c5c3
  3. added a commit that references this issue on May 14, 2026
    48003d0
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions