Skip to main content
statuslinesSource-backed

git-machete Branch Hygiene Statusline

Claude Code statusline that uses git-machete branch layout data to show whether the current branch is managed, how many branches are outside the layout, and when fork-point overrides need review.

by MkDev11·added 2026-06-04·
Language:bash
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://git-machete.readthedocs.io/en/stable/, https://github.com/VirtusLab/git-machete
Safety notes
This statusline is read-only and does not run git-machete update, traverse, rebase, push, or pull., Unmanaged branches and fork-point overrides are review cues; inspect git-machete status before changing stacked branches., The compact output intentionally avoids automated branch repair because stacked-branch workflows can rewrite history.
Privacy notes
The script prints the current branch name and aggregate branch-layout counts., Branch names can reveal ticket IDs, customers, incidents, or release names in terminal screenshots., It reads local branch layout metadata and does not print commit messages, remote URLs, or file paths.
Author
MkDev11
Submitted by
MkDev11
Claim status
unclaimed
Last verified
2026-06-04

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Config edit

Copy-ready — paste the snippet to get started.

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Prerequisite readiness

Prerequisite readiness

3 prerequisites to line up before setup.

0/3 ready
Install & runtime1Network & hosting1General1

Safety & privacy surface

Safety & privacy surface

3 safety and 3 privacy notes across 4 risk areas. Review closely: network access.

4 areas
  • SafetyExecution & processesThis statusline is read-only and does not run git-machete update, traverse, rebase, push, or pull.
  • SafetyGeneralUnmanaged branches and fork-point overrides are review cues; inspect git-machete status before changing stacked branches.
  • SafetyData retentionThe compact output intentionally avoids automated branch repair because stacked-branch workflows can rewrite history.
  • PrivacyExecution & processesThe script prints the current branch name and aggregate branch-layout counts.
  • PrivacyGeneralBranch names can reveal ticket IDs, customers, incidents, or release names in terminal screenshots.
  • PrivacyNetwork accessIt reads local branch layout metadata and does not print commit messages, remote URLs, or file paths.

Safety notes

  • This statusline is read-only and does not run git-machete update, traverse, rebase, push, or pull.
  • Unmanaged branches and fork-point overrides are review cues; inspect git-machete status before changing stacked branches.
  • The compact output intentionally avoids automated branch repair because stacked-branch workflows can rewrite history.

Privacy notes

  • The script prints the current branch name and aggregate branch-layout counts.
  • Branch names can reveal ticket IDs, customers, incidents, or release names in terminal screenshots.
  • It reads local branch layout metadata and does not print commit messages, remote URLs, or file paths.

Prerequisites

  • Git and git-machete installed and available as git-machete.
  • A repository with a .git/machete branch layout for full managed-branch reporting.
  • A moderate statusline refresh interval so branch-layout scans do not run too often in very large repositories.

Schema details

Install type
config
Troubleshooting
No
Source repository stats
Scope
Source repo
Runtime and command metadata
Script language
bash
Script body
#!/usr/bin/env bash
set -u

count_lines() {
  sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
}

main() {
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  echo "machete: no repository"
  exit 0
fi
if ! command -v git-machete >/dev/null 2>&1; then
  echo "machete: command missing"
  exit 0
fi

branch=$(git branch --show-current 2>/dev/null)
if [ -z "$branch" ]; then
  branch="detached"
fi

layout=$(git rev-parse --git-path machete 2>/dev/null || true)
if [ -z "$layout" ] || [ ! -s "$layout" ]; then
  printf 'machete: %s | no layout | discover\n' "$branch"
  exit 0
fi

managed=$(git-machete list managed 2>/dev/null | count_lines)
unmanaged=$(git-machete list unmanaged 2>/dev/null | count_lines)
overrides=$(git-machete list with-overridden-fork-point 2>/dev/null | count_lines)

if git-machete is-managed "$branch" >/dev/null 2>&1; then
  current="managed"
else
  current="unmanaged"
fi

if [ "$branch" = "detached" ]; then
  state="review"
elif [ "$current" = "unmanaged" ]; then
  state="add branch"
elif [ "$overrides" -gt 0 ]; then
  state="fork-point"
elif [ "$unmanaged" -gt 0 ]; then
  state="review"
else
  state="ok"
fi

printf 'machete: %s | %s | branches %s | unmanaged %s | overrides %s | %s\n' "$branch" "$current" "$managed" "$unmanaged" "$overrides" "$state"
}

case $- in
  *n*) ;;
  *) main "$@" ;;
esac
Full copyable content
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-machete-branch-hygiene-statusline.sh"
  }
}

About this resource

Source notes

  • git-machete documents a branch layout file, git machete status, git machete is-managed, and git machete list categories such as managed, unmanaged, and with-overridden-fork-point.
  • This statusline invokes git-machete directly for those branch-layout commands to summarize stacked-branch hygiene without calling plain Git upstream-count manuals or mutating branch history.

Duplicate check

Checked existing statuslines, live HeyClaude statuslines, open pull requests, and repository content for git-machete-branch-hygiene-statusline, git-machete, branch hygiene, upstream drift, ahead/behind, and Git status statuslines. The earlier Git upstream drift draft used Git manual sources adjacent to the existing git-status-statusline; this replacement uses git-machete with a different canonical source, branch-layout scope, and value proposition.

Disclosure

Editorial statusline recipe. No paid placement or affiliate link is used.

Source citations

Add this badge to your README

Show that git-machete Branch Hygiene Statusline is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/statuslines/git-machete-branch-hygiene-statusline.svg)](https://heyclau.de/entry/statuslines/git-machete-branch-hygiene-statusline)

How it compares

git-machete Branch Hygiene Statusline side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

Claude Code statusline that uses git-machete branch layout data to show whether the current branch is managed, how many branches are outside the layout, and when fork-point overrides need review.

Open dossier

Git-focused statusline showing branch, dirty status, ahead/behind indicators, and stash count alongside Claude session info

Open dossier

Claude Code statusline that uses simple-git status data to show dirty worktree risk, staged changes, untracked files, and merge conflicts.

Open dossier

Claude Code statusline that surfaces sensitive environment-file risk and can optionally run git-secrets as a local pre-commit-style scanner.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersMkDev11MkDev11MkDev11
Install riskReview firstReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
Brand
Categorystatuslinesstatuslinesstatuslinesstatuslines
SourceSource-backedSource-backedSource-backedSource-backed
AuthorMkDev11JSONboredMkDev11MkDev11
Added2026-06-042025-10-012026-06-042026-06-04
Platforms
Harness
Source repo
Safety notesThis statusline is read-only and does not run git-machete update, traverse, rebase, push, or pull. Unmanaged branches and fork-point overrides are review cues; inspect git-machete status before changing stacked branches. The compact output intentionally avoids automated branch repair because stacked-branch workflows can rewrite history.Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session.This is a read-only review aid; inspect the actual diff before committing, rebasing, merging, or discarding files. Frequent statusline refreshes can still run Git status often in large repositories, so use a moderate refresh interval. Treat split staged/dirty state and conflict counts as stop-and-review cues before automated edits.The default mode does not scan file contents; it only counts sensitive-looking environment files in Git status. Enable recursive git-secrets scanning only in repositories where you are authorized to inspect all files. Scanner mode invokes the git-secrets executable directly and does not fall back to Git aliases. Treat any scan warning as a stop-and-review signal before committing, sharing logs, or opening a PR.
Privacy notesThe script prints the current branch name and aggregate branch-layout counts. Branch names can reveal ticket IDs, customers, incidents, or release names in terminal screenshots. It reads local branch layout metadata and does not print commit messages, remote URLs, or file paths.Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine.The statusline prints aggregate counts and the branch name, not file paths, diff hunks, or commit messages. Branch names can reveal ticket IDs, customer names, incident labels, or release names in screenshots. The simple-git library shells out to local Git; any custom Git wrappers or hooks are outside this script's control.The default output prints counts only and does not print filenames or matched values. Recursive scans read repository files and may inspect sensitive local material. Terminal recordings can still reveal that a workspace contains sensitive environment files.
Prerequisites
  • Git and git-machete installed and available as git-machete.
  • A repository with a .git/machete branch layout for full managed-branch reporting.
  • A moderate statusline refresh interval so branch-layout scans do not run too often in very large repositories.
  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations and string manipulation)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • Git installed and accessible in PATH (git 2.0+ recommended for symbolic-ref and rev-list commands)
  • Node.js available in the shell used by the statusline command.
  • simple-git installed in the project or statusline script directory, for example with npm install --save-dev simple-git.
  • Git installed and the command run from a repository worktree for full status output.
  • Git installed and the command run from a repository worktree.
  • Optional git-secrets installed if GIT_SECRETS_STATUSLINE_SCAN is set to 1.
  • A slower refresh interval when optional scanning is enabled, because recursive scans can be expensive.
Install
Config
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-machete-branch-hygiene-statusline.sh"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-status-statusline.sh",
    "refreshInterval": 1000
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "node $CLAUDE_PROJECT_DIR/.claude/statuslines/simple-git-worktree-risk-statusline.cjs"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-secrets-env-risk-statusline.sh"
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.