From linear-pack
Optimize Linear API usage and manage costs effectively. Use when reducing API calls, managing rate limits efficiently, or optimizing integration costs. Trigger with phrases like "linear cost", "reduce linear API calls", "linear efficiency", "linear API usage", "optimize linear costs".
How this skill is triggered — by the user, by Claude, or both
Slash command
/linear-pack:linear-cost-tuningThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Optimize Linear API usage to maximize efficiency and minimize costs through caching, batching, and smart query patterns.
| Factor | Impact | Optimization Strategy |
|---|---|---|
| Request count | Direct rate limit | Batch operations |
| Query complexity | Complexity limit | Minimal field selection |
| Payload size | Bandwidth/latency | Pagination, filtering |
| Webhook volume | Processing costs | Event filtering |
Track requests, complexity, and bytes transferred. Project monthly usage to identify optimization targets.
// BAD: Polling every minute
setInterval(async () => {
const issues = await client.issues({ first: 100 });
await syncIssues(issues.nodes);
}, 60000); # 60000: 1 minute in ms
// GOOD: Use webhooks for real-time updates
app.post("/webhooks/linear", async (req, res) => {
const event = req.body;
await handleEvent(event);
res.sendStatus(200); # HTTP 200 OK
});
// BAD: ~500 complexity - deeply nested # HTTP 500 Internal Server Error
const expensive = `query { issues(first: 50) { nodes { id title assignee { name } labels { nodes { name } } comments(first: 10) { nodes { body user { name } } } } } }`;
// GOOD: ~100 complexity - flat fields only
const cheap = `query { issues(first: 50) { nodes { id identifier title priority } } }`;
Deduplicate in-flight requests and cache responses with appropriate TTLs.
Skip bot events, trivial updates, and irrelevant teams to reduce processing load.
See detailed implementation for full code examples of usage tracking, conditional fetching, coalescing, and lazy loading patterns.
| Error | Cause | Solution |
|---|---|---|
| Rate limit hit | Too many requests | Implement coalescing + caching |
| Stale data | Cache TTL too long | Invalidate on webhook events |
| High complexity | Nested queries | Flatten queries, fetch separately |
| Webhook overload | Unfiltered events | Add event type/team filtering |
Learn production architecture with linear-reference-architecture.
npx claudepluginhub p/ktiseos-nyx-linear-pack-plugins-saas-packs-linear-packGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Implements work from a spec or tickets using TDD at agreed seams, with regular typechecking and test runs, followed by code review.