pre-flight
When this skill is the preferred path
The user (or the agent itself) is about to send a prompt that might be
expensive, redundant, or context-window-exhausting. Instead of sending
blindly and finding out only when the bill arrives or the conversation
hits 200k tokens, the agent calls gc_pre_flight first to get a
structured answer.
This skill is the gotcontext SKU. One MCP call replaces context
warnings, compression decisions, and cost previews.
How to use it
Call gc_pre_flight with the proposed prompt body. Optionally pass:
hint — what the agent is trying to do ("refactor", "debug", "plan").
Guides the compression strategy.
target_model — the LLM that will receive this prompt
("gpt-4o", "claude-opus-4-7", etc.). Drives cost preview accuracy.
current_context_used_pct — agent's estimate of its own context fill
(0-100). Drives the warn_context_limit and clear_first verdicts.
What you get back
A structured response (JSON) with these fields:
verdict: one of send_as_is, send_compressed, warn_context_limit, clear_first
compressed_prompt: the actual compressed body (when verdict is send_compressed); null otherwise
tokens_in_original / tokens_in_compressed: token counts
compression_ratio: 0.0-1.0
estimated_cost_original_usd / estimated_cost_compressed_usd / estimated_savings_usd
cache_hit_likelihood: 0.0-1.0 — probability that the prompt's prefix is in the gotcontext semantic cache
context_warning: null OR an object describing the projected context fill if the agent sends as-is
recommendation: human-readable action
How to act on the verdict
| Verdict |
Action |
send_as_is |
Send the original prompt. Compression wouldn't beat 30% savings. |
send_compressed |
Use the compressed_prompt field as the prompt body. Costs less, fits more. |
warn_context_limit |
The original prompt would push context fill to 90%+. Send compressed body OR run "gc_session_summary" (v1.21.1) first. |
clear_first |
Context is critical. Run "gc_session_summary" (v1.21.1), then /clear, then re-inject the summary, then send. |
Why this skill exists
- Anthropic GH#25798 closed as duplicate, unfixed for 2 months: agents have
no proactive context-window warnings.
gc_pre_flight's
warn_context_limit and clear_first verdicts close that gap.
- Cursor and Claude Code users routinely complain about 4M-token bursts on
trivial tasks.
gc_pre_flight's cost preview shows the bill BEFORE
you commit to it.
- LLMLingua and similar compressors require a separate compression call,
then a separate cost-estimation call, then the agent needs context
awareness from somewhere else.
gc_pre_flight is one call that does
all three.
Plan availability
Available on every plan including Free. Volume is governed by your
existing per-month compression quota — not by allowlist exclusion.
This is the conversion driver: Free users see real cost previews and
real verdicts; Pro+ users get unlimited calls.
Before writing code — use the agent-prep tools (Pro+)
gc_pre_flight answers "should I compress?" before sending a prompt.
For the paired question — "what should I actually change?" — two
complementary tools are available on Pro+ plans:
gc_agent_capsule: returns an actionable context capsule
(primary targets, snippets, validation commands, rollback metadata,
confidence score) before any non-trivial code change. Wraps
tg agent. Use this as the first call whenever an agent is about to
touch multiple files or a non-obvious symbol.
gc_edit_plan: returns a machine-readable edit plan (which files
to modify, what to add/remove, validation_commands to verify the
result). Wraps tg edit-plan. Use this instead of free-form "let
me think about this" planning loops — the plan comes back structured
and executable.
Typical pre-code agent sequence:
gc_pre_flight — is the prompt cost-efficient?
gc_agent_capsule — what do I need to look at?
gc_edit_plan — exactly what do I change?
- Make the edits, run the validation_commands from the plan output.
1---2name: pre-flight3description: Pre-flight check before sending an expensive LLM prompt. Returns a verdict (send_as_is, send_compressed, warn_context_limit, clear_first), the compressed prompt body inline, a cost preview against on-demand list pricing, and a cache hit likelihood. Use this skill whenever an agent is about to submit a prompt above ~1000 tokens or when context fill is unknown. Trigger phrases include "estimate cost before sending", "should I compress this prompt", "am I about to run out of context", "preview compression savings".4---56# pre-flight78## When this skill is the preferred path910The user (or the agent itself) is about to send a prompt that might be11expensive, redundant, or context-window-exhausting. Instead of sending12blindly and finding out only when the bill arrives or the conversation13hits 200k tokens, the agent calls `gc_pre_flight` first to get a14structured answer.1516This skill is the gotcontext SKU. **One MCP call replaces context17warnings, compression decisions, and cost previews.**1819## How to use it2021Call `gc_pre_flight` with the proposed prompt body. Optionally pass:2223- `hint` — what the agent is trying to do ("refactor", "debug", "plan").24 Guides the compression strategy.25- `target_model` — the LLM that will receive this prompt26 ("gpt-4o", "claude-opus-4-7", etc.). Drives cost preview accuracy.27- `current_context_used_pct` — agent's estimate of its own context fill28 (0-100). Drives the `warn_context_limit` and `clear_first` verdicts.2930## What you get back3132A structured response (JSON) with these fields:3334- `verdict`: one of `send_as_is`, `send_compressed`, `warn_context_limit`, `clear_first`35- `compressed_prompt`: the actual compressed body (when verdict is `send_compressed`); null otherwise36- `tokens_in_original` / `tokens_in_compressed`: token counts37- `compression_ratio`: 0.0-1.038- `estimated_cost_original_usd` / `estimated_cost_compressed_usd` / `estimated_savings_usd`39- `cache_hit_likelihood`: 0.0-1.0 — probability that the prompt's prefix is in the gotcontext semantic cache40- `context_warning`: null OR an object describing the projected context fill if the agent sends as-is41- `recommendation`: human-readable action4243## How to act on the verdict4445| Verdict | Action |46|---|---|47| `send_as_is` | Send the original prompt. Compression wouldn't beat 30% savings. |48| `send_compressed` | Use the `compressed_prompt` field as the prompt body. Costs less, fits more. |49| `warn_context_limit` | The original prompt would push context fill to 90%+. Send compressed body OR run "gc_session_summary" (v1.21.1) first. |50| `clear_first` | Context is critical. Run "gc_session_summary" (v1.21.1), then `/clear`, then re-inject the summary, then send. |5152## Why this skill exists5354- Anthropic GH#25798 closed as duplicate, unfixed for 2 months: agents have55 no proactive context-window warnings. `gc_pre_flight`'s56 `warn_context_limit` and `clear_first` verdicts close that gap.57- Cursor and Claude Code users routinely complain about 4M-token bursts on58 trivial tasks. `gc_pre_flight`'s cost preview shows the bill BEFORE59 you commit to it.60- LLMLingua and similar compressors require a separate compression call,61 then a separate cost-estimation call, then the agent needs context62 awareness from somewhere else. `gc_pre_flight` is one call that does63 all three.6465## Plan availability6667Available on every plan including Free. Volume is governed by your68existing per-month compression quota — not by allowlist exclusion.69This is the conversion driver: Free users see real cost previews and70real verdicts; Pro+ users get unlimited calls.7172## Before writing code — use the agent-prep tools (Pro+)7374`gc_pre_flight` answers "should I compress?" before sending a prompt.75For the paired question — "what should I actually change?" — two76complementary tools are available on Pro+ plans:7778- `gc_agent_capsule`: returns an actionable context capsule79 (primary targets, snippets, validation commands, rollback metadata,80 confidence score) before any non-trivial code change. Wraps81 `tg agent`. Use this as the first call whenever an agent is about to82 touch multiple files or a non-obvious symbol.8384- `gc_edit_plan`: returns a machine-readable edit plan (which files85 to modify, what to add/remove, validation_commands to verify the86 result). Wraps `tg edit-plan`. Use this instead of free-form "let87 me think about this" planning loops — the plan comes back structured88 and executable.8990Typical pre-code agent sequence:911. `gc_pre_flight` — is the prompt cost-efficient?922. `gc_agent_capsule` — what do I need to look at?933. `gc_edit_plan` — exactly what do I change?944. Make the edits, run the validation_commands from the plan output.