Skip to content

hellopahe/magicsteer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inject follow-up instructions into a live GitHub Copilot CLI session from another terminal.

create your own version

claude -p "Build a GitHub Copilot CLI follow-up steering tool in the current directory. Create a preToolUse hook that reads stdin JSON, extracts sessionId, reads only the unread lines after the last <LAST_READ> marker from ~/.followup-instructions/<session-id>-instruction.md, appends a new <LAST_READ> marker to that file, and when unread text exists returns hook JSON that denies the current tool call once and includes the unread text as UPDATED USER INSTRUCTION in the denial reason. Also create one terminal UI command named magicsteer that lists active sessions from ~/.copilot/session-state and sends follow-up instructions to one selected session, an install.sh that installs the hook into ~/.copilot/hooks, registers it in ~/.copilot/config.json, installs only magicsteer into ~/.local/bin, an uninstall.sh that removes it, and a concise README with install, usage, and one real example transcript." --dangerously-skip-permissions --verbose

install

run:

./install.sh

it installs:

  • the hook at ~/.copilot/hooks/followup-pretool.sh
  • magicsteer at ~/.local/bin/
  • the hook entry in ~/.copilot/config.json

how to use

use command magicsteer in a new terminal window, select a session, and submit a steering prompt, while an active copilot session is running.

Examples

inject a follow-up during a running tool call

  1. Start Copilot CLI in terminal A.
  2. Open magicsteer in terminal B.
  3. Send a new instruction while Copilot is still working.
  4. Copilot picks it up on the next tool call.

full session transcript

╭────────────────────────────────────────────────╮
│  ╭─╮╭─╮                                        │
│  ╰─╯╰─╯  GitHub Copilot v1.0.24                │
│  █ ▘▝ █  Describe a task to get started.       │
│   ▔▔▔▔                                         │
│  Tip: /plugin Manage plugins and               │
│  plugin marketplaces                           │
│  Copilot uses AI. Check for mistakes.          │
╰────────────────────────────────────────────────╯

● Environment loaded: 1 hook, 1 MCP server, 42 skills

● Model changed to: gpt-5-mini (medium)

❯ sleep for 60 secs and generate 20 English names for my dog.

● Sleeping for 60 seconds as requested, then will generate 20 English dog names. Running a brief sleep to honor the delay, then
  returning the list.

● Sleep for 60 seconds (shell)
  │ sleep 60
  └ 1 line...

✗ Read shell output Waiting up to 5 seconds for command output
  └ Denied by preToolUse hook: User updated the task during the current session. This is a new user instruction for the current
    session, not environment noise.

    Treat the instruction below as higher priority than any conflicting earlier request, plan, or assumption. Re-evaluate your plan
    before continuing.

    Retry the blocked tool call only if it still matches the updated instruction.

    UPDATED USER INSTRUCTION:
    I've changed my mind, generate French names instead pls.

● Shell "Sleep for 60 seconds" completed

● Here are 20 French dog names:

   1. Amélie
   2. Belle
   3. Bijou
   4. Brigitte
   5. Chérie
   6. Coco
   7. Émile
   8. Fleur
   9. Gaston
   10. Hugo
   11. Jacques
   12. Léon
   13. Lucie
   14. Marcel
   15. Noémie
   16. Olivier
   17. Pierre
   18. René
   19. Simone
   20. Zoé

● Task complete
  └ Slept 60 seconds and generated 20 French dog names: Amélie, Belle, Bijou, Brigitte, Chérie, Coco, Émile, Fleur, Gaston, Hugo,
    Jacques, Léon, Lucie, Marcel, Noémie, Olivier, Pierre, René, Simone, Zoé.

About

Pilot the copilot mid-flight, with zero extra requests.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors