Skip to content

rtk init -g leaves a pre-v0.10 CLAUDE.md RTK block in place and adds @RTK.md next to it #4423

Open

Description

@KuSh

rtk v0.9.x (v0.9.0–v0.9.4, released 3–6 February 2026) rtk init -g wrote the RTK instructions into ~/.claude/CLAUDE.md opening with <!-- rtk-instructions v2 --> and no closing marker (git show v0.9.4:src/init.rs: one rtk-instructions v2, no /rtk-instructions). The closing marker arrived in v0.10.0 (7 February 2026).

When rtk init -g on develop (4f9015f) meets that block, it warns and leaves it in place, then appends @RTK.md. Here the 132-line v0.9.4 block was written into an isolated HOME:

$ rtk init -g --auto-patch </dev/null
[warn] Warning: Found '<!-- rtk-instructions' without closing marker.
  settings.json: hook added

$ wc -l ~/.claude/CLAUDE.md          # 132 before
134
$ grep -c 'rtk-instructions' ~/.claude/CLAUDE.md; grep -c '@RTK.md' ~/.claude/CLAUDE.md
1
1

The hook is registered, so auto-rewrite works. But the full v0.9 instructions stay in every session's context next to the slim RTK.md, and re-running init never removes them. The block is rtk's own output, so its extent is known: it is the v0.9.x RTK_INSTRUCTIONS text. remove_rtk_block could recognise that shape (opening marker, no closing marker, content matching a shipped legacy template) instead of only warning.

Found while checking the Windows migration docs in #4350.

Activity

  1. rtk-wshm-sync-bot commented on Oct 3, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 88%

    Summary

    rtk init -g detects pre-v0.10 unterminated RTK blocks in CLAUDE.md but only warns and leaves them in place, duplicating instructions alongside the new @RTK.md reference

    📁 Relevant files
    • src/init.rs

    Suggested Actions

    1. Extend remove_rtk_block to recognize opening marker + no closing marker + content matching shipped v0.9.x RTK_INSTRUC…
    2. Add a regression test that seeds a v0.9.4-shaped CLAUDE.md and asserts the legacy block is removed, not just warned abo…
    3. Cross-check with rtk init --agent antigravity leaves the rules file written by earlier releases in place, on install and on uninstall #4317 (similar legacy-file-left-in-place pattern for antigravity agent) for a shared fix approach
    4. Verify behavior across all v0.9.0–v0.9.4 block variants, not just v0.9.4, before closing

    Triaged automatically by wshm · This is an automated analysis, not a human review.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions