Kilo Code Pricing vs Alternatives: My Costs for 100k Lines
Kilo code pricing promises a simpler way to bill large codebases, but does it really save money for a 100 kLOC project? This article explores the numbers, the trade‑offs, and cost considerations.
The Pricing Puzzle: Why 100k Lines Can Break Your Budget
When a contract quoted kilo code pricing for a 100 kLOC project, the headline number looked attractive: a flat fee for a large application. In theory, you get a predictable budget line. In practice, the math behind the scenes quickly becomes messy, especially when the old per‑line pricing model resurfaces.
Legacy per‑line models and why they fail
Per‑line pricing isn’t new. In the early days of outsourcing, vendors would say “$0.30 per line of code”. The idea was simple: count the lines, multiply by a rate, and you have a quote. For tiny scripts that works, but scaling to 100 kLOC stretches the model.
- Line count is deceptive. A line in a dense, well‑commented Java class can be a single statement, while a line in a C++ header might be a macro that expands to dozens of assembly instructions.
- Not all lines are equal. Boilerplate generated by frameworks (e.g., Spring Boot starters, Angular CLI) can inflate the count without adding functional complexity.
- Maintenance cost isn’t linear. Adding a feature that touches a few hundred lines in a tightly coupled module can cause ripple effects across many other files.
// Rough per‑line estimate calculation
const lines = 102_340; // total lines in repo
const ratePerLine = 0.28; // $0.28 per line (typical vendor quote)
const baseCost = lines * ratePerLine;
console.log(`Base cost: $${baseCost.toFixed(2)}`);
// Output: Base cost: $28,655.20
The script produces a tidy figure, but it says nothing about the hidden work required after delivery. For example, integrating with a legacy SOAP service often adds a separate adapter that wasn’t counted originally, causing the per‑line estimate to miss additional effort.
Beyond the raw numbers, the per‑line model can encourage a counter‑productive mindset: “write more lines, get paid more”. Teams may add unnecessary logging or defensive checks simply to increase the line count, which harms code quality and inflates downstream debugging effort.
Hidden overheads that inflate costs
Even if the per‑line premise is accepted, the real project budget rarely stays within that envelope. Below are typical categories where hidden overheads appear.
- Integration and glue code. Custom plugins or adapters often require deep exploration of platform internals, adding many hours of research and testing that were not accounted for in the original line count.
- Testing scaffolding. Unit‑test generation, mocks, and data builders can add thousands of lines of test code. When billed per line, this quickly becomes a significant additional expense.
- Documentation and onboarding. Comprehensive developer guides, API documentation, and onboarding videos generate substantial written content and consume senior‑engineer time, yet they are rarely included in the initial quote.
- Refactoring for maintainability. Mid‑project discoveries—such as the need to replace a home‑grown ORM for security compliance—often require touching many existing lines, creating effort that the original per‑line rate does not capture.
- Support and bug‑fix windows. Post‑delivery support periods generate bug tickets and small fixes. These maintenance activities add up, even though they were not budgeted in the initial estimate.
The cumulative effect of these hidden items can significantly increase the total cost beyond the original estimate, sometimes by a large margin.
Why alternatives often win the cost battle
Pure per‑line quotes become less practical for anything larger than a quick prototype. Alternative approaches provide a clearer picture of where money is spent.
- Component‑based pricing. Break the system into logical modules (e.g., authentication, reporting, integration layer) and price each based on complexity, not line count. This forces estimation to consider architecture and integration effort upfront.
- Time‑and‑material with capped phases. Define a discovery phase with a fixed price, then move to a time‑based model for development. The client sees the actual hours logged, and extra work can be tracked transparently.
- Outcome‑oriented milestones. Quote a price for delivering a specific feature set (e.g., “MVP with user management and PDF export”). Scope expansions trigger a change order, preventing surprise line‑count inflation.