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;
  • 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

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: 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.

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 detectors 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.3.1

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.3.1
File Size Uploaded
neosloc-0.3.1.tar.gz 75.2 kB Details

Built distribution (wheel)

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

Total release size: 149.0 kB

Release files / neosloc-0.3.1.tar.gz

Download URL neosloc-0.3.1.tar.gz
Size 75.2 kB
Tags Source
SHA-256 checksum
How to use checksums
66b24ef5dba66f69abcf07c85cf02239409406348340182fc5e04afff6ad95da
BLAKE2b-256 checksum
How to use checksums
a922eaae766e06ba8b62f1ea0ed41d7f815b8b86cc6412ed14baa1ee012ec778
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 6, 2026.

Transparency log

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

Download URL neosloc-0.3.1-py3-none-any.whl
Size 73.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
732d8ed1572f9129f921598e5b2d986dec3108fa14cddb161c7f135e163795ce
BLAKE2b-256 checksum
How to use checksums
47d413afdefa2e0bc2e2422ed9c1c05658745d9350b6b632c5571ed4a932059e
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 6, 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

0.7.0

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

This release

0.3.1 This release

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