Docs
IntentiAI is one command. npx intentiai reviews everything you have not pushed yet, including the AI calls in it, and says, in plain words, what it might break and what to do before you deploy. It adds an AI review by your own coding agent when one is installed. npx intentiai audit checks every AI call in the whole repository for patterns that run up the bill or break.
Install
Nothing to install. Run it with npx from the root of any repository:
npx intentiaiIt needs Node 20 or later and a free account: the first run in a terminal asks you to sign in, then carries on. Python 3 is optional: with it, Python files are read with a real parser; without it, they are read line by line and a few rules see less. No API key is needed. The fixed checks run without a model; the AI review uses the coding agent you already have.
Review your change
npx intentiai
npx intentiai --base mainBy default it reads everything not yet pushed, committed or not: the commits your remote does not have yet (compared with your upstream branch, else the remote’s default branch), plus staged, unstaged and new files. With no remote, it reviews what changed since your last commit. It runs 21 fixed checks for the mistakes coding agents make after their own tests pass, plus the cost rules on every AI call the change adds or edits, then hands the result to your AI review. Issues are sorted by urgency (Fix now, Fix soon, Good to know), and each says in plain words what could happen to your app and how to fix it, with a fix prompt you can paste into your agent.
intentiai check is the same command under its older name. It keeps working, and the git and Claude Code hooks use it.
It also builds a “Before you push” list of what the change needs outside the code: migrations to run, rows the code now looks up, environment variables to set, webhooks and sign-in providers to register, jobs and buckets your host must know about. Each item says where to do it. When the repository shows where the app is hosted (vercel.json or .vercel/, netlify.toml, fly.toml, render.yaml, railway.json or railway.toml), a setting names that host’s page, for example “Add STRIPE_WEBHOOK_SECRET in Vercel: Project → Settings → Environment Variables (Production and Preview)”. Keys from Anthropic, OpenAI and Stripe also say where to get them. The list never repeats an issue; the terminal shows up to five items and the report has the rest.
The report also has a section each for what changed in the database (migrations in the order they run, tables and fields added or removed), in deploy and config (settings, CI and infrastructure files, packages, jobs), and in AI settings (each AI call’s provider, model, limits and price per call, before and after).
It writes the full report to .intentiai/report.html and prints a plain summary. Add --details for the technical view. The result is also uploaded to your account, without any lines of your code (see Projects and history). In a folder that is not a git repository, or when nothing has changed, it runs the whole-repo audit instead.
Modes
npx intentiai --fast
npx intentiai
npx intentiai --thorough
npx intentiai newPick how deep it looks. Normal is the default. --fast takes seconds and is what the pre-push hook runs. --thorough (or --slow) takes longer and also runs your own tests.
Fast --fast | Normal | Thorough --thorough | New feature new | |
|---|---|---|---|---|
| Time limit for the whole run | 1 min | 6 min | 15 min | 20 min |
| Built-in checks and cost rules on the change | Yes | Yes | Yes | Yes |
| Where this change lands (app map before and after) | No | Yes | Yes | Yes |
| AI review by your agent | No | One pass | Two passes: the change, then existing code it can break | Three passes: adds a feature review |
| Every AI call in the repository audited for cost | No | No | Yes | Yes |
| Your project's test, typecheck and lint commands | No | No | Yes | Yes |
| Builds your app once and records page sizes | No | No | When it fits in the time left | When it fits in the time left |
| Suggestions as prompts for your agent | No | No | No | Yes |
Every mode has a hard time limit, shown in the first row. It is the same number --help prints and the report shows. Each step gets what is left of that time. A step that would not fit is skipped, and the report lists what was skipped and why. The terminal and the report end with a line such as “Took 3 min 58 s of its 20 min limit”.
In thorough mode the second AI pass reads the existing code your change can break, such as the callers of a function you changed, and every AI call in the repository is checked for cost, not just the ones in the change.
Thorough and new mode also run your project’s own test, typecheck and lint commands, at the same time as the AI review. Each command is printed before it runs and has a time limit. --no-run skips them. A command that fails makes the run exit with 1. Their output stays on your computer, in the local report; the upload holds only the command, whether it passed, how long it took, and counts such as “142 passed, 2 failed”.
Thorough and new mode also build your app once, when the build fits in the time left. They record the size of each page: the JavaScript each visitor downloads for it. The next run compares against these sizes. When the build would not fit in the time left, it is skipped and the report says why. When the build ran and passed and the tests ran and passed, the report shows a “Built and tested” badge.
--no-agent skips the AI review in any mode.
New-feature mode
npx intentiai new --task "team invites by email"Use intentiai new when the change adds a feature. It does everything thorough mode does, then asks your agent for a feature review: does the new code fit the way the rest of the codebase works, does it repeat something that already exists, is the database design sound (keys, indexes for the new queries, empty values, whether the change can be undone, who can read each row), and is there a better way to build it.
The answers come back as suggestions, grouped by kind, each with why it matters, where it applies, and a prompt written for your agent, with a button to copy it. Paste the prompt into Claude Code, Codex or Gemini CLI to make the change. --task says what the feature is meant to do.
Flags
--fast | Built-in checks and cost rules only, in seconds. See Modes. |
--thorough, --slow | A second AI pass, every AI call in the repository, your own test, typecheck and lint commands, and one build of your app when it fits in the time left. |
--no-run | In thorough and new mode, do not run your project’s commands. |
--staged | Only what is staged for the next commit. |
--base <ref> | Compare against a branch or commit instead, for example the branch you will open a PR into. --base HEAD reviews uncommitted work only. |
--local | Upload nothing for this run. The report is still written on your computer. |
--private | Replace every name from your project with a made-up one before upload. See Private mode. |
--json | Print findings as JSON. |
--details | Also show the technical detail: severity, rule, file and line. |
--no-report | Skip writing the HTML report. |
--out <path> | Write the HTML report somewhere else. |
--open | Open the HTML report in your browser when the run finishes. |
--agent [name] | Which installed coding agent reviews it: claude, codex, gemini, or auto. On by default in a terminal. See below. |
--no-agent | Skip the AI review: the fixed checks alone, in seconds. |
--model <m> | The model the agent pass uses. |
--task "…" | What you asked the agent to do. Its claims are checked against the change. |
--hook claude | Run as a Claude Code Stop hook. Set up for you by intentiai init claude. |
What the review looks for
test-integrity | Tests deleted, skipped, narrowed with .only, stripped of assertions, loosened in place, or propped up with a sleep; coverage gates lowered. |
migration-safety | Schema changes that lock or rewrite a table, or drop something the running app still reads. |
destructive-ops | Recursive deletes, dropped databases, truncates, unfiltered bulk deletes, force pushes. |
auth-surface | A new endpoint with no visible auth, or a webhook that does not check the sender's signature. |
removed-guard | A validation, permission or rate-limit call deleted without a replacement. |
secrets | Credentials committed in the change. Masked in every output. |
injection-sink | Untrusted data reaching SQL, HTML, a shell, eval or an outbound URL. |
workflow-prompt-injection | Issue or PR text interpolated into a CI script or an AI action. |
env-drift | New settings the change needs (a Before you push item), or one it removed while code still reads it. |
dependency-risk | An import with no matching installed package, the offline sign of a hallucinated dependency. |
dependency-bump | A dependency moved across a breaking version boundary. |
breaking-export | A public function or export removed or re-signed while other code still calls it. |
ops-deltas | Schedules run more often, retries added without backoff, timeouts raised, CI concurrency that does nothing. |
io-in-loop | A database, HTTP or model call made once per loop iteration. |
unawaited-async | An async call whose result, and whose failure, is dropped. |
resource-leak | A file, socket, cursor or interval opened and never released. |
swallowed-errors | An empty catch, except or rescue; an error assigned to _ in Go. |
suppressed-diagnostics | Type or lint errors silenced without a stated reason. |
unfinished-work | TODOs, stubs and placeholder values left in the change. |
debug-leftovers | Debugger statements and stray debug prints in application code. |
scope-creep | CI, infrastructure or generated files touched, or a change too large to review. |
Whole-repo AI audit
npx intentiai audit [path]npx intentiai checks the AI calls in your change. npx intentiai audit checks every AI call in the repository, whether you changed it or not. Thorough and new mode run it as part of the review.
It finds every call to a model provider (through the official SDKs, LangChain, LiteLLM, the Vercel AI SDK, Spring AI, LangChain4j, LangChainGo, or plain HTTP to a provider endpoint) and checks it against the rules below. How deep it goes depends on the language:
| Language | What runs |
|---|---|
| TypeScript, JavaScript, Python | Every call site and all 22 rules, with a real parser. |
| Go, Java, Ruby, PHP | Every call site, and the rules that need no deeper analysis, such as missing caps, oversized models, no budget guard, unprotected endpoints, scheduled jobs, vision calls in loops, batchable work and committed keys. |
| Everything else | Counted and named as not scanned, so a quiet result is never mistaken for a clean one. |
It prints a short summary and uploads the findings to your account, in the same project as your reviews. The upload is findings (rule, file, line, summary, fix and the model names it saw) and the AI review’s written notes. It holds no files and no lines of your code; an issue’s text may name a function, a file or a setting. See Privacy for the exact fields.
Every dollar figure is an estimate with its assumptions stated next to it: the model it assumed, the calls per month, the token counts. A problem with no ceiling, such as an address anyone can call, never gets a monthly figure: the report says “No ceiling” and gives the cost per request. Monthly figures are only for savings on work your app does anyway. When the model cannot be priced, the report says so once and shows no dollar figures.
Cost figures are estimates at a traffic you set, in requests per day: 1,000 unless you change it. Every money figure in the report has an (i) that says: “Estimate. Your real bill can differ: it depends on your traffic, your plan and your provider’s prices.” Your project page has settings for requests per day, a monthly AI budget and your host plan.
Audit flags
--local | Audit and print locally. Nothing is uploaded. |
--private | Replace every name from your project with a made-up one before upload. |
--json | Print the full audit as JSON instead of the summary, for scripts and CI (metadata only). |
--details | Also print each fix as a prompt to paste into your AI tool, plus the technical view: rules, files and lines, and the AI review’s answer for every AI call. |
--agent [name] | Which installed coding agent reviews the audit: claude, codex, gemini, or auto. On by default in a terminal. |
--no-agent | Rules only: skip the AI review. |
--model <m> | The model the AI review uses. |
What the audit looks for
Most rules cite the published study or incident behind them, linked from the finding in the report. Each has its own page under cost rules. The same rules run on the AI calls in every change you review.
no-budget-guard | No dollar or token cap anywhere on the path to a paid call. |
guard-conditional-on-env | A spending or abuse guard that only exists when certain env vars are set. |
no-max-tokens | A call with no output cap on a model where long answers are expensive. |
model-deprecated | A call names a model its provider lists as retired, or retiring within 90 days. |
model-oversized | A frontier model doing a short, simple job where a cheaper sibling is likely enough. |
agent-loop-unbounded | An agent or tool loop with no iteration limit. |
retry-storm | Retries on a paid call with no cap, no backoff, or both. |
orphaned-async-job | A billable job polled with no deadline and no way to cancel it. |
full-history-resend | The whole conversation re-sent on every turn, so cost grows with its square. |
recurring-job-llm | A scheduled job that calls a model whether or not anyone is using the app. |
vision-in-loop-uncapped | Image or vision calls inside a loop with no limit on how many. |
reasoning-budget-in-loop | A high reasoning budget on a call that runs many times. |
auxiliary-call-multiplication | Extra model calls (moderation, titles, summaries) multiplying every request. |
cache-storage-leak | Provider-side caches created and never deleted, billed by the hour. |
cache-write-churn | Prompt caching on text that changes every call, so you pay to write and never read. |
result-cache-candidate | The same deterministic call paid for again on every duplicate request. |
sync-batch-candidate | Bulk work sent one call at a time where a batch API costs half. |
sticky-fallback-model | A fallback to a pricier model that never switches back. |
unvalidated-input-to-paid-call | Request fields reaching a paid call with no validation. |
unauthenticated-llm-endpoint | An endpoint anyone can call that spends your model budget. |
client-side-key-exposure | A provider key shipped to the browser. |
hardcoded-api-key | A provider key committed in source. The key is masked in every report. |
The AI review
npx intentiai --task "add Stripe webhooks"When a coding agent is installed and signed in (Claude Code, Codex or Gemini CLI), IntentiAI hands its results to it in read-only mode, by default, whenever you run it in a terminal (in every mode except fast). On a subscription this costs nothing extra; with an API key it uses your API credits, and the report shows that cost. It does not run in CI, in hooks or with --json. --agent claude (or codex, gemini) picks which one; --no-agent skips it. When a mode asks for more than one pass, they run one after another.
For the AI calls, the agent answers for each one: what triggers it, who can trigger it, which model it really uses, and what limits it. It confirms or disputes each finding and adds problems and call sites the scan missed. For the change, it also adds to the “Before you push” list.
The agent is allowed to do these things, and only these:
- answer each of your checks: passed, failed or not applicable, with a reason;
- summarize the change and each file in plain English;
- compare what it was asked to do (your
--task) against what the code actually does; - confirm a finding, or rule one out with a stated reason; ruled-out findings stay visible in the report;
- list what to check before and after you deploy;
- report defects of its own (up to five in normal mode, twelve per pass in thorough and new), each with a file, a line and the exact line quoted. One is kept only if that line exists within three lines of where the agent says (in a changed file, or in existing code the change relies on, such as a sign-in helper that accepts any token), and it does not repeat a fixed finding. They appear in their own “Found by your Claude Code” section, which says: “Your Claude Code spotted these itself. IntentiAI confirmed the code it points to exists; whether it is a real problem is the agent’s judgment.”
- in new mode, write suggestions for the feature, each with a prompt to paste back into the same agent.
This is what catches the mistakes no pattern can: a limit applied to the wrong kind of account, a header replaced instead of merged. It cannot change the urgency of a built-in finding, so a problem has the same label with or without it. Its own findings can be marked Fix now when they show the change is not safe yet, but they never count toward the exit code, so an AI judgment alone never blocks a push. If it fails or times out, you get the fixed result unchanged. The change it reads goes to that agent’s provider under your own account’s terms, not to IntentiAI.
Your checks
npx intentiai remember "Every new API route checks the user's plan before doing any work"Teach IntentiAI what matters in your project. Put one plain-language check per line in .intentiai/checks.md in your repository, or run intentiai remember "…" to add one (it creates the file if needed). Commit the file so everyone on the project, and every agent, uses the same list.
# .intentiai/checks.md
- Every new API route checks the user's plan before doing any work
- Never call the OpenAI API from a page component
- Emails to customers go through lib/email.tsOn every run, your coding agent checks each one against the change and reports it as passed, failed or not applicable, with a one-line reason. A failed check comes with the file and the line it quotes, verified like every other finding. When it points at the same code as an issue already on the list, it is not shown twice: that issue gets the tag “Also breaks your check: …”, and the check is listed as failed with “See:” and the issue’s title. Otherwise it gets its own issue. Without an installed agent, or in fast mode, the list is shown as not checked, never silently skipped.
App map
npx intentiai mapintentiai map reads the code of your project and draws what your app is made of: who uses it, its pages, the addresses its server answers, its tables and their fields, the outside services and AI models it uses, its settings and its background jobs, and how they connect. It writes .intentiai/app-map.html, one file that opens offline, and prints a short summary such as “Your app: 12 pages · 9 server addresses · 6 tables · Stripe, OpenAI”. Add --open to open it, --out <path> to write it elsewhere, or --json for the data.
It reads what the code proves, and only that. Pages and server addresses come from your framework’s files and route calls (Next.js, Express, Fastify, Hono, FastAPI, Flask, Django, React Router), tables from Prisma, Drizzle, SQL migrations and Supabase or ORM calls, outside services from the packages and addresses your code calls, settings from the names your code reads. Every connection carries the file and line it was read from. A solid line was seen in the code itself or one import away; a dashed line is two imports away, so probably connected but not certain. Anything it could not tell is listed under “What we could not tell” instead of being guessed.
Every review except --fast shows the same map with your change on it, under “Where this change lands”, and says it in one line in the terminal: “This change touches: the checkout page, the orders table, Stripe”. A part is Changed when its own code or definition changed, or when its code uses shared code that changed (a helper or a component it imports). It is Might be affected when it is one connection away from a part that changed, or when its code uses shared code that changed two imports away: worth a look, not proof of a problem. When a coding agent reviews the change, it may add one plain sentence per part the change touches, marked “From your Claude Code”, and its own findings sit on the parts they are in. It can never add a part or a connection.
The map holds names only: the names of pages, addresses, tables and their fields, settings, services and jobs, with file paths and line numbers. Never code, never the values of your settings. The map file stays on your computer; the part of the map a change touches is uploaded with that review, as names only (made-up names in private mode).
Sign in
npx intentiai loginEvery command that reads your code needs a free account. login shows a short code and opens a page where you confirm it; you do this once per computer. If you run a command in a terminal without signing in, it explains why in two lines, starts the same sign-in, then carries on.
In a git hook, in CI or with piped output, a computer that is not signed in still runs the full review, uploads nothing, and prints one line on how to sign in. It never waits for you, so a hook never blocks on it. In CI, set the INTENTIAI_TOKEN environment variable to upload to your account; it takes precedence over a computer’s own sign-in.
npx intentiai whoami shows which account a computer uses, npx intentiai logout disconnects it, and your Account page lists every connected computer with a button to revoke it.
Projects and history
Every run uploads its result to your account, grouped by project, so you can see how each repository changes over time on your projects. A project is one repository, recognised by its git remote (or, with no remote, by its folder), and named after its folder. You can rename it.
The upload holds names, file paths, line numbers, plain sentences and counts. It never holds lines of your code (the quoted evidence stays in the local report), the output of your project’s commands, the values of your settings, whole files, the diff or your git history. Privacy lists every field.
--localuploads nothing for that run.- The Claude Code Stop hook never uploads.
- If an upload fails, nothing else changes: the exit code is the same and the local report is still written.
- You can delete one run, a whole project with every run in it, or your account and everything in it.
Private mode
npx intentiai --private
npx intentiai private on
npx intentiai private off--private works for one run; intentiai private on keeps it on for every run in this project until you turn it off. Before upload, every name that belongs to your project is replaced by a made-up one that stays the same from run to run, such as table_3f2a9c1d or file_8b01c2aa.ts: file paths, tables and columns, setting names, routes, functions, jobs, private server addresses and the project name, including where they appear inside sentences.
The key that makes the names is kept only in ~/.intentiai/config.json on your computer. .intentiai/private-names.json in your repository (ignored by git) maps each made-up name back to the real one. Public names stay as they are: npm and PyPI package names, AI model names, provider names, and well-known service addresses.
Run it automatically
A check you have to remember to run is a check that gets skipped. Three ways to make it happen on its own:
When Claude Code finishes a task
npx intentiai init claudeThis adds a Stop hook to .claude/settings.json in your project (add --user for every project). When Claude Code says it is done, IntentiAI reviews the change, including commits it made but has not pushed. If there are critical or high findings, they go back to Claude with their fixes, and it gets one round to fix them or explain why each is intended before it stops. It never loops, it never uploads, and if the review itself fails, Claude stops normally. To undo it, remove the intentiai entry under hooks.Stop in that file.
When Codex finishes a task
npx intentiai init codexCodex has no hook that can stop it from finishing, so this adds a short section to AGENTS.md asking it to run the review and fix every issue marked Fix now. It is an instruction Codex reads, not something enforced.
Before every push
npx intentiai install-hookInstalls a git pre-push hook that runs the fast review on everything you are about to push, against the branch you push to. A built-in Fix now issue stops the push; git push --no-verify skips it once. It will not replace a hook you already have unless you add --force.
Exit codes and CI
npx intentiai(andintentiai check,intentiai new) exits1when a built-in check marks something Fix now, or, in thorough and new mode, when one of your project’s commands fails. It exits0otherwise, and2on a usage error, so it can gate a pre-push hook or a CI job. Findings from the AI review never change the exit code.intentiai auditexits0after a successful scan whatever it finds; use--jsonand your own threshold if you want it to gate.- In CI the AI review does not run. Set
INTENTIAI_TOKENto upload the result to your account; without it, the run still completes and uploads nothing.
# in CI, on a pull request
npx intentiai --fast --base origin/main --no-report
# whole-repo AI audit in CI
npx intentiai auditTroubleshooting
It asks me to sign in
Every command that reads your code needs an account. Follow the code it shows, or run npx intentiai login first. In CI, set INTENTIAI_TOKEN.
The sign-in email link does not work
Open it in the same browser you requested it from; the link is tied to that browser. Each link works once.
An old claim link says it has expired
Older versions uploaded without an account and printed a claim link. Unclaimed cost reports are deleted after seven days, and shared Ship Checks after two. Sign in and run the command again; the result goes straight to your account.
“Not scanned: N Kotlin files”
The audit reads TypeScript, JavaScript, Python, Go, Java, Ruby and PHP. Other languages are listed so you know what was not checked. Kotlin, C# and Rust are next: they are measured already but do not yet find enough of the calls to ship.
“This change is too large to review as one change”
The diff is over 64 MB. Point --base at a nearer commit, or review the change in parts.
Something else, or a wrong finding
Open an issue on GitHub with the command you ran and what it printed, or email happynishan30@gmail.com.