Estimate the dollar cost of every LLM prompt in your codebase before shipping.
Find duplicate or near-duplicate prompts scattered across your project.
Run in CI to comment on a pull request with prompt cost and diff changes.
Spot prompt constants and context blocks nothing references anymore.
| joandino/promptscan | 0xkinno/astraea | 0xkinno/halcyon | |
|---|---|---|---|
| Stars | 0 | 0 | 0 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | hard | hard |
| Complexity | 2/5 | 4/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Node 18 or newer, supports Python, TypeScript, and JavaScript codebases.
PromptScan is a command line tool that scans your codebase to find every place your code calls a large language model API, and reports how many tokens each prompt uses and roughly how much it costs in dollars. Along the way it flags prompts that are duplicated across your code, prompt text stored in a constant that nothing in the code actually uses anymore, and prompts that have quietly grown very large. It works through static analysis, reading your source files rather than running your program or calling any API, so there is no key to configure and nothing gets sent anywhere. Because it only reads code, if a prompt is built at runtime from a database value or a request parameter, PromptScan marks that call as unresolved instead of guessing what the text might be. It understands Python, TypeScript, and JavaScript code, and recognizes calls made through the OpenAI, Anthropic, and LangChain libraries, as well as the litellm router library in Python and the Vercel AI SDK in TypeScript, tracing model and provider names back through variables, constructor calls, and imports across files. It requires Node 18 or newer to run. Unlike tools such as LangSmith, Langfuse, or Helicone, which watch your calls after they run in production, PromptScan looks at the code itself, so it can catch a cost problem before anything ships and costs nothing to run since there is no live API traffic involved. You install it globally with npm, or run it without installing using npx. The basic command scans a folder and prints a summary table of call sites, token counts, and estimated cost, with options to output full JSON, add a projected monthly bill based on your own usage numbers, or compare the prompts changed between two git commits. Output columns mark whether a number is an exact count, an approximation, or only partially resolved. There is also a free browser based version where you can paste a code snippet and see its cost estimate without installing anything.
PromptScan is a command-line tool that statically scans your codebase for LLM API calls and reports each prompt's token count, dollar cost, duplicates, and dead code.
Mainly TypeScript. The stack also includes Node.js, TypeScript, tree-sitter.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.