mdsami

Repo Metrics — Git skill for Claude Code

Git community

Claude Code skill: code-metrics dashboard for any git repo (branches, merged PRs, development span, contributors, LOC).

How to install Repo Metrics

This entry records only its repository, not the path inside it, so there is no exact command to give. Open mdsami/repo-metrics and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Repo Metrics does

Claude Code skill: code-metrics dashboard for any git repo (branches, merged PRs, development span, contributors, LOC).

Alternatives in Git

  • Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
  • Worktree Parallel Init — Create multiple git worktrees for parallel development: $ARGUMENTS 23.4k ★
  • Create Worktrees — by evmts - Creates git worktrees for all open PRs or specific branches, handling branches with slashes, cleani 440 ★

README

repo-metrics icon

repo-metrics

A Claude Code skill that builds a code-metrics dashboard for any git repository:

  • Development span: the first and last commit, active days, and commits per month
  • Branches: every remote branch, with its merge status and the lines changed since it split from its trunk
  • Pull requests: merged and closed counts, plus breakdowns by author and by target branch (via gh)
  • Contributors: commits, lines added and deleted, and active dates per person, with identity merging. AI assistants and bots are left out of the head count.
  • Lines of code by file type for each trunk

Lockfiles, build output, source maps, images and fonts are left out of every line count.

Install

Anyone can install it in Claude Code with:

/plugin install repo-metrics --marketplace mdsami/repo-metrics

On older versions of Claude Code (before 2.1.275), add the marketplace first:

/plugin marketplace add mdsami/repo-metrics
/plugin install repo-metrics@mdsami-skills

Restart Claude Code if the skill doesn't appear straight away. To get later versions, run `/plugin marketplace update mdsami-skills`. To remove it, run `/plugin uninstall repo-metrics@mdsami-skills`.

Usage

Open Claude Code inside the git repository you want to measure, then either type the command:

/repo-metrics

or ask in your own words, for example:

  • "Lines of code metrics for all branches and merged PRs, development span, contributor report"
  • "Who contributed most to this repo, and over what period?"
  • "How many branches are still unmerged, and how big are they?"

Claude then:

  1. Fetches every remote branch (git fetch --all --prune).
  2. Finds the trunks: the default branch, plus any long-lived branch that most PRs target.
  3. Runs collect.py, then merges author names that share an email address into one person. It keeps people separate when u