Skip to content

RTK is not being configured properly with global initialization for VS Code + Copilot #2216

Open

Description

@mariofilho-cdv

I've run rtk init -g --copilot in my home directory (in WSL), and the coding agents are not using the tool. I know this because I tell an agent in VS Code chat to run a terminal command, and the report generated by rtk gain is not updated.

There are a few evidences that point to this issue:

  1. the output that I get from rtk init -g --copilot reads

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

GitHub Copilot integration installed (project-scoped).

Hook config: ./.github/hooks/rtk-rewrite.json
Instructions: ./.github/copilot-instructions.md

Works with VS Code Copilot Chat (transparent rewrite)
and Copilot CLI (deny-with-suggestion).

Restart your IDE or Copilot CLI session to activate.

So despite the user passing the global -g flag, the log says the installation was "project-scoped", which is strange.

  1. the default directories where VS Code searches for instructions and hooks are ~/.copilot, not ~/.github, which is the one created by rtk.

  2. even by moving the created files "rtk-rewrite.json" and "copilot-instructions.md" to the directories "/.copilot/hooks" and "/.copilot/instructions", the functionality still does not work. I can see that VS Code register the hook and the instruction, but the coding agent still does not preface terminal commands with rtk (as evidenced by the rtk gain report).

  3. by running rtk init -g --copilot --dry-run, the output doesn't show which operations would have been done.

  4. the documentation in the project README gives inconsistent instructions for initializing rtk for VS Code. In one code snippet, it says that the user should run rtk init -g for either claude code or copilot (although it doesn't specify if this works for copilot with VS Code). However, in other points of the documentation, it instructs the user to run rtk init -g --copilot.

All these evidences point to the conclusion that integration with VS Code + copilot is not being properly supported.

Workaround: by the way, I have managed to make rtk work by moving the two files to ~/.copilot (as described in item 3 above) and replacing the first line of the instructions file by the following lines:

---
applyTo: "**"
---

Activity

  1. added
    bug
    help wanted
    on Jun 2, 2026
  2. pszymkowiak commented on Jun 2, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 91%

    Summary

    rtk init -g --copilot incorrectly installs project-scoped instead of global, uses wrong VS Code directories (~/.github instead of ~/.copilot), and has inconsistent README docs; recommend fixing global init path logic and updating documentation.


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

  3. mikeangstadt commented on Jun 2, 2026

    @mikeangstadt

    This appears to be already fixed in the current develop branch. Copilot global init issue was fixed by commit e3ad973 (merged to develop via PR #2101). Please verify on latest develop and close if confirmed.

  4. dograt commented on Jun 14, 2026

    @dograt

    Has this fix made it into a tagged release yet?

  5. KuSh commented on Sep 13, 2026

    @KuSh
    Collaborator

    The global install half of this is fixed by PR #2101, shipped in v0.42.3: rtk init -g --copilot now writes ~/.copilot/copilot-instructions.md and ~/.copilot/hooks/rtk-rewrite.json, reports the install as user-scoped, and --dry-run lists the files it would write. That part reproduces on the current build. The VS Code Copilot Chat side could not be exercised here, so this is labeled resolved-pending-close rather than closed; please comment if VS Code still ignores the hook on the latest version.

  6. added
    resolved-pending-close
    on Sep 13, 2026
  7. KuSh commented on Sep 19, 2026

    @KuSh
    Collaborator

    Removing the resolved-pending-close label, because only part of this is fixed. The global install half did land in v0.42.3 (#2101): rtk init -g --copilot now writes ~/.copilot/copilot-instructions.md and ~/.copilot/hooks/rtk-rewrite.json, reports the install as user-scoped rather than project-scoped, and --dry-run lists both files. What you reported for VS Code Copilot Chat is still true on the current code: the generated instructions file has no applyTo: "**" front matter, which is exactly the block you had to add by hand, and rtk's own output describes the global install as applying to Copilot CLI sessions while the README advertises the same command for VS Code. Keeping this open for that part.

  8. removed
    resolved-pending-close
    on Sep 19, 2026
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

    area:cliarea:docsbughelp wantedpriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions