Skip to content

rtk init -g --copilot writes to wrong global path for Copilot CLI #2242

Closed

Description

@lmmzss-jk

Bug Description

rtk init -g --copilot writes copilot-instructions.md to ~/.github/copilot-instructions.md, but Copilot CLI reads global custom instructions from ~/.copilot/copilot-instructions.md.

This means the RTK instructions are never loaded by Copilot CLI.

Steps to Reproduce

rtk init -g --copilot

Output:

[ok] Added Copilot instructions to ./.github/copilot-instructions.md

File created at ~/.github/copilot-instructions.md — Copilot CLI does not read this path.

Expected Behavior

RTK should write to ~/.copilot/copilot-instructions.md (the path Copilot CLI actually reads for global user-level instructions).

Reference: Copilot CLI docs list these instruction sources:

$HOME/.copilot/copilot-instructions.md        ← global user-level
.github/copilot-instructions.md               ← project-level (git root)

Additional Context

  • rtk-rewrite.json in ~/.github/hooks/ is also ineffective since Copilot CLI has no PreToolUse hook mechanism (unlike Claude Code).
  • The only way RTK can work with Copilot CLI is via prompt instructions, so getting the file path right is critical.
  • RTK version: 0.42.0
  • OS: macOS (Apple Silicon)

Workaround

Manually append RTK instructions:

cat ~/.github/copilot-instructions.md >> ~/.copilot/copilot-instructions.md

Activity

  1. pszymkowiak commented on Jun 3, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 93%

    Summary

    rtk init -g --copilot writes to wrong path (~/.github/ instead of ~/.copilot/) making Copilot CLI never load the instructions; fix the global path constant.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    ♻️ Possible duplicate of #2216

    📁 Relevant files
    • src/init.rs
    • src/cli/init.rs

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

  2. ConorLindsay94 commented on Jun 11, 2026

    @ConorLindsay94

    To get this working in VSCode:

    • Install globally with rtk init -g
    • In your VScode settings, search for chat.useHooks
    • Enable Use Claude Hooks
    • Reload VScode
  3. lmmzss-jk commented on Jun 11, 2026

    @lmmzss-jk
    Author

    To get this working in VSCode:

    • Install globally with rtk init -g
    • In your VScode settings, search for chat.useHooks
    • Enable Use Claude Hooks
    • Reload VScode

    The scenario I use most often is the CLI.

  4. KuSh commented on Sep 13, 2026

    @KuSh
    Collaborator

    Fixed by #2101, shipped in v0.42.3: rtk init -g --copilot now writes ~/.copilot/copilot-instructions.md (plus ~/.copilot/hooks/rtk-rewrite.json) instead of ~/.github, so Copilot CLI picks the instructions up. Verified on the current branch with HOME pointed at a scratch directory. If the CLI still misses them on the latest version, comment here and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions