Priority: P3 — Low
Problem
The VS Code extension has no rate limiting for tool calls. A user could accidentally (or intentionally) trigger hundreds of review runs, exhausting their Anthropic API quota or incurring unexpected charges in managed mode.
There is also no limit on web search calls from src/server/tools/web.ts, which could hit search API quotas.
Solution
1. Per-day review limit (configurable)
VS Code setting: chainreview.limits.reviewsPerDay (default: 20)
When the daily limit is reached:
- Show a notification: "Daily review limit (20) reached. Resets at midnight."
- Provide a "Manage Limits" button linking to settings
2. Per-session review limit
VS Code setting: chainreview.limits.reviewsPerSession (default: 5)
3. Web search per-review limit
In src/server/tools/web.ts:
const MAX_WEB_SEARCHES_PER_REVIEW = process.env.CHAINREVIEW_MAX_WEB_SEARCHES ?? 10;
4. Track usage locally
Store daily usage counts in SQLite:
CREATE TABLE usage_local (
date TEXT PRIMARY KEY, -- YYYY-MM-DD
review_count INTEGER DEFAULT 0,
token_count INTEGER DEFAULT 0
);
5. Show usage in status bar
VS Code status bar: ChainReview: 3/20 reviews today
Acceptance Criteria
Priority: P3 — Low
Problem
The VS Code extension has no rate limiting for tool calls. A user could accidentally (or intentionally) trigger hundreds of review runs, exhausting their Anthropic API quota or incurring unexpected charges in managed mode.
There is also no limit on web search calls from
src/server/tools/web.ts, which could hit search API quotas.Solution
1. Per-day review limit (configurable)
VS Code setting:
chainreview.limits.reviewsPerDay(default: 20)When the daily limit is reached:
2. Per-session review limit
VS Code setting:
chainreview.limits.reviewsPerSession(default: 5)3. Web search per-review limit
In
src/server/tools/web.ts:4. Track usage locally
Store daily usage counts in SQLite:
5. Show usage in status bar
VS Code status bar:
ChainReview: 3/20 reviews todayAcceptance Criteria