Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Handle Linear API rate limiting, complexity budgets, and quotas. Use when dealing with 429 errors, implementing throttling, or optimizing request patterns to stay within limits. Trigger: "linear rate limit", "linear throttling", "linear 429", "linear API quota", "linear complexity", "linear request limits".
.claude/skills/jeremylongshore-linear-rate-limits/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 85% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 223% | 0% |
Linear uses the leaky bucket algorithm with two rate limiting dimensions. Understanding both is critical for reliable integrations:
| Budget | Limit | Refill Rate | |--------|-------|-------------| | Requests | 5,000/hour per API key | ~83/min constant refill | | Complexity | 250,000 points/hour | ~4,167/min constant refill | | Max single query | 10,000 points | Hard reject if exceeded |
Complexity scoring: Each property = 0.1 pt, each object = 1 pt, connections multiply children by first arg (default 50), then round up.
@linear/sdk installedLinear returns rate limit info on every response.
typescriptconst response = await fetch("https://api.linear.app/graphql", { method: "POST", headers: { Authorization: process.env.LINEAR_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ query: "{ viewer { id } }" }), }); // Key headers const headers = { requestsRemaining: response.headers.get("x-ratelimit-requests-remaining"), requestsLimit: response.headers.get("x-ratelimit-requests-limit"), requestsReset: response.headers.get("x-ratelimit-requests-reset"), complexityRemaining: response.headers.get("x-ratelimit-complexity-remaining"), complexityLimit: response.headers.get("x-ratelimit-complexity-limit"), queryComplexity: response.headers.get("x-complexity"), }; console.log(`Requests: ${headers.requestsRemaining}/${headers.requestsLimit}`); console.log(`Complexity: ${headers.complexityRemaining}/${headers.complexityLimit}`); console.log(`This query cost: ${headers.queryComplexity} points`);
typescriptimport { LinearClient } from "@linear/sdk"; class RateLimitedClient { private client: LinearClient; constructor(apiKey: string) { this.client = new LinearClient({ apiKey }); } async withRetry<T>(fn: () => Promise<T>, maxRetries = 5): Promise<T> { for (let attempt = 0; attempt < maxRetries; attempt++) { try { return await fn(); } catch (error: any) { const isRateLimited = error.status === 429 || error.message?.includes("rate") || error.type === "ratelimited"; if (!isRateLimited || attempt === maxRetries - 1) throw error; // Exponential backoff: 1s, 2s, 4s, 8s, 16s + jitter const delay = 1000 * Math.pow(2, attempt) + Math.random() * 500; console.warn(`Rate limited (attempt ${attempt + 1}/${maxRetries}), waiting ${Math.round(delay)}ms`); await new Promise(r => setTimeout(r, delay)); } } throw new Error("Unreachable"); } get sdk() { return this.client; } }
Prevent bursts by spacing requests evenly.
typescriptclass RequestQueue { private queue: Array<{ fn: () => Promise<any>; resolve: Function; reject: Function }> = []; private processing = false; private intervalMs: number; constructor(requestsPerSecond = 10) { this.intervalMs = 1000 / requestsPerSecond; } async enqueue<T>(fn: () => Promise<T>): Promise<T> { return new Promise((resolve, reject) => { this.queue.push({ fn, resolve, reject }); if (!this.processing) this.processQueue(); }); } private async processQueue() { this.processing = true; while (this.queue.length > 0) { const { fn, resolve, reject } = this.queue.shift()!; try { resolve(await fn()); } catch (error) { reject(error); } if (this.queue.length > 0) { await new Promise(r => setTimeout(r, this.intervalMs)); } } this.processing = false; } } // Usage: 8 requests/second max const queue = new RequestQueue(8); const client = new LinearClient({ apiKey: process.env.LINEAR_API_KEY! }); const teamResults = await Promise.all( teamIds.map(id => queue.enqueue(() => client.team(id))) );
typescript// HIGH COMPLEXITY (~12,500 pts): // 250 issues * (1 issue + 50 labels * 0.1 per field) = expensive // const heavy = await client.issues({ first: 250 }); // LOW COMPLEXITY (~55 pts): // 50 issues * (5 fields * 0.1 + 1 object) = cheap const light = await client.issues({ first: 50, filter: { team: { id: { eq: teamId } } }, }); // Use rawRequest for minimal field selection const minimal = await client.client.rawRequest(` query { issues(first: 50) { nodes { id identifier title priority } } } `); // Sort by updatedAt to get fresh data first, avoid paginating everything const fresh = await client.issues({ first: 50, orderBy: "updatedAt", filter: { updatedAt: { gte: lastSyncTime } }, });
Combine multiple mutations into one GraphQL request.
typescript// Instead of 100 separate issueUpdate calls (~100 requests): async function batchUpdatePriority(client: LinearClient, issueIds: string[], priority: number) { const chunkSize = 20; // Keep each batch under complexity limit for (let i = 0; i < issueIds.length; i += chunkSize) { const chunk = issueIds.slice(i, i + chunkSize); const mutations = chunk.map((id, j) => `u${j}: issueUpdate(id: "${id}", input: { priority: ${priority} }) { success }` ).join("\n"); await queue.enqueue(() => client.client.rawRequest(`mutation BatchUpdate { ${mutations} }`) ); } } // Batch archive async function batchArchive(client: LinearClient, issueIds: string[]) { for (let i = 0; i < issueIds.length; i += 20) { const chunk = issueIds.slice(i, i + 20); const mutations = chunk.map((id, j) => `a${j}: issueArchive(id: "${id}") { success }` ).join("\n"); await client.client.rawRequest(`mutation { ${mutations} }`); } }
typescriptclass RateLimitMonitor { private remaining = { requests: 5000, complexity: 250000 }; update(headers: Headers) { const reqRemaining = headers.get("x-ratelimit-requests-remaining"); const cxRemaining = headers.get("x-ratelimit-complexity-remaining"); if (reqRemaining) this.remaining.requests = parseInt(reqRemaining); if (cxRemaining) this.remaining.complexity = parseInt(cxRemaining); } isLow(): boolean { return this.remaining.requests < 100 || this.remaining.complexity < 5000; } getStatus() { return { requests: this.remaining.requests, complexity: this.remaining.complexity, healthy: !this.isLow(), }; } }
| Error | Cause | Solution | |-------|-------|----------| | HTTP 429 | Request or complexity budget exceeded | Parse headers, back off exponentially | | Query complexity too high | Single query > 10,000 pts | Reduce first to 50, remove nested relations | | Burst of 429s on startup | Init fetches too much data | Stagger startup queries, cache static data | | Timeout on SDK call | Server under load | Add 30s timeout, retry once |
bashcurl -s -I -X POST https://api.linear.app/graphql \ -H "Authorization: $LINEAR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "{ viewer { id } }"}' 2>&1 | grep -i ratelimit
typescriptconst rlClient = new RateLimitedClient(process.env.LINEAR_API_KEY!); const items = [/* issues to import */]; for (let i = 0; i < items.length; i++) { await rlClient.withRetry(() => rlClient.sdk.createIssue({ teamId: "team-uuid", title: items[i].title }) ); if ((i + 1) % 50 === 0) console.log(`Imported ${i + 1}/${items.length}`); }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | fail→pass | 23,562 | 23,272 | -1% | 1 | 1 | 0% | 3,208 | 5,925 | +85% | 0 | 0 | — |
case-01 | fail→fail | 29,453 | 22,951 | -22% | 1 | 1 | 0% | 4,573 | 6,129 | +34% | 0 | 0 | — |
case-02 | fail→fail | 25,086 | 20,416 | -19% | 1 | 1 | 0% | 4,056 | 5,646 | +39% | 0 | 0 | — |
case-03 | fail→pass | 23,090 | 22,486 | -3% | 1 | 1 | 0% | 3,808 | 6,176 | +62% | 0 | 0 | — |
case-04 | fail→pass | 23,405 | 11,466 | -51% | 1 | 1 | 0% | 3,640 | 3,680 | +1% | 0 | 0 | — |
case-05 | pass→pass | 22,021 | 17,439 | -21% | 1 | 1 | 0% | 3,131 | 4,604 | +47% | 0 | 0 | — |
case-06 | fail→pass | 23,120 | 18,765 | -19% | 1 | 1 | 0% | 3,057 | 4,845 | +58% | 0 | 0 | — |
case-07 | fail→pass | 26,271 | 6,709 | -74% | 1 | 1 | 0% | 816 | 2,637 | +223% | 0 | 0 | — |
case-08 | fail→pass | 22,462 | 7,629 | -66% | 1 | 1 | 0% | 3,115 | 2,687 | -14% | 0 | 0 | — |
case-10 | fail→pass | 21,168 | 17,855 | -16% | 1 | 1 | 0% | 3,166 | 4,347 | +37% | 0 | 0 | — |
case-11 | pass→pass | 19,608 | 21,958 | +12% | 1 | 1 | 0% | 2,622 | 5,059 | +93% | 0 | 0 | — |
case-12 | fail→pass | 15,169 | 18,966 | +25% | 1 | 1 | 0% | 2,103 | 4,268 | +103% | 0 | 0 | — |
case-13 | fail→pass | 16,885 | 10,796 | -36% | 1 | 1 | 0% | 1,511 | 3,326 | +120% | 0 | 0 | — |
case-14 | fail→fail | 15,452 | 13,200 | -15% | 1 | 1 | 0% | 2,899 | 4,360 | +50% | 0 | 0 | — |
case-15 | fail→fail | 24,907 | 23,609 | -5% | 1 | 1 | 0% | 2,899 | 5,417 | +87% | 0 | 0 | — |
case-16 | pass→pass | 12,757 | 5,879 | -54% | 1 | 1 | 0% | 1,233 | 3,484 | +183% | 0 | 0 | — |
case-17 | fail→pass | 8,817 | 8,337 | -5% | 1 | 1 | 0% | 1,672 | 2,733 | +63% | 0 | 0 | — |
case-18 | fail→pass | 10,419 | 12,110 | +16% | 1 | 1 | 0% | 1,564 | 3,375 | +116% | 0 | 0 | — |
case-19 | fail→pass | 23,644 | 12,230 | -48% | 1 | 1 | 0% | 3,916 | 4,462 | +14% | 0 | 0 | — |
case-20 | pass→pass | 10,610 | 16,527 | +56% | 1 | 1 | 0% | 2,161 | 4,634 | +114% | 0 | 0 | — |
case-21 | pass→pass | 21,227 | 18,967 | -11% | 1 | 1 | 0% | 3,266 | 5,300 | +62% | 0 | 0 | — |
case-22 | pass→pass | 15,330 | 12,810 | -16% | 1 | 1 | 0% | 1,928 | 3,917 | +103% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.