Skip to main content

anatomize

CI Documentation License: MIT Python

Finding code is usually easier than deciding whether it can be changed safely. A duplicate-looking function may preserve another contract, and a passing test may describe only one selected run. Anatomize turns an exact repository state into the compact evidence needed to make and review that decision:

repository -> review session -> task dossier -> decision -> change -> fresh evidence -> closure

Observation and judgement remain separate. Anatomize records candidates, omissions, and conflicts; an agent or person owns the resulting decision. Source content is excluded unless the caller explicitly includes it.

Install

Anatomize requires Python 3.10 or later.

python -m pip install anatomize

The optional local MCP server is the only extra:

python -m pip install 'anatomize[mcp]'

Review a repository

From the repository to inspect:

mkdir -p .anatomy/review

anatomize review start . \
  --repository-id repository:example \
  --format json \
  --output .anatomy/review/session.json

anatomize review dossier .anatomy/review/session.json \
  --profile orientation \
  --format markdown \
  --output .anatomy/review/orientation.md

anatomize review dossier .anatomy/review/session.json src/package/core.py \
  --profile implementation \
  --target-kind file \
  --question 'What must remain true while simplifying this module?' \
  --format markdown \
  --output .anatomy/review/implementation.md

The session is content-addressed and portable. The orientation dossier gives a small map of entry points, ownership, tests, documentation, configuration, and data. The implementation dossier prioritises the selected target's definition, consumers, tests, contracts, diagnostics, documentation, conflicts, and known gaps. When a byte or item limit excludes material evidence, the dossier says so and advertises a source-bound expansion.

Inspect conservative consolidation candidates separately:

anatomize review similarity .anatomy/review/session.json \
  --format json \
  --output .anatomy/review/similarity.json

A candidate is never an instruction to delete or merge code. Use review consolidate to gather the behavioural, consumer, test, documentation, runtime, contract, history, conflict, and unknown evidence needed for that decision.

Complete the lifecycle

Before editing, review intent binds explicit obligations to the exact before-state and implementation dossier. After editing, capture a new session with the same repository identity, then use review change and review verify:

anatomize review start . \
  --repository-id repository:example \
  --format json \
  --output .anatomy/review/after.json

anatomize review change \
  .anatomy/review/session.json \
  .anatomy/review/after.json \
  --format markdown \
  --output .anatomy/review/change.md

Closure requires a fresh observation for every declared obligation. Anatomize accounts for the evidence but never fabricates a test, audit, or human approval.

Bring specialist evidence

review start always builds the deterministic baseline itself. It can also import data artifacts that another tool has already produced:

anatomize review start . \
  --repository-id repository:example \
  --artifact sarif=artifacts/lint.sarif \
  --artifact junit=artifacts/junit.xml \
  --artifact coverage=artifacts/coverage.json \
  --artifact cyclonedx=artifacts/sbom.json \
  --format json \
  --output .anatomy/review/session.json

Supported import kinds are sarif, lsp, junit, coverage, mutation, jscpd, snakemake, targets, renv, cyclonedx, and ro-crate. Use KIND@VERSION=PATH when a native format needs an explicit version. A caller can also pass an already-normalised ProviderEnvelope with --provider. Anatomize does not discover plugins, execute providers, run repository code, or use the network during review.

Integrate an agent

Negotiate the machine surface rather than inferring it from the package version:

anatomize review capabilities --format json

Use canonical JSON over the CLI for an independently released consumer. For a local MCP host:

anatomize mcp /path/to/repository

The MCP projection is read-only and delegates to the same review application as the CLI. It adds no second analysis path.

Guarantees and limits

  • Repository paths are normalised, relative, and contained after symlink resolution.
  • Inputs use bounded, strict schemas; XML parsing rejects DTDs and entities.
  • Artifacts bind repository identity, exact source state, producer evidence, configuration, and limitations.
  • Independent evidence is merged without last-writer-wins; explicit cross-provider contradictions become conflict records.
  • Sessions omit source text by default. --include-source is exact and opt-in.
  • Outputs are deterministic and human-readable; Markdown and plain text do not require ANSI or colour.
  • The library does not execute code, prove semantic equivalence, approve a release, scan for secrets, or replace specialist compilers and test tools.

Documentation

Development and release qualification are defined in CONTRIBUTING.md. Security and privacy boundaries are in SECURITY.md.

License

MIT. See LICENSE.

Metadata

Release files for anatomize 2.0.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 anatomize 2.0.0
File Size Uploaded
anatomize-2.0.0.tar.gz 367.3 kB Details

Built distribution (wheel)

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

Total release size: 608.6 kB

Release files / anatomize-2.0.0.tar.gz

Download URL anatomize-2.0.0.tar.gz
Size 367.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2890559df1e2305c30df37aec1fbc607408230754f2bfce4af56cce51e9ce1a6
BLAKE2b-256 checksum
How to use checksums
595ce50fbb5ba773eb071411a55b822a02638ac9f5d1bc8852a5c193f7164383
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 Aug 24, 2026.

Transparency log

Release files / anatomize-2.0.0-py3-none-any.whl

Download URL anatomize-2.0.0-py3-none-any.whl
Size 241.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
905fd1891744bcf609a5298b61c4f2bc05175eaeccf0fbdf936e21566bb1ccf4
BLAKE2b-256 checksum
How to use checksums
69451f406a80d555ef89436fa48a3841c7fa9afdb0763e8431e5776b400aecaa
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 Aug 24, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

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