Skip to main content

Strata

Strata records code metrics from Git commits (cognitive erosion, cyclomatic erosion, function complexity, verbosity) and displays them in a live dashboard. It uses scb-check to measure Python, Rust, and JavaScript source.

Named for geological layers, Strata shows how a codebase builds up and changes over time. Browse directories and files, follow changes across commits, and open any measurement's source at that commit, with syntax highlighting and metric hotspots.

Strata's directory explorer and commit timeline

Strata measuring its own source across ten commits.

Commit source with syntax highlighting, complexity hotspots, and a minimap

The source window shades function ranges by the selected metric. The minimap shows hotspots across the file and lets you jump to them.

Setup

Requires Git and Python 3.12+. Install the strata command with uv or pip:

uv tool install git-strata
# or
pip install git-strata

In a project with source under src, install the commit hook and record the current commit:

strata hook install --source-root src
strata scan

Every recording scans Python, JavaScript, and Rust under the source roots, with separate metrics per language. State lives in .strata/, excluded from Git.

Start the live dashboard:

strata serve

Open http://127.0.0.1:8766/. Use --port to serve several projects at once. Scores flag code worth reading, not quality or correctness.

Command Does
strata scan [REV] Measure one commit (default HEAD)
strata backfill [REV] Measure past first-parent commits (default HEAD), skipping measured ones; --since, --every N
strata hook install / remove Record every commit in the background
strata serve Serve the dashboard on loopback
strata service install / remove Keep the dashboard running on macOS, optionally over Tailscale

Commands act on the current repository; pass --repo for another. See commit recording and dashboard usage for details.

After uv tool upgrade git-strata, restart running servers.

Agent skill

skills/strata teaches coding agents to run Strata and turn its measurements into review suggestions. For Claude Code, link it into your skills directory:

ln -s "$PWD/skills/strata" ~/.claude/skills/strata

Development

uv run pytest -q tests
node --test tests/dashboard.test.cjs
uv run ruff check src tests

Browser checks require Chromium and WebKit installed through Playwright:

uv run --with playwright playwright install chromium webkit
uv run --with playwright python tests/source_browser.py
uv run --with playwright python tests/multilanguage_browser.py

Credits

scb-check, by Gabriel Orlanski, provides Strata's metric analysis. Strata pins version 0.2.0 and adds commit recording and visualization around its results.

SlopCodeBench, from SprocketLab, and the SlopCodeBench paper provide the research and metric definitions behind this project.

License

Strata is licensed under the MIT License. Bundled third-party assets retain their own licenses in the vendor directory.

Metadata

Release files for git-strata 0.1.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 git-strata 0.1.0
File Size Uploaded
git_strata-0.1.0.tar.gz 62.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-strata 0.1.0
File Interpreter ABI Platform
git_strata-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 131.8 kB

Release files / git_strata-0.1.0.tar.gz

Download URL git_strata-0.1.0.tar.gz
Size 62.3 kB
Tags Source
SHA-256 checksum
How to use checksums
77fc04a723760105fa5cd385cc184186fbd2df728e8f6a56950df8013b644a84
BLAKE2b-256 checksum
How to use checksums
0ab53f765abb0877147209514b59891bedd828b654ef6937e9db13650ee8c865
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / git_strata-0.1.0-py3-none-any.whl

Download URL git_strata-0.1.0-py3-none-any.whl
Size 69.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d47f8dce2122a79441afbfb5dfc4d85b5ca9552b34d0c5db942211e1a6d92e9
BLAKE2b-256 checksum
How to use checksums
bf9a55ae5f7723b9940cb1c59a968e8629310dc96998a247dd76b08e1aa83310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

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