Skip to content

Instantly share code, notes, and snippets.

@colbyfayock
Created February 28, 2026 04:03
Show Gist options
  • Select an option

  • Save colbyfayock/127201ed03690474a8ee10396036bd6f to your computer and use it in GitHub Desktop.

Select an option

Save colbyfayock/127201ed03690474a8ee10396036bd6f to your computer and use it in GitHub Desktop.
#!/bin/bash
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
COST=$(printf '%.2f' "$(echo "$input" | jq -r '.cost.total_cost_usd // 0')")
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0 | floor')
GIT_ROOT=$(git -C "$DIR" rev-parse --show-toplevel 2>/dev/null)
if [ -n "$GIT_ROOT" ]; then
WORKTREE=$(basename "$(dirname "$GIT_ROOT")")
REPO=$(basename "$DIR")
BRANCH=$(git -C "$GIT_ROOT" branch --show-current 2>/dev/null)
STAGED=$(git -C "$GIT_ROOT" diff --cached --numstat 2>/dev/null | wc -l | tr -d ' ')
MODIFIED=$(git -C "$GIT_ROOT" diff --numstat 2>/dev/null | wc -l | tr -d ' ')
echo "${WORKTREE} · ${REPO} · ${BRANCH}"
else
echo "$(basename "$DIR")"
fi
echo "${MODEL} · ${PCT}% · \$${COST}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment