Skip to content

rtk init -g --opencode installs no plugin when the Claude side fails first #4413

Closed

Description

@KuSh

With #4323, --opencode also installs the Claude setup (#4046), so a Claude-side failure that happens before the OpenCode install ends the command with exit 1 and no plugin. Before #4323 --opencode touched only OpenCode, so these inputs exited 0 with the plugin installed.

Fresh HOME, LC_ALL=C, stdin /dev/null:

  • ~/.claude/CLAUDE.md contains <!-- rtk-instructions with no closing marker: rtk init -g --opencode --claude-md -> exit 1, plugin missing (write_rtk_block refuses the malformed block before the install).
  • ~/.claude mode 555: rtk init -g --opencode --auto-patch -> exit 1, plugin missing (Failed to write RTK.md ... Permission denied, before the install in run_default_mode).

Both fail loudly with the offending path, and plain rtk init -g fails the same way on those inputs. The question is whether the OpenCode install should be independent of the Claude side, for example by running first, or by attempting both and reporting each outcome.

Related: #4046, #4248.

Activity

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

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 85%

    Summary

    Since #4323, rtk init -g --opencode aborts with exit 1 and installs nothing if the Claude-side setup fails first, a regression from the prior independent behavior.

    📁 Relevant files
    • src/init/mod.rs
    • src/init/claude.rs
    • src/init/opencode.rs

    Suggested Actions

    1. Decide design: run OpenCode install independently/first, or attempt both and report each outcome
    2. Check run_default_mode ordering where Claude-side write_rtk_block/RTK.md write happens before OpenCode install
    3. Cross-reference fix(init): fail closed on missing .claude dir and hoist OpenCode install (fixes #4046) #4323 (added combined install) and rtk init --opencode appears to skip Claude hook installation #4046 (Claude setup) for intended coupling
    4. Add regression test with malformed rtk-instructions marker and read-only ~/.claude to cover both reported failure m…

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

  3. TechWizard9999 commented on Oct 5, 2026

    @TechWizard9999
    Contributor

    Hi @KuSh , Can I look into this again if possible ?

  4. added a commit that references this issue on Oct 30, 2026
    d54ca99
  5. added 2 commits that reference this issue on Nov 2, 2026
    fd68451
    e3dc290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions