Skip to main content

GitHub Copilot CLI

GitHub Copilot CLI installs through Homebrew and reports permissions through its hooks, so automatic approval can answer for it. Copilot has no model list command and its hooks carry no model or usage data, so Saggar reads both from the session log Copilot keeps on disk.

Commandcopilot
Installbrew install --cask copilot-cli
Hook configuration~/.copilot/hooks/saggar.json
Skill location~/.copilot/skills/saggar-cli/SKILL.md
Resumecopilot --resume <id>, or copilot --resume without an id

Launching​

The launch menu always has a default Copilot row, which starts copilot with its own configured model. Beside it Saggar publishes one row per model Copilot has routed to in the last 14 days, learned from ~/.copilot/session-state/*/events.jsonl: the models a turn on auto chose between, and any you switched to by hand. A model that drops out of your plan drops out of the menu once its logs age past that window. Rows appear in slug order and carry the slug as their label.

Copilot takes a reasoning effort on --effort, from the ladder none, minimal, low, medium, high, xhigh, and max, on 1.0.10 or newer. Pick it per session in the new-session sheet or save it in a preset. Leaving it unset keeps the model's own default.

On 1.0.35 or newer Saggar chooses the conversation's id before the process starts and passes it as --session-id, as it does for Claude Code, so restore never depends on a hook firing. A session started from a prompt is named from that prompt with --name. A first task is passed with -i. Preset context doesn't reach Copilot: its launch has no flag for it.

Hooks​

Installing hooks writes one hook file under ~/.copilot/hooks and one script under ~/.saggar/. Your Copilot settings and any neighboring hooks are left alone, and removal deletes only Saggar's file. If a saggar.json Saggar didn't write is already there, the install refuses and asks you to move it aside rather than merging into it. With hooks installed Saggar:

  • captures the native session id;
  • names the session from its first prompt;
  • follows completed turns, notifications, and clean exits;
  • hears permission requests directly;
  • checks each shell command before it runs when supervision is set to Intercept;
  • restores each session to its exact conversation.

Version floors​

The hook file lists every event whatever your version. Where Copilot is too old to run one, the provider card says what it can't do and the same sentence is printed once in the terminal ahead of the launch.

CapabilityNeeds
Take a reasoning effort1.0.10
Name a session from its first prompt, follow turns and notifications, hear permission prompts without reading the screen1.0.21
Follow session starts and notice a clean exit1.0.22
Launch with Saggar's session id and name1.0.35
Check shell commands before they run1.0.85

Resume by id predates Copilot's oldest published release, so it is never gated. The floors are where Saggar's install is known to work, not where each event first appeared.

Prompts and automatic approval​

Copilot's permission requests reach Saggar through the hook, and Saggar answers there when the session is unsupervised. The deny-list reads the request first, so a destructive command is handed back on screen for you to read.

The hook answers only the two requests it can read whole, which Copilot names bash and edit. Creating a file is an edit too. A URL fetch, an MCP tool, a question to you, or a subagent stays with you. See Agents for the full rule.

Under Intercept, the PreToolUse hook checks each shell command before it runs on 1.0.85 or newer and denies one that matches the deny-list. Input sent later to a running shell is not checked again.

Saggar also recognizes Copilot's own approval dialogs on screen, as CLI 1.0.85 draws them, so an unhooked session still turns Needs you when one is waiting and automatic approval can answer it with the first choice.

Session details​

The terminal info view shows the model answering the conversation, the reasoning effort, the context tier, premium requests used, and AI units, read from the same session log. When a session exits, Copilot writes a token breakdown into its log, and a resumed session shows what it was holding then. Details appear after the first response and may be missing with a newer log format. Copilot's subagents feed the session's progress card from the same log.

Resume​

With a recorded id, restore runs copilot --resume <id>. Without one it runs copilot --resume, which reopens the most recent conversation.

Further reading​