Skip to main content

neosloc

ci PyPI docs

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://ingmmo.com/neosloc/

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/sirmmo/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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neosloc 0.7.0
File Size Uploaded
neosloc-0.7.0.tar.gz 111.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neosloc 0.7.0
File Interpreter ABI Platform
neosloc-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 205.1 kB

Release files / neosloc-0.7.0.tar.gz

Download URL neosloc-0.7.0.tar.gz
Size 111.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3f960f303711b31f36598f093ce9cf27e4e45c765d2d18c466b503c10b67dd42
BLAKE2b-256 checksum
How to use checksums
3a219ec475723365e2eb4eaa311baeb79e1d6505a56c9010fa187cd5bce7907e
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

Release files / neosloc-0.7.0-py3-none-any.whl

Download URL neosloc-0.7.0-py3-none-any.whl
Size 93.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7f73ad976cadbcba258923a88aca14ce45e35fd0a63f71206ebadb121500c89
BLAKE2b-256 checksum
How to use checksums
354263f0195c1475d288ce684c2c915aa25c8f4976f88744b188687fa4da97ad
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

Release history Release notifications | RSS feed

0.8.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page