ctxcap
v0.1.10Offline context-budget MCP server for AI coding agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
measure_context
Use when CLAUDE.md, AGENTS.md, Cursor rules, or prompts may be too large or consuming too much context. Input: optional suggest, stale, and staleGlob booleans. Returns JSON token totals, per-file counts, baseline deltas, budget status, suggestions, and optional stale-reference findings. Runs offline and only reads the current working directory.
| Parameter | Type | Description |
|---|---|---|
stale | boolean | |
staleGlob | boolean | |
suggest | boolean |
context_budget_plan
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 pl…
| Parameter | Type | Description |
|---|---|---|
budget * | integer | |
apply | boolean | |
includeDiff | boolean | |
maxFindings | integer |
context_budget_verify
Use after applying a context-budget plan to catch missed edits, manual drift, or preserve-span violations. Input: the planId returned by context_budget_plan. Returns applied and missed finding IDs, violations with file and line ranges, remaining tokens, and satisfied. Do not consider the budget met until satisfied is true.
| Parameter | Type | Description |
|---|---|---|
planId * | string |
trim_to_budget
Deprecated alias for context_budget_plan for clients using the old name. Input: required integer budget and optional maxFindings. Returns the same ranked, safety-classified plan with apply false; it never edits context files. Follow line ranges, preserve spans, satisfiable stop rules, and verification guidance from context_budget_plan.
| Parameter | Type | Description |
|---|---|---|
budget * | integer | |
maxFindings | integer |