Repository navigation
Description
User Story
As a Claude Code user with RTK's auto-rewrite hook installed, I want RTK's own docs/RTK.md to avoid modeling literal rtk <cmd> invocations for hook-covered commands, so Claude doesn't start typing rtk-prefixed commands itself and trigger avoidable permission prompts.
Background
Claude Code's permissions.allow check runs against the literal Bash command the model writes, before the PreToolUse hook rewrites it. So git status (plain) matches an existing allow rule and runs silently — the hook then rewrites it to rtk git status after the fact, invisibly. But if Claude itself writes rtk git status (already prefixed), that string doesn't match the user's plain-command allow rules, and the user gets a permission prompt every time — defeating the "zero-friction" promise of the hook.
In practice, Claude sessions frequently do type the prefixed form themselves. The likely cause is RTK.md: it has a "Meta Commands (always use rtk directly)" section, immediately followed by an example — git status → rtk git status — meant to illustrate the hook's automatic rewrite. The visual pattern is easy for an LLM to key on as "the command to type" rather than "what the hook produces for you," especially since the doc never explicitly says "do not type this form yourself." The generated RTK.md ships with no distinction in formatting or emphasis between the two categories.
The potential confusion for agents interferes with the user's configured command allow-list, because e.g. rtk git might not be on the allow list even if git is.
Acceptance Criteria
-
RTK.md(and any other agent-facing rtk docs) clearly distinguishes "commands you must type asrtk ..." (meta commands) from "commands the hook rewrites for you — type the plain form" (git/gh/cargo/etc.) - The illustrative
X → Yexample is reworded or annotated so it can't be read as an instruction to typeY - No regression to existing meta-command guidance (
rtk gain,rtk discover,rtk proxy, etc. still explicitly called out as requiring thertkprefix)
Technical Notes
- Relevant file: the
RTK.mdtemplate generated byrtk init -g(installed to~/.claude/RTK.md) - Per the hook docs, an already-
rtk-prefixed command passes through unmodified ("commandes deja prefixees par rtk passent sans modification") — so this isn't a hook bug, it's a documentation/prompting issue causing Claude to bypass the hook unnecessarily
Activity
pszymkowiak commentedon Jul 24, 2026
🔍 Automated Triage
docsmediumSummary
RTK.md's example formatting causes agents to type rtk-prefixed commands themselves, bypassing plain-command allowlists and causing unnecessary permission prompts; reword/annotate the doc to distinguish meta-commands from hook-rewritten commands.
📁 Relevant files
RTK.mdTriaged automatically by wshm · This is an automated analysis, not a human review.
nightcityblade commentedon Jul 24, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.
KuSh commentedon Sep 9, 2026
Fixed on
develop, not yet in a release — labelledresolved-pending-closerather than closed.The
awareness.levelsplit (aefea91a, then #3372) resolves this.AwarenessLevel::Defaultis#[default](src/core/config.rs:37), andhooks/rtk-awareness.mdat that level is the whole file below — no prefixing rule, no "Meta Commands" section, and nogit status→rtk git statusexample. Its onlyrtkmention isrtk proxy <cmd>as a recovery path:Against the acceptance criteria:
rtk …" from "type the plain form") — met by removal; there is no meta-command section left to misread.X → Yexample) — the example is gone entirely.init.rs:6355asserts!RTK_AWARENESS_DEFAULT.contains("rtk gain")deliberately, with meta commands moved tohigh/full. Those are commands for humans, not agents, and nothing is lost by omission:awareness.levelis user-selectable, so anyone wanting the fuller guidance asks forhighorfull. A minimal default is the design.Two things this does not cover, both tracked elsewhere:
fulllevel still says "Prefix every shell command withrtk", and the hookless agents (cline, kilocode, windsurf) get that file unconditionally perhooks/README.md:18. Wording fix in Agent guidance tells agents to prefix shell builtins withrtk, and promises it is safe —rtk cdexits 127 and aborts the compound #3969.RTK.mduntil re-init — separate from this issue (RTK.md template carries one-time setup content and a dangling reference #3306, RTK.md template ends with "Refer to CLAUDE.md for full command reference", which the default install never writes #3940).KuSh commentedon Sep 13, 2026
Fixed by the awareness-level rework in #3372, shipped in v0.49.0. The file installed by default no longer has a meta-commands section or the
git status->rtk git statusexample, so there is nothing left for the model to read as an instruction to type the prefixed form; the rtk-prefix guidance now only appears at the higher awareness levels meant for agents without hook support. Please comment if you still see agents typingrtk ...themselves on v0.49.0 or later.