Repository navigation
fix(awareness): slim awareness text - #3372
Conversation
Replace the RTK reference (meta commands, rtk proxy bypass, install verification, branding, hook framing) with a minimal note stating that condensed output is complete/authoritative and commands should be run normally. Removes the runnable command blocks and bypass hint that led agents to run extra commands and re-verify. Claude only.
0d256df to
6c441a7
Compare
|
@KuSh updated with awareness level configuration (agent without hooks are given the full instructions, else it is default / slim, user can still configure with toml) |
KuSh
left a comment
There was a problem hiding this comment.
LGTM except for some nitpicks
KuSh
left a comment
There was a problem hiding this comment.
The three-level model is the right shape, and routing rules-only agents (Codex, Cline, Windsurf, Kilo Code, Antigravity, Kimi) unconditionally to full with print_rules_only_awareness_note is the correct call — those agents genuinely have to type rtk themselves.
One path is left behind, though: rtk init without -g never reaches awareness_content.
run_default_mode early-returns for local init (src/hooks/init.rs:1196-1201):
if !global {
// Local init: inject CLAUDE.md + generate project-local filters template
run_claude_md_mode(false, install_opencode, ctx)?;
generate_project_filters_template(ctx)?;
return Ok(());
}and run_claude_md_mode still writes the legacy constant (src/hooks/init.rs:1656-1662):
let action = write_rtk_block(
&path,
RTK_INSTRUCTIONS,
"rtk instructions",
recovery_cmd,
ctx,
)?;RTK_INSTRUCTIONS (src/hooks/init.rs:157) is still the v2 block with:
## Golden Rule
**Always prefix commands with `rtk`**. If RTK has a dedicated filter, it uses it. If not, it passes through unchanged.
**Important**: Even in command chains with `&&`, use `rtk`:
...
rtk git add . && rtk git commit -m "msg" && rtk git push
So on a Claude Code install that does have the transparent rewrite hook, a project-local rtk init writes prefix-everything guidance into ./CLAUDE.md and awareness.level has no effect on it. --claude-md opting into that is intentional and fine; plain rtk init inheriting it is the part that looks unintended, since the PR's whole premise is that hook-based agents should default to being told nothing about RTK.
Practical consequence is the one #3186 describes: Claude reads the Golden Rule and types rtk git status itself. Claude Code matches permissions.allow against the literal command before the PreToolUse hook rewrites it, so the prefixed form misses the user's plain-command allow rules and prompts every time — while the unprefixed form would have been rewritten transparently anyway.
Two ways out, both small:
- Thread the level through — give
run_claude_md_modean explicit content argument and passawareness_content(ctx.awareness)from the local branch, keepingRTK_INSTRUCTIONSonly for the explicit--claude-mdopt-in. - Have local init follow the same shape as global: write the awareness file and add the
@RTK.mdreference, rather than inlining a block.
Worth noting the docs added here already imply (1): the configuration table says default means "Nothing about RTK", and "Re-run rtk init -g (or your agent's init command) to rewrite the file" reads as though every init path honours the setting.
Also minor: run_claude_md_mode's doc comment still says "full 137-line injection" — worth a look while the constant is in scope, since the block is now ~4KB and the test at src/hooks/init.rs:5424 asserts RTK_INSTRUCTIONS.len() > 4000.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVD4ZD5wiSjSsNpKCK6h7q
Resolved: awareness constants vs Pi/OMP rework, InitContext destructures, bun/deno CLI additions, write_if_changed split. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVD4ZD5wiSjSsNpKCK6h7q
|
Following up on the local-init review from Aug 29: fixed in 4bbf778. |
Summary
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk <command>output inspected