<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz" -->

---
title: The Most Expensive Way to Find an Unused Import | daily.dev
description: Using a language model in CI to find unused imports is slower, costlier and less reliable than ESLint, the author argues. Claude Sonnet 5.5 costs $2 per...
canonical: https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Most Expensive Way to Find an Unused Import | daily.dev
og:description: Using a language model in CI to find unused imports is slower, costlier and less reliable than ESLint, the author argues. Claude Sonnet 5.5 costs $2 per...
og:url: https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz
og:image: https://api.daily.dev/og/posts/4SjemJ5Cz.png
og:image:alt: The Most Expensive Way to Find an Unused Import
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Most Expensive Way to Find an Unused Import

**[TypeScript.TV](https://daily.dev/sources/typescripttv)** · 8 min read · 0 upvotes · 0 comments

## Summary

Using a language model in CI to find unused imports is slower, costlier and less reliable than ESLint, the author argues. Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens, and because the API is stateless, an agentic review can pass half a million cumulative tokens per run, roughly a dollar each. At 390 runs a month that's a few hundred dollars for something ESLint does free in milliseconds. Agentic checks are also nondeterministic, vulnerable to prompt injection from untrusted PR content, and return prose instead of a machine-readable format. The fix: use the compiler, ESLint and Knip for anything countable, and save models for judgment calls like reviewing README accuracy.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://typescript.tv/best-practices/the-most-expensive-way-to-find-an-unused-import>

## Questions this post answers

### How much does it cost to run Claude Sonnet 5.5 in an agentic CI review loop?

Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens. Because the API is stateless, every turn resends the whole conversation, so a review opening a few dozen files and looping a dozen times can pass half a million cumulative input tokens, putting a single run at roughly a dollar. At 390 runs a month that's a few hundred dollars for a check a linter does free.

_Weighing AI agents against linters for CI costs? Track real pricing and trade-off breakdowns on daily.dev._

### Why is prompt injection a security risk when running an LLM agent on pull request content in CI?

When a workflow runs on pull_request, the reviewed content comes from whoever opened the pull request, and the model receives that content in the same context window as its instructions with no reliable way to separate the two. A contributor can embed text that looks like a stale comment to a human but is read as an instruction by the model. If the step has Bash access, a GITHUB_TOKEN, and comment permissions, this hands an attacker-controlled string to a privileged process; mitigations include limiting permissions to contents: read, avoiding pull_request_target on secret-touching workflows, and passing an explicit tool allowlist.

_Securing CI pipelines that call AI agents on untrusted diffs is easier with guidance like this on daily.dev._

### What TypeScript compiler error code is reported for an unused import?

An unused import is reported as TS6133 by the TypeScript compiler, a stable diagnostic code that stays the same across versions. Unlike a model's prose reply, this exit code and identifier can be counted, filtered, or looked up reliably, which is why deterministic tools like tsc, ESLint, and Knip are recommended over LLM-based review for this kind of check.

_Developers debugging TypeScript diagnostics can keep rule and error codes like this handy via daily.dev._

## Similar posts on daily.dev

- [AI Agent Token Costs: How to Cut Your Bill by 60-80%](https://daily.dev/posts/ai-agent-token-costs-how-to-cut-your-bill-by-60-80--nglqddiuw) · Alex CloudStar · 1 upvotes · 0 comments
- [Stop burning tokens on code review](https://daily.dev/posts/stop-burning-tokens-on-code-review-kxrtlop02) · swizec.com · 148 upvotes · 16 comments
- [I cancelled my $20 Claude subscription for Anthropic's cheapest model at API rates, and it cost me less than half](https://daily.dev/posts/i-cancelled-my-20-claude-subscription-for-anthropic-s-cheapest-model-at-api-rates-and-it-cost-me-l-b4kbrqbi0) · XDA Developers · 1 upvotes · 0 comments
- [The true cost of saying "Hi" to an AI agent](https://daily.dev/posts/the-true-cost-of-saying-hi-to-an-ai-agent-7f8awuhpa) · Quesma · 2 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#ai-agents](https://daily.dev/tags/ai-agents), [#cicd](https://daily.dev/tags/cicd), [#github-actions](https://daily.dev/tags/github-actions), [#prompt-injection](https://daily.dev/tags/prompt-injection)

[View this post on daily.dev](https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Most Expensive Way to Find an Unused Import","url":"https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz"},"datePublished":"2026-10-31T10:29:07.513Z","dateModified":"2026-10-31T10:29:37.166Z","description":"Using a language model in CI to find unused imports is slower, costlier and less reliable than ESLint, the author argues. Claude Sonnet 5.5 costs $2 per...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d1ff741a5da598a598f74ba1415cf72e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d1ff741a5da598a598f74ba1415cf72e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"TypeScript.TV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"TypeScript.TV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/57ce30b9764a474caf60a5b81549c1b3","url":"https://daily.dev/sources/typescripttv"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,ai-agents,cicd,github-actions,prompt-injection","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"TypeScript.TV","item":"https://daily.dev/sources/typescripttv"},{"@type":"ListItem","position":3,"name":"The Most Expensive Way to Find an Unused Import"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-most-expensive-way-to-find-an-unused-import-4sjemj5cz#faq","mainEntity":[{"@type":"Question","name":"How much does it cost to run Claude Sonnet 5.5 in an agentic CI review loop?","acceptedAnswer":{"@type":"Answer","text":"Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens. Because the API is stateless, every turn resends the whole conversation, so a review opening a few dozen files and looping a dozen times can pass half a million cumulative input tokens, putting a single run at roughly a dollar. At 390 runs a month that's a few hundred dollars for a check a linter does free. Weighing AI agents against linters for CI costs? Track real pricing and trade-off breakdowns on daily.dev."}},{"@type":"Question","name":"Why is prompt injection a security risk when running an LLM agent on pull request content in CI?","acceptedAnswer":{"@type":"Answer","text":"When a workflow runs on pull_request, the reviewed content comes from whoever opened the pull request, and the model receives that content in the same context window as its instructions with no reliable way to separate the two. A contributor can embed text that looks like a stale comment to a human but is read as an instruction by the model. If the step has Bash access, a GITHUB_TOKEN, and comment permissions, this hands an attacker-controlled string to a privileged process; mitigations include limiting permissions to contents: read, avoiding pull_request_target on secret-touching workflows, and passing an explicit tool allowlist. Securing CI pipelines that call AI agents on untrusted diffs is easier with guidance like this on daily.dev."}},{"@type":"Question","name":"What TypeScript compiler error code is reported for an unused import?","acceptedAnswer":{"@type":"Answer","text":"An unused import is reported as TS6133 by the TypeScript compiler, a stable diagnostic code that stays the same across versions. Unlike a model's prose reply, this exit code and identifier can be counted, filtered, or looked up reliably, which is why deterministic tools like tsc, ESLint, and Knip are recommended over LLM-based review for this kind of check. Developers debugging TypeScript diagnostics can keep rule and error codes like this handy via daily.dev."}}]}
```

