Engineering · 6 min read
How Kestrel learns your codebase in under a second
Strict mode, path aliases and naming conventions — a look inside the project scan that makes generated code feel native.

The fastest way to lose trust in a code generator is to hand someone code that doesn’t look like theirs. Wrong import style, wrong test runner, a default export in a codebase that bans them. So before Kestrel writes a single line, it reads.
What we scan
- Compiler and lint configuration (tsconfig, ESLint, Ruff, golangci)
- Path aliases and module boundaries
- Test runner, fixtures and naming patterns
- The ten files most similar to the one you are editing
All of this is summarised into a compact “style card” that travels with every request. It weighs about 2 KB and takes under 300 ms to build on a large monorepo.
{ "imports": "named, aliased (@/*)", "exports": "named only", "tests": "vitest, colocated, *.test.ts", "strict": true}Why a summary beats raw context
Sending whole files is slow and leaks more than it needs to. A style card is small, cacheable and easy to audit — your security team can read exactly what leaves the machine.
Generated code should be indistinguishable from code your best reviewer would approve.
In our benchmarks, adding the style card cut “fix-up” edits after generation by 71%. That is the difference between a demo and a tool you use every day.


