neosloc
sloccount counted lines of code and fed them to COCOMO to estimate the effort to build
software. With LLMs writing code, lines are cheap and that estimate has lost its meaning.
What is still expensive is everything around the code: how easily other systems and
agents can call it, run it, rely on it and change it safely, and the knowledge that exists
only in the code and its history.
neosloc measures that:
- ten integrability dimensions, each scored 0–4 with the evidence behind the level and the gaps phrased as actions;
- the retrofit effort to bring every dimension up to "solid", and whether the system is cheap to wrap;
- neoCOCOMO: what the codebase is worth when an agent can re-type it, next to classic COCOMO;
- a make-or-buy verdict: the tokens, agent hours and human days to rebuild an equivalent
with agents, against the cost of adopting this project (
--buy-price,--horizon); - optional LLM evaluators on Anthropic or OpenRouter: a probe attempts real integration tasks using only the docs, a judge checks the answers against the source, and a review audits every static level.
pip install neosloc
neosloc path/to/repo
Interface surface ■■■□ 3 solid The framework generates a contract from code, so it tracks the implementation.
+ routes:fastapi/flask: 15 route declarations in 3 files (app/routes/admin.py)
+ generated-spec: FastAPI (auto OpenAPI) (app/main.py)
- Check the generated spec into the repo so changes are reviewable and diffable.
...
Integrability index (0-4, assessed dimensions): 1.80
Retrofit effort to level 3 (agent-assisted): 7.5 person-days
Value (neoCOCOMO, cost approach; see neosloc/value.py)
Classic COCOMO (sloccount): 4.6 KSLOC -> 11.8 person-months, 6.4 months, $133k
Behaviour captured: 38% (tests 0.14, contract 0.25, docs 1.00)
Reproduce with agents: x0.38 of classic -> 4.5 PM
Rediscover uncaptured history: 102 fix / 474 commits, 19 authors -> 4.4 PM knowledge, 2.7 PM uncaptured
Value: 5.2 PM ~ $59k (at $11k per PM)
Knowledge at risk: 38% of replacement cost lives only in code and history
Documentation: https://neosloc.github.io/neosloc/ · Archive of assessed repositories: https://neosloc.github.io/archive/
Install
pip install neosloc (or pipx install neosloc, uv tool install neosloc) |
the neosloc command; the static analysis has no dependencies and runs on Python ≥ 3.8 |
pip install 'neosloc[agentic]' |
adds the anthropic SDK, needed for anthropic: models (Python ≥ 3.10) |
pip install git+https://github.com/neosloc/neosloc |
the development version |
OpenRouter models need no extra package, only OPENROUTER_API_KEY.
Dimensions
Each dimension asks one question, answered per surface (service, CLI, library,
desktop GUI app, frontend) with a ladder of checkable requirements: a surface reaches level N when it meets
every requirement up to N, and the dimension takes the best surface's level. Dimensions
that can't apply (events for a batch CLI, portability for a tool that stores no data) are
reported as n/a and left out of the index.
| Key | Asks |
|---|---|
interface |
Is there a machine-readable contract covering the implemented surface, and more than one way in (MCP, CLI --json, SDK, typed library)? |
stability |
Semver, changelog, API versioning, deprecations, and the real git history of the OpenAPI files. |
events |
Outbound webhooks (signed, self-service), streams, brokers, CDC, AsyncAPI/CloudEvents. |
identity |
Token auth, OAuth2/OIDC, scopes, managed API keys or service accounts, SCIM. |
portability |
Bulk export/import, open formats, schema in the repo. |
ergonomics |
RFC 9457 errors, validation, idempotency keys, pagination, rate-limit headers, dry-run, llms.txt. |
embeddability |
Container, compose/Helm/IaC, documented env config, headless entry point, library packaging. |
extensibility |
Plugin discovery, hooks, scripting, extension docs. |
observability |
Health/readiness, metrics, tracing, structured logs, error tracking. |
legibility |
The heir to SLOC: tokens per module, import cycles, tests, types, CI, lockfiles, agent docs. |
Details, with every requirement: dimensions, retrofit effort, neoCOCOMO.
LLM evaluators
# Probe: a model attempts 8 integration tasks from the docs; answers are graded against the code
neosloc --agentic --scope both --transcripts runs/ .
# Probe with Claude, judge with another vendor through OpenRouter
neosloc --judge --judge-model openrouter:openai/gpt-5.6-luna .
# Review: a panel audits every static level against the code
neosloc --review --review-model openrouter:google/gemini-3.8-flash,openrouter:deepseek/deepseek-v4-pro-0813 .
Models are written provider:model. The default is anthropic:claude-opus-5-5 at effort
medium. A comma-separated list runs a panel and reports agreement. Every model call
shares one --max-cost budget (default $5), and the report states the total. See
LLM evaluators and
Using OpenRouter.
Scripting
--json output (reports and errors) follows a published JSON Schema (neosloc --schema). Exit statuses distinguish error classes (2 usage, 3 path, 4 evaluator setup).
Diagnostics go to stderr: -q, --log-level, --log-format json. See
JSON output and
Command line.
Status
All thresholds and coefficients are uncalibrated, so treat the numbers as rankings.
Calibration and limits describes how to fix
that; --review and --agentic exist partly to do it.
Development
python -m unittest discover -s tests -t . # no network, no API spend
python -m neosloc .
See Writing criteria and AGENTS.md.
Releases: bump neosloc/__init__.py, add a CHANGELOG.md section, push a vX.Y.Z tag.
MIT licensed.
Metadata
Release files for neosloc 0.7.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| neosloc-0.7.3.tar.gz | 112.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neosloc-0.7.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 207.1 kB
Release files / neosloc-0.7.3.tar.gz
| Download URL | neosloc-0.7.3.tar.gz |
|---|---|
| Size | 112.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b25f0f6fb51f68649f4415820e1ba9bd37bf41a35572787c20d72a2217be64ad
|
|
BLAKE2b-256 checksum How to use checksums |
baddaf284c7e354ece42243b305188de6b6cf14951a1970f9ad0e88bc850bb3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / neosloc-0.7.3-py3-none-any.whl
| Download URL | neosloc-0.7.3-py3-none-any.whl |
|---|---|
| Size | 94.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45220413eb16bdb2107bd4287d0e78ace4a74b126378769c71e84d37a920a2d3
|
|
BLAKE2b-256 checksum How to use checksums |
41fb8828d94ee5b03156f9a15cbeb886555efbb8ebb7f72f761990cd35def014
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log