Code Momentum is a tiny Python CLI for analyzing Git activity rhythm: active days, longest streaks, commit distribution, and JSON reports.
The repository includes a 2025 sample activity dataset so the CLI has real history to analyze immediately.
GitHub's contribution graph is useful, but it is not very explainable. Code Momentum gives you a local, scriptable report that answers practical questions:
- How many active days did this repo have?
- What was the longest commit streak?
- How random or consistent were commit counts per day?
- Can the activity report be exported for docs, dashboards, or personal retrospectives?
python -m code_momentum.cli --year 2025Optional editable install:
python -m pip install -e .
code-momentum --year 2025Code Momentum Report
====================
Total commits: 919
Active days: 237
First day: 2025-01-03
Last day: 2025-12-20
Longest streak: 222 days (2025-02-03 to 2025-09-12)
Commits per active day: 1 to 7
Average commits per active day: 3.88
- Dependency-free Python CLI.
- Reads real Git author dates from any local repository.
- Calculates active days, first/last day, longest streak, and commit count distribution.
- Supports year filtering.
- Exports machine-readable JSON.
- Includes unit tests and GitHub Actions CI.
python -m code_momentum.cli --year 2025
python -m code_momentum.cli --year 2025 --json
python -m code_momentum.cli --year 2025 --output docs/sample-report.json
python -m code_momentum.cli --source checkpoints --year 2025code_momentum/contains the CLI and analyzer logic.tests/covers streak and distribution calculations.activity/log-2025.mdrecords sample progress notes.data/checkpoints.jsonlstores sample machine-readable checkpoints.docs/usage.mdshows practical commands.docs/growth-playbook.mdlists next steps for making the project more useful.
python -m code_momentum.cli --year 2025
python -m unittest discover -s tests- Add weekly and monthly summaries.
- Add CSV export.
- Add author filtering for team repositories.
- Add terminal charts for activity distribution.
- Add a GitHub Actions workflow that publishes a report artifact.