Skip to main content

clocx: count lines of code and see where work is happening

clocx

clocx counts lines of code and shows where work is happening right now: totals by language and directory, lines added and removed over the last hour, day, week and month from git history, and the work in progress in every git worktree of the repository. It prints one colored report and exits, or stays open as a live dashboard that refreshes as files and commits change. It is built for a repository where several people or coding agents work in parallel worktrees and you want to see all of it at a glance.

CI crates.io PyPI GitHub release License: GPL-2.0 MSRV 1.88 Platforms

Install

cargo install clocx

Or, without a Rust toolchain, the prebuilt binary from PyPI (the wheel holds only the clocx executable):

uv tool install clocx     # or: pipx install clocx
uvx clocx                 # run once without installing

Prebuilt binaries for Linux (x86_64, arm64; static, any distribution), macOS (arm64, x86_64) and Windows (x86_64) are attached to every GitHub release, each with a SHA-256 checksum. Download the archive for your platform, check it, and put clocx on your PATH.

From a checkout:

cargo install --path crates/clocx

Sixty-second tour

clocx              # report on the current directory and exit
clocx path/to/repo # report on another directory
clocx --live       # full-screen dashboard; q quits
clocx --json       # the same report as one JSON document

An example clocx report: languages, directories, activity, where work is happening, and worktrees

Read top to bottom:

  • Languages and Directories: files and code, comment and blank lines, with the change in code lines since you last ran clocx.
  • Activity: lines added and removed, files touched and commits over the last hour, 24 hours, 7 days and 30 days, across every local branch, each with a sparkline of when the changes happened.
  • Where work is happening: the same activity per directory, with current work on top.
  • Worktrees: every worktree with its branch, uncommitted lines against its HEAD, commits ahead of the base branch, everything it changed since branching (committed or not), and its last activity. The worktree you ran clocx in is marked *.

Green is lines added, red is lines removed, totals are dimmed. Output is plain when it goes to a pipe or a file, or when NO_COLOR is set.

Live view

clocx --live (or -l) draws the same report full screen and keeps it current. It refreshes when a source file changes (debounced, ignoring what .gitignore ignores), when commits, branches, HEAD or the index change in any worktree, and every 30 seconds so the time windows keep moving. Only changed files are recounted and only new commits are diffed, so it is cheap to leave open on a second screen. q quits, r refreshes.

Options

Flag Meaning
-l, --live Live dashboard instead of a one-shot report.
--json One JSON document with every section (schema_version 1).
-d, --depth N Group directories N levels deep (default 1).
--rows N Fold tables after N rows (default 12, 0 for all); changed rows always show.
--base BRANCH What worktrees compare with (default main, else master).
--color WHEN auto, always or never.
--cache-dir DIR, --no-cache Where counts are cached, or no cache at all.
--no-progress No progress line on stderr while the report is computed.
-v Diagnostics on stderr (-vv debug); RUST_LOG also works.

The full reference, with the JSON shape and the exact rules for each section, is docs/clocx.md.

How it counts

Counting is done by tokei: files git would not ignore are counted, hidden directories such as .github count, and documentation counts as comment (Python docstrings and Markdown prose; code blocks in Markdown are code). clocx started as a fork of cloc and agrees with it within a few percent on code lines for the languages checked; the differences, and why, are listed in docs/clocx.md, Differences from cloc.

Development

cargo test
cargo clippy --all-targets -- -D warnings
cargo fmt --all

The toolchain is pinned in rust-toolchain.toml. All output goes through one module, crates/clocx/src/render; everything else computes typed data and hands it over. Git access uses gix, the dashboard uses ratatui, and file watching uses notify. CI runs formatting, clippy, the MSRV build, a crates.io package dry run and the tests on Linux, macOS and Windows for every push.

Versioning and compatibility

clocx follows Semantic Versioning. Before 1.0, a minor version may change flags, output layout or the JSON shape; the JSON carries a schema_version that changes whenever its shape does. The minimum supported Rust version is 1.88 and is checked in CI; raising it is a minor-version change. Changes are listed in CHANGELOG.md, and releases are cut as described in docs/releasing.md.

Contributing

Contributions are welcome, from a typo fix to a new section of the report. Read CONTRIBUTING.md before opening a pull request; it covers the local setup, the commit format and the AI-assisted contributions policy. Everyone taking part is expected to follow the Code of Conduct.

Security

See SECURITY.md for how to report a vulnerability; please do not open a public issue for one.

License

GPL-2.0-only, like cloc, from which clocx grew. See LICENSE.

Logan Dapp logan@logand.app

Metadata

Release files for clocx 0.2.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 clocx 0.2.1
File Size Uploaded
clocx-0.2.1.tar.gz 98.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for clocx 0.2.1
File
clocx-0.2.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
clocx-0.2.1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
clocx-0.2.1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
clocx-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
clocx-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
clocx-0.2.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
clocx-0.2.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 29.2 MB

Release files / clocx-0.2.1.tar.gz

Download URL clocx-0.2.1.tar.gz
Size 98.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e0d06d4ace472b720dda383916968b6443eb80948e388540854448dbf3358222
BLAKE2b-256 checksum
How to use checksums
915b2b6713a103c74ad3eca6c023d894ffe26b7c18ec7dedfe570cac833d6425
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-win_amd64.whl

Download URL clocx-0.2.1-py3-none-win_amd64.whl
Size 4.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
82d3a66aaa69ffaa77b7d100f180c90436cdeceb2ac7651acd0dfb8bc12ba47e
BLAKE2b-256 checksum
How to use checksums
257f70dd4cb8095ed3fef395db5cb04832f27efcbf036fa64fd64d349cd54d2c
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-musllinux_1_2_x86_64.whl

Download URL clocx-0.2.1-py3-none-musllinux_1_2_x86_64.whl
Size 4.4 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
44403a0cf9f39813bceb46e767f9530dd4159eb30f3f2c83d9dcba6c83343e34
BLAKE2b-256 checksum
How to use checksums
40c53019f341502b03e61cc28e333f87c89af86bbfc59a4eed9dccdfa701c099
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-musllinux_1_2_aarch64.whl

Download URL clocx-0.2.1-py3-none-musllinux_1_2_aarch64.whl
Size 4.1 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
2ca5bcdf3829241d68f34d0d7e6f19a705901a7b4a04840fc0d0c188c6c6a213
BLAKE2b-256 checksum
How to use checksums
318fd88d5d60fa75d70e0ce19204a700c57fe3a42f39d786682fc1d9d4dfc293
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL clocx-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c03d4f440f8285424e0af398fc6c93ad1ae41a37f6d9ee9ce1cb20f480a116c8
BLAKE2b-256 checksum
How to use checksums
cb755b2003bb8f27b59fac09f80c2e94ebb913a98f2c6f86b3df5564b2a90c6f
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL clocx-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6596fc3ded54bdc263bed2c4867204f026268829b4c57054db604abd17cefad2
BLAKE2b-256 checksum
How to use checksums
4d456e50ea410db61c70e1b93bcdc84a77f96e1a724deeab25210d24c8fc2c20
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-macosx_11_0_arm64.whl

Download URL clocx-0.2.1-py3-none-macosx_11_0_arm64.whl
Size 4.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3b8e524e414c00d65c2d6f522bcccbce985f70aa12f68e961b541eba5dc279e7
BLAKE2b-256 checksum
How to use checksums
868e345a9cbf30179da133961733f165fe7d88dbda57170af44722207e0f2e99
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 4, 2026.

Transparency log

Release files / clocx-0.2.1-py3-none-macosx_10_12_x86_64.whl

Download URL clocx-0.2.1-py3-none-macosx_10_12_x86_64.whl
Size 4.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8d79ebe15d6ac299ea68cd909c268729757210f0293877badfd0a5a764b421b8
BLAKE2b-256 checksum
How to use checksums
00b7ef97a2bb8878fa6454af42554df201531c81c4b5b41f185979e2ef82cba9
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

8 release files

0.2.0

8 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