How to Run an AI Agent Code Review with Flint
An AI agent code review goes wrong in a boring, predictable way: the agent starts editing files instead of reporting what it found. The cause is one setting, the care level, and it is chosen before you type the first request.
Short answer: At care level safe, Flint reads your code, reports what it finds, and changes nothing without your confirmation. Start a session, set the care level to safe, tell Flint which files or directory to look at and what kind of issues to find, and it writes its findings in the terminal. Review depth depends on which model you have configured, not on Flint itself.
What you need before you start
Three things have to be in place before step one: Node.js 22.12 or newer, Flint itself, and a model provider account with an API key. Install Flint with npm install -g flint-agent, then run flint. If it is already installed, flint --update brings it to the newest version and exits. No Python, no Docker, no background service.
OpenRouter is the default provider, and its free models are enough for a first review, though they are slower and less capable than a paid frontier model. Inside Flint, /model free lists the free models that can call tools, with speed and uptime from OpenRouter's public stats. The first run is short: pick a provider, enter an API key, choose how careful Flint should be.
One thing to settle before you start is which provider sees the code. Flint runs on your machine and has no server of ours in the path, but unless the model is a local one, the files and text it sends go to the provider you chose, under that provider's terms. A local model through Ollama keeps the code on the machine, as long as no MCP server in that session reaches the network.
Steps
- Install and start. Run
npm install -g flint-agent, thenflint. The first run asks for a provider, an API key and a care level. Finish that setup first, because the level you pick there is the one the review will run under. - Set the care level. Run
/carefuland choose safe. At safe, Flint asks before every file change and before every command, so it reads and reports and writes nothing you have not confirmed. - State the task. Say in plain language which files, directory or pattern to look at and what to find: security issues, style problems, logic errors, whatever this review is for. A directory and a question is enough.
- Let Flint read. Flint works through the code with its read and search tools, then writes its findings in the terminal. The receipt at the end of the turn lists the tools used, the files changed, the tokens in and out, the time and the cost.
- Move it to CI when you want it unattended.
flint --headless --task "review src/ for security issues" --budget 0.50runs the task with nobody watching, prints JSON with the response, the cost and the tokens, and exits. The exit code tells the calling script whether the task ran to its end, got nowhere, or was cut by a limit.
Care level and file safety
Normal care lets Flint edit files and run ordinary commands without asking. Permissive asks even less. Neither is what you want when the goal is a report, and switching levels later with /careful is easy but easy to forget.
Warning: If Flint edits a file you did not intend to change, /rewind undoes the file changes from the current session. That is the recovery path, not a reason to leave the level on normal.
How to check it worked
Each tool call leaves one line in the console as it runs, so the files Flint read are there to scroll back through, and the audit log keeps every tool call of the session. The receipt after the turn lists the files changed, and a review should have changed none.
Tip: Scroll back through the tool lines for the files you asked about before you act on a finding. If a file was never read, the review has a hole in it.
What goes wrong and how to tell
The trade-off is depth. Flint passes the code and the task to the model and reports what comes back, so how much the review catches is set by the model. A free or small model misses more subtle issues than a frontier model, and no setting in Flint changes that. Switch models mid-session with /model, or run /model test to score a model on a set of small agent tasks with checked answers before you commit to it.
Cost is the second thing that bites, because every call to the model sends the conversation again and a large codebase makes for a long conversation. /spend sets how early Flint starts cutting that down: economy, normal or generous. Context swap, which is on by default, moves big and old tool results to the session folder on disk, keeps one line in their place, and reads them back when the model asks for them, so a tool result is never cut: it is whole, or it is in swap. A per-session budget stops a runaway task at a ceiling you choose, and /budget shows what has been spent so far.
Frequently asked questions
Can I run a code review in CI without someone watching?
Yes. A headless run never waits for a person: flint --headless --task "..." --budget 0.50 takes the task, runs it and exits. Any action the guard would normally ask about is refused at once, so the task description and the budget are your main controls. The exit code reports whether the task ran to its end, got nowhere, or was cut by a limit.
How do I make sure Flint does not change any of my files?
Set the care level to safe with /careful. At safe, Flint asks before every file change, so nothing is written without your confirmation. You can also block single tools with /deny <tool> or review the current set with /permissions.
The review is missing obvious problems. What is wrong?
Review depth comes from the model, not from Flint. Use /model to switch to a stronger model in the same session, or run /model test to compare models on a set of small agent tasks with checked answers before you settle on one.
Can I review just the changes in a git diff rather than the whole codebase?
Yes. Ask Flint to run git diff as a shell command and then review the output; at safe level it asks for confirmation before running the command. Another route is to save the diff to a file and point Flint at that file.
How do I keep the cost down when reviewing a large codebase?
Set economy mode with /spend, which starts context swap and compression earlier in the session. Context swap is on by default and moves large and old tool results to disk, leaving a one-line reference in the active context. Set a per-session budget so a runaway task stops itself at a ceiling you chose, and check /budget for what has been spent.
Reviewing AI-written code is one part of shipping it safely; exposed keys, database rules and old dependencies need the same attention once real users arrive. A security check for AI-built apps covers those in one pass.
Install Flint and run the first review
Install it, run the short setup, and point it at the directory you want reviewed. Get started with Flint.