context-doctor 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -265,6 +265,21 @@ That is 10% on top of the parent session's own input cost ($5846.45), and none o
|
|
|
265
265
|
|
|
266
266
|
Per subagent: what it was asked, how many calls it made, the context it ended with, how long it ran, and its cost at list price with cache reads and writes priced correctly. Models without a price on file are counted but marked unpriced rather than costed at zero. On this machine that was 195 subagents across 19 sessions and about $1,844 at list price that no profile had ever shown.
|
|
267
267
|
|
|
268
|
+
## The same number inside VS Code and Cursor
|
|
269
|
+
|
|
270
|
+
An extension in [`vscode/`](vscode/) puts context health in the editor's own status bar:
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
⌁ ctx 848k · 85% · cache 100% ⚠
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
It reads the newest Claude Code transcript for the open workspace folder, shows live context, share of window and cache share, turns to the warning colour past 70% (configurable), and opens a terminal running `context-doctor session` when clicked. Nothing leaves the machine; it only reads files Claude Code already writes. Until it is on the marketplace, build and install it locally:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
cd vscode && npm ci && npm run package
|
|
280
|
+
code --install-extension context-doctor-vscode-0.1.0.vsix # or: cursor --install-extension …
|
|
281
|
+
```
|
|
282
|
+
|
|
268
283
|
## Context health in Claude Code's status bar
|
|
269
284
|
|
|
270
285
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export { pricingFor, inputCostUsd, estimatedTtftSeconds, formatUsd } from "./pri
|
|
|
17
17
|
export type { ModelPricing } from "./pricing.js";
|
|
18
18
|
export { estimateTokens, contextWindowFor, providerFor, formatTokens } from "./tokens.js";
|
|
19
19
|
export type { Provider } from "./tokens.js";
|
|
20
|
+
export { renderStatusLine, tailUsage } from "./statusline.js";
|
package/dist/index.js
CHANGED
|
@@ -10,3 +10,6 @@ export { startProxy } from "./proxy.js";
|
|
|
10
10
|
export { listSessions, parseSessionFile } from "./session.js";
|
|
11
11
|
export { pricingFor, inputCostUsd, estimatedTtftSeconds, formatUsd } from "./pricing.js";
|
|
12
12
|
export { estimateTokens, contextWindowFor, providerFor, formatTokens } from "./tokens.js";
|
|
13
|
+
// Status-line building blocks, for editor integrations (the VS Code / Cursor
|
|
14
|
+
// extension in ./vscode) that show the same number in their own status bar.
|
|
15
|
+
export { renderStatusLine, tailUsage } from "./statusline.js";
|
package/dist/mcp.js
CHANGED
|
@@ -37,7 +37,7 @@ const STRATEGY_IDS = ["dedupe", "trim-tool-results", "trim-tool-calls", "strip-b
|
|
|
37
37
|
* recommended pattern.
|
|
38
38
|
*/
|
|
39
39
|
function createServer() {
|
|
40
|
-
const server = new McpServer({ name: "context-doctor", version: "0.14.
|
|
40
|
+
const server = new McpServer({ name: "context-doctor", version: "0.14.3" }, { instructions: SERVER_INSTRUCTIONS });
|
|
41
41
|
server.tool("profile_context", "Profile an LLM conversation or prompt: token breakdown by category, largest messages, and actionable findings about wasted context (duplicates, oversized tool results, base64 blobs, cache-unfriendly ordering). Accepts OpenAI/Anthropic conversation JSON or raw text. Call this immediately whenever the user asks about token usage, context size, LLM cost, or latency — and proactively offer it once a conversation grows long or accumulates large pasted content.", {
|
|
42
42
|
conversation: z.string().describe("Conversation JSON (OpenAI or Anthropic format, or bare message array) or raw prompt text"),
|
|
43
43
|
model: z.string().optional().describe("Target model name for context-window math, e.g. claude-sonnet-5 or gpt-4o"),
|
package/package.json
CHANGED