Skip to content
Maxwell CollinsContact

AI technical due diligence for software acquisitions

An AI engine that audits a software company's code for buyers and investors before an acquisition.

What it achieved

6 weeks → hoursfor an audit consultants price at $150,000 to $500,000

A code audit that consultants take six weeks and $150,000 or more to deliver, done in hours.

The short version

This engine does in hours, for $30 to $200 in AI fees, the code audit of a software company that consultants take six weeks and $150,000 or more to deliver. Maxwell built it as an AI technical due-diligence engine (codex-audit). It points ten specialist Claude agents at any codebase and drops every finding that does not cite its evidence. It scores risk in each area and overall, estimates what the fixes will cost, and writes the report. It ships as a command-line tool, a code library developers can build on and a self-serve web service starting at $79 per scan. It has produced real audits of real codebases.

The problem

Before a firm buys or invests in a software company, someone has to say what the code is really worth. That job goes to a few senior engineers who read code by hand for weeks, at $150,000 to $500,000, so smaller deals go without. A general AI model pointed at a codebase invents findings and counts wrong, which is the one thing a due-diligence report cannot contain.

In use

  1. A practitioner points it at a company's repository. No setup is needed.
  2. Deterministic code measures everything measurable: dependencies, history, complexity, tests.
  3. Ten specialist agents (architecture, security, code quality, technical debt, team health and more) reason over that evidence. Any finding without its file and line, metric or commit is dropped.
  4. It scores each area and the whole, estimates what fixes will cost, and writes the report.
  5. The practitioner spends two or three days on judgment and interviews instead of six weeks reading.

What it achieved

  • An audit that consultants charge $150,000 to $500,000 for costs $30 to $200 in AI fees, so deals too small for a consulting team can now get one.
  • Six weeks of senior engineers reading code becomes hours, leaving the practitioner two or three days for judgment and interviews.
  • On a real audit of a 674,000-line codebase, it priced the fixes in engineering hours and dollars, putting a figure on what the code needs.

The software

Screens of the running system, measuring koa, an open-source web framework.

Terminal: the audit command runs discovery and six collectors on an open-source web framework and finishes in one second.
1The engine is pointed at a repository and runs its measurement stages before any AI step.
Terminal JSON: 12,519 lines of code, the three most complex functions, test-to-code ratio, and commit and contributor counts.
2The measured evidence covers code size, complexity hot spots, test coverage and project history.
Terminal table of seven dependency vulnerabilities, each with severity, package name, advisory ID and title.
3The dependency audit lists each vulnerable package with its severity and advisory ID.

The full record

On this page
In one sentence

Maxwell built codex-audit, an AI technical due-diligence engine that points ten specialist Claude agents at any codebase and turns a 4-to-6-week, six-figure acquisition audit into a cited, scored report in hours, through a six-stage pipeline (Discovery, Collection, Analysis, Correlation, Scoring, Reporting) in which a finding without a cited source cannot exist, shipped as a command-line tool, an npm library and a self-serve SaaS starting at $79 per scan, in 27,990 lines of application code in 259 files and 41,447 lines of tests in 152 files, with nearly 2,000 gate-enforced tests (1,777 test cases counted), 11 screens, 6 service routes, 8 data tables and 154 commits. He builds by directing AI agents, and he built this system that way.

lines of tests
41,447
lines of code
27,990
test cases
1,777
specialist agents
10
commits
154

What it does

codex-audit does the work a technical due-diligence team does before an acquisition or an investment: it reads a company's whole codebase and reports what a buyer is getting, what is at risk and what it will cost to fix. A traditional engagement puts three to five senior people on it for four to six weeks at $300 to $600 an hour, $150,000 to $500,000 in all. codex-audit runs the analysis in hours for $30 to $200 in AI costs, and leaves the practitioner two to three days to review the findings and interview the team.

Who it serves:

  • Due-diligence practitioners: former CTOs, VPs of Engineering and senior engineering leaders who assess technology for private-equity firms, venture funds and corporate acquirers. The engine is their autopilot: it does the reading, and they do the judging.
  • Teams checking their own code: the SaaS lets any team X-ray its own codebase before a buyer does, with the line "The same report a $150,000 consulting firm writes, in 30 minutes, starting at $79."

Zero configuration. codex-audit analyze <path> runs with no flags on any codebase, in any language or framework, of any size. It is designed for codebases of 500,000 lines and more, with discovery under 60 seconds, collection under 180 seconds, a full analysis under 30 minutes and AI spend under $200.

The six-stage pipeline

The first two stages use no AI at all, so they are fast, cheap and give the same answer every time. The AI never counts lines, checks versions or computes a metric; it reads code and reasons over evidence the deterministic stages have already measured. Collection results are cached between the two halves.

  1. Discovery builds a technology profile with 13 detectors: languages, package manager, framework, database, CI/CD, cloud and infrastructure, test framework, project structure, monorepo strategy, governance, default ignores, manifest parsing and regulatory signals. The regulatory detector spots PCI DSS (payment libraries, card and CVV fields), HIPAA (HL7, FHIR, DICOM, patient and diagnosis fields), GDPR (consent libraries, erasure and export endpoints, EU regions in infrastructure code) and SOC 2 (audit-logging frameworks). The codebase is then matched to one of 10 built-in technology profiles: NestJS, Django, Express, React, Next.js, Rails, Spring Boot, Laravel, Go/Gin and ASP.NET Core.
  2. Collection builds an evidence store with six collectors: a dependency collector (full inventory, known vulnerabilities through the OSV.dev batch API, freshness from the npm and PyPI registries); a git collector (contributors, ownership and churn); a metrics collector (lines of code, cyclomatic complexity per function, flagged above 15 and rolled up by directory, and duplication); a secret scanner; a linter collector (ESLint, pylint, rubocop); and a tooling-audit collector that runs the ecosystem's own audit tools (npm, pnpm and yarn audit, pip-audit, cargo-audit, Composer and Bundler) with severities normalized across them.
  3. Analysis runs the specialist agents in parallel, each as its own Claude session with a domain system prompt, the technology profile, its slice of the evidence and the file tree. Each agent can read files (up to 5,000 lines a call, confined to the repository, binaries refused), read in batches and search, and it can report only through a structured emit_findings tool, never free text. Depth sets the budget: quick allows 5 base turns and 200,000 exploration tokens, standard 10 turns and 400,000, deep 30 turns and 800,000, adjusted for codebase size. A budget tracker warns at 70%, 85% and 95% of the token budget, and an agent that fails marks its domain "not assessed" while the rest of the audit carries on.
  4. Correlation is an AI pass across all findings. It groups them by affected component and raises the severity where several domains converge on the same part of the system (three domains with one HIGH, two domains both HIGH or CRITICAL, or a security finding, a coverage gap and a complexity hotspot on one component). It detects systemic patterns (the same issue in five or more modules) and contradictions between what a company says and what its code does: documentation against code, CI configuration against practice, stated architecture against actual architecture. It picks the three to five headline risks, guided by six named compound risks: Unmaintained Critical Path, Systemic Security Neglect, Documentation-Reality Contradiction, Zombie Dependency Chain, Architecture-Scale Mismatch, and Team Exodus with High Debt.
  5. Scoring produces the risk scorecard: a red, amber or green rating for each domain, an overall score from 0 to 100, a remediation cost estimate and benchmark percentiles.
  6. Reporting produces the deliverable: a Markdown report of typically 30 to 80 pages of findings, with HTML and JSON versions, a findings.json sidecar and a metadata file.

The ten specialist agents

Six core agents run on every audit:

  • Architecture: module structure, coupling, cohesion, dependency direction, API design and layering.
  • Security: authentication, input validation, encryption, error handling, whether a known vulnerability is reachable, and configuration security.
  • Code Quality: readability, consistency, complexity hotspots, test quality and naming.
  • Technical Debt: framework currency, deprecated APIs, workarounds, incomplete migrations and test gaps.
  • Dependency Health: freshness, maintenance, license conflicts, concentration risk and a software bill of materials.
  • Team Health: bus factor, knowledge silos, velocity trends, review culture and onboarding friction.

Four more switch on by themselves when the technology profile calls for them: Infrastructure (when infrastructure-as-code is present: cloud architecture, high availability and disaster recovery, cost, security groups, containers), Scalability (for a web app or API: horizontal scaling, stateless design, caching, database bottlenecks), Compliance (when regulatory signals appear: GDPR, HIPAA, PCI and SOC 2 control mapping) and Data/ML (when machine-learning frameworks appear: models, data pipelines, training, bias and reproducibility). Any agent can be forced on or off.

Every finding carries its source

Each finding has a severity (critical, high, medium, low or info), a title, a description, its business impact, the affected components, the remediation, an effort estimate in hours with a confidence level, and at least one piece of evidence. Evidence is typed (code, metric, git history, configuration or dependency) and names its source: a file:line, a metric name or a commit. Findings are validated against a schema as they arrive, and one that fails is logged and dropped, so an ungrounded finding never reaches the report. The report reproduces each piece of evidence exactly as the agent captured it.

The scoring model

  • Per domain: RED for any critical finding or three or more high ones; AMBER for one or two high or five or more medium; GREEN otherwise. A raw score (critical ×10, high ×5, medium ×2, low ×0.5) is normalized onto 0 to 100.
  • Overall: a weighted mean of the domains, with Security weighted 1.5, Compliance 1.4, Architecture 1.3, Dependency Health 1.2, Team Health 1.1 and Code Quality 0.8. 0 to 25 is green, 26 to 55 amber, 56 to 100 red. The SaaS also gives a letter grade from A to F.
  • Remediation cost: effort hours for every medium-and-above finding, multiplied by 1.0, 1.3 or 1.8 for high, medium or low confidence, priced at a configurable $150 an hour and broken down by priority and category.
  • Benchmarks: once the local benchmark database holds ten or more comparable codebases, the report ranks the target by percentile on risk score, debt hours per thousand lines, vulnerability density, test coverage, bus factor and velocity trend.

The report

The report is part AI-written and part rendered from templates. The AI writes the executive summary (two to three pages for a private-equity reader, written from the scores, never from raw code), a narrative for each domain and the compound-risk prose. Templates render the red-amber-green matrix, every finding with its evidence, the tables of findings behind each compound risk, a remediation roadmap (immediate, 100-day and 6-to-12-month), the scope and limitations, and five appendices: dependency inventory, contributor analytics, code metrics, methodology and glossary. The scope section always lists what a code audit cannot see: runtime behavior, infrastructure and database state, third-party integrations, non-code assets, organizational and legal matters, and user experience. One real report ran about 1,950 lines on a 674,000-line Next.js and TypeScript codebase.

Three ways to use it

  • The command-line tool (codex-audit) has five command groups: analyze (the full audit, with depth, domain selection, output format, profile, model, a --dry-run that runs the two deterministic stages only, and a --max-cost hard ceiling that aborts the run), diff (compares two audits and reports findings resolved, new and changed, for tracking remediation over a hold period), report (re-renders a report from a findings file), benchmark show and benchmark export, and profile list and profile show. It reads a .codex-audit.yaml per repository or a user-wide configuration.
  • The npm library exposes runPipeline and estimateCost, the domain lists, a BudgetExceededError and typed results for every stage, so the engine can sit inside another product.
  • The SaaS (built for code-rescue.com) has 11 screens: a landing page (hero, proof strip, terminal demo, a feature grid with five visualizations, the pipeline, a product preview, pricing), sign-up, login, password reset and email verification, a dashboard of connected repositories, a connect-repository screen, a new-scan screen (choose source, depth and mode) and a scan page that streams progress. Users sign in with GitHub, Google or email and password; a GitHub App grants read-only access to their repositories, or they upload a zip. Its 8 data tables cover users (with their Stripe customer), accounts, sessions, verification tokens, GitHub installations, connected repositories, expiring share links for reports and scans (source, status, mode, depth, tier, cost, letter grade, risk score, finding counts and the full result). Six tiers map to engine settings and cost caps: Free (a deterministic scan), Pro and Business subscriptions, and one-time Quick, Standard and Deep scans, the deepest running all ten agents with a $250 cap. Pricing starts at $79, set by repository size, with a free scan included.

Operating limits in the SaaS: clones time out at 5 minutes, uploads are capped at 500 MB, a line-count check enforces a 500,000-line limit, one scan per user and three at once run concurrently, a daily AI-spend cap acts as a kill switch, scans time out at 30 minutes, temporary files are swept every 30 minutes, stalled scans are recovered at startup, and login, upload and scan requests are rate-limited.

Security posture: no telemetry; the target's source code is never written to disk (only results are cached), never executed, and never read outside the repository path.

Built with: TypeScript, Commander.js, the Claude API (Claude Sonnet 4.5 at temperature 0), simple-git, OSV.dev, jscpd, secretlint, Handlebars, Zod; for the SaaS, Next.js 16, React 19, Tailwind v4, Neon Postgres with Drizzle, Auth.js v5, a GitHub App, Resend, Upstash Redis and server-sent events.

What it achieved

  • A six-figure, six-week service compressed into hours: a full audit for $30 to $200 in AI costs (quick audits $5 to $20 in 5 to 10 minutes, standard $30 to $80 in 10 to 20, deep $80 to $200 in 20 to 30) against $150,000 to $500,000 for a consulting engagement.
  • Ungrounded findings cannot exist. Every finding names its file and line, metric or commit, and the pipeline drops anything that does not.
  • One engine, three products: a CLI for practitioners, an npm library for other software and a self-serve SaaS starting at $79 per scan.
  • Real reports on real codebases, each around 1,950 lines, one of them scoring and pricing the remediation of a 674,000-line codebase.
  • Size: 27,990 lines of application code in 259 files (the engine 16,111 lines in 113 TypeScript files, the SaaS 9,666 lines in 128), 41,447 lines of tests in 152 files, nearly 2,000 gate-enforced tests (1,777 test cases: 1,295 in the engine across 80 test files and 482 in the SaaS across 54), 11 screens, 6 service routes, 8 data tables and 154 commits, 130 of them in a single month.

The problem it solves

Before a firm buys or invests in a software company, someone has to tell it what the code is really worth. That job goes to a handful of senior engineers who spend weeks reading code by hand, at a price only large deals can carry, and whose findings rest on what they had time to read. Smaller deals go without, and the buyer finds the problems after closing.

Pointing a general AI model at a codebase does not fix this. It invents findings, counts wrong, and produces confident prose with nothing behind it, which is the one thing a due-diligence report cannot contain. codex-audit separates the two kinds of work: deterministic code measures everything that can be measured, the AI reasons only over that evidence and the code itself, and every finding must carry its source or it is dropped. The practitioner gets the reading done in hours and spends the days on judgment and interviews.

How he built it

Maxwell directed the build from a 2,911-line engine blueprint of 23 sections and 3 appendices, broken into 11 engine specifications and 7 SaaS specifications, through a specification-first workflow: specify, plan, break into tasks, write failing tests, build, pass the gate, commit. Each piece moved through six gates: specification validation, research, a data-flow check, red tests, green implementation and a self-audit. The SaaS was delivered in phases, reaching 498 tests.

The quality gate runs on every change. For the engine: ESLint with zero warnings, then 8 structural ast-grep rules (no console logging, never evaluating target code, no hard-coded language logic, no hard-coded secret fallbacks, no path traversal, no raw error exposure, no telemetry, structured output required from every agent), then 6 dependency-cruiser boundary rules (the deterministic stages may not import the AI client; no circular, orphaned or unresolvable imports), then the TypeScript compiler, then the test suite. For the SaaS: lint, type check, tests and a production build. GitHub Actions runs both on every push and pull request, weekly and on demand.

34 write-time rules block bad edits during AI sessions: no as any, no lint suppressions, no skipped tests, no TODOs, no empty catch blocks, no timing hacks or weak assertions in tests, no vague test names, no raw SQL, no payment secret on the client, no public environment secrets, no dangerous HTML, no unverified webhook parsing and no bypassing git hooks. One rule refuses any finding with empty evidence.

Hooks govern the agents doing the building. Session-start and stop hooks frame each session, a subagent-start hook injects the rules into every helper agent, a subagent-stop hook checks what each helper produced, and a task-completed hook refuses to close a task until the gate passes. Eight orchestrator rules hold the agents to account, among them no "pre-existing" excuse, "you touch it, you own it", and no re-running the gate without changing code. A 47-rule testing standard in 9 groups sets an 80% coverage minimum per file.