Skip to content
ModshelfSubmit

LOC Split

Shows what your branch changed against main, split into code, comments, tests and docs

Workflow and CIAbove the promptSlash commandWrites or runs
LOC Split running in Claude Code

Recorded on Claude Code 2.1.287 in a sandbox. Claude's replies are scripted; everything the mod draws is real.

What it does

A row above the prompt counts the lines added and removed on your branch since it left main, sorted into code, comments, tests, docs and generated files such as lockfiles. You can tell at a glance whether a change is mostly real code or mostly tests, docs and noise. Open it and a table lists every commit since the branch started, your uncommitted changes (marked ✎) and the net total.

How to use it

  • The row shows by itself in any session inside a git repository with a main or master branch.
  • Type /loc-split, or click commits ↑N, to open or close the per-commit table. A long commit list scrolls on its own.
  • It refreshes when the session starts, a moment after Claude edits a file or runs a command, at the end of every turn, and every 20 seconds, so commits you make in another terminal show up too.

Good to know

  • It runs read-only git commands (merge-base, log, diff, ls-files) and reads untracked files to count their lines. It writes nothing and sends nothing.
  • Comments are told apart per language (//, #, --, <!-- -->, Python docstrings). A line with code before its comment counts as code.
  • The base is the first of origin/main, main, origin/master and master that exists. Untracked files count as added.
  • In a narrow terminal the row shortens its labels, then shows only added lines.