git is the universe of tools where the right command exists for nearly anything you'd ever want to do — and finding it takes longer than the task itself. Six worked examples below; each is a question you'd actually ask out loud.
1. Commits I haven't pushed yet
clai
$ clai show commits in this branch that I haven't pushed→ git log --oneline @{u}..HEADb3e1c20 Add cache invalidationa1f0902 Fix flaky test
2. When was this branch last merged into main
clai
$ clai when was this branch last merged into main→ git log --merges --grep="$(git rev-parse --abbrev-ref HEAD)" main --pretty='%h %ci %s' | headde1a4f7 2026-04-22 11:14 Merge feature/cache into main
3. Largest files in history
clai
$ clai find the 10 largest files in this repo's git history→ git rev-list --objects --all \ | git cat-file --batch-check='%(objectsize) %(rest)' \ | sort -nr | head -1014823432 assets/raw.tar8847820 data/seed.json
This one is the reason a tool like CliAI exists. Nobody types this from memory.
4. Who last touched line 142 of this file
clai
$ clai who last edited line 142 of src/server.rs→ git blame -L 142,142 src/server.rsa1f0902 (Alice 2026-04-12) ensure_capacity(buf);
5. Branches abandoned for 90 days
clai
$ clai list local branches with no commits in the last 90 days→ for b in $(git for-each-ref --format='%(refname:short)' refs/heads/); do age=$(git log -1 --format='%ct' "$b") if (( $(date +%s) - age > 7776000 )); then echo "$b"; fi donefeature/old-cache-pocspike/2025-routing
6. Verify signed commits in a range
clai
$ clai check signatures of all commits between v2.4 and v2.5→ git log --show-signature v2.4..v2.5commit ab12cd3 ...gpg: Good signature from "Alice <[email protected]>"
See also
- From one-liner to script — when the same git incantation comes up weekly and earns its place in
scripts/. - Onboarding to a team's stack — git plumbing is one of the slowest things to acquire as a new engineer.