You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Context data not available in non-interactive mode #979
Are you talking about having context available through prompts ? Or adding external file to the context ?
To keep the context through prompts, you can use the --continue flag:
$ copilot -p "My favourite colour is blue"
$ copilot -p "What's my favourite colour ?"
I dont know what is your favourite colour
$ copilot -p "My favourite colour is blue" --continue
$ copilot -p "What's my favourite colour ?" --continue
Blue
To add an external file to the prompt, you can use @:
$ copilot -p "Check @pom.xml and give me the dependencies"
Thanks for following up, and sorry this sat for so long. We couldn't act on this without knowing exactly which data you need, but if it's context-window and token stats, there are now a few options: in prompt mode, --output-format json emits JSONL output for programmatic use (v0.0.422) and --usage-output-file writes usage metrics as JSON (per-agent metrics added in v1.0.81), and if you drive Copilot from code, the Copilot SDK emits session.usage_info events with currentTokens and tokenLimit (docs). If those don't cover your use case, please open a new issue describing the data you need in non-interactive mode, the command you're running, and your CLI version.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.
Activity
agoncal commentedon Jan 26, 2026
Are you talking about having context available through prompts ? Or adding external file to the context ?
To keep the context through prompts, you can use the
--continueflag:To add an external file to the prompt, you can use
@:$ copilot -p "Check @pom.xml and give me the dependencies"I'm using copilot 0.0.394
redsquare commentedon Jan 26, 2026
Apologies, I was coding up Ralph wiggum and wanted to see context window stats. I am afk but can grab more detail when back
redsquare commentedon Jan 26, 2026
Apologies, I was coding up Ralph wiggum and wanted to see context window stats. I am afk but can grab more detail when back
patniko commentedon Oct 26, 2026
Thanks for following up, and sorry this sat for so long. We couldn't act on this without knowing exactly which data you need, but if it's context-window and token stats, there are now a few options: in prompt mode,
--output-format jsonemits JSONL output for programmatic use (v0.0.422) and--usage-output-filewrites usage metrics as JSON (per-agent metrics added in v1.0.81), and if you drive Copilot from code, the Copilot SDK emitssession.usage_infoevents withcurrentTokensandtokenLimit(docs). If those don't cover your use case, please open a new issue describing the data you need in non-interactive mode, the command you're running, and your CLI version.Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.