context_budget_plan
Generate a deterministic ranked token-reduction plan for context files that exceed a set budget, with line ranges, tokens freed, safety actions, and apply/verify steps.
Instructions
Use before appending more than ~50 lines or when CLAUDE.md, AGENTS.md, Cursor rules, or prompts exceed budget. Input: required integer budget plus optional maxFindings, includeDiff, and apply. Returns a deterministic ranked plan with file line ranges, tokensFreed, confidence, safety actions, preserve spans, and satisfiable/minAchievable stop state. Apply entries in order by startLine/endLine, never rewrite a file, never cut preserve spans except by applying the condensedText of a condense entry exactly as given, stop when satisfiable is false, and call context_budget_verify after edits. The plan is saved under .ctxcap/plans for 24 hours.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"budget": "<budget>"
},
"name": "context_budget_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | ||
| budget | Yes | ||
| includeDiff | No | ||
| maxFindings | No |