Skip to content

Instantly share code, notes, and snippets.

@atemate
Created February 3, 2026 22:12
Show Gist options
  • Select an option

  • Save atemate/65299c629e9580a276cce3a5ebbfaf68 to your computer and use it in GitHub Desktop.

Select an option

Save atemate/65299c629e9580a276cce3a5ebbfaf68 to your computer and use it in GitHub Desktop.
My ~/.claude/ configuration
{
"attribution": {
"commit": "",
"pr": ""
},
"includeCoAuthoredBy": false,
"model": "claude-opus-4-5@20251101",
"hooks": {
"PreCompact": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bd prime"
}
]
}
],
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bd prime"
}
]
}
]
},
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 0
},
"enabledPlugins": {
"commit-commands@claude-plugins-official": true,
"pyright-lsp@claude-plugins-official": true,
"gopls-lsp@claude-plugins-official": true
}
}
#!/bin/bash
# Read JSON input once
input=$(cat)
# Helper functions for common extractions
get_model_name() { echo "$input" | jq -r '.model.display_name'; }
get_current_dir() { echo "$input" | jq -r '.workspace.current_dir'; }
get_project_dir() { echo "$input" | jq -r '.workspace.project_dir'; }
get_version() { echo "$input" | jq -r '.version'; }
get_cost() { echo "$input" | jq -r '.cost.total_cost_usd | . * 1000 | round / 1000'; }
get_duration() { echo "$input" | jq -r '.cost.total_duration_ms'; }
get_lines_added() { echo "$input" | jq -r '.cost.total_lines_added'; }
get_lines_removed() { echo "$input" | jq -r '.cost.total_lines_removed'; }
get_input_tokens() { echo "$input" | jq -r '.context_window.total_input_tokens'; }
get_output_tokens() { echo "$input" | jq -r '.context_window.total_output_tokens'; }
get_context_window_size() { echo "$input" | jq -r '.context_window.context_window_size'; }
get_used_percent() { echo "$input" | jq -r '.context_window.used_percentage // 0'; }
get_remaining_percent() { echo "$input" | jq -r '.context_window.remaining_percentage // 100'; }
get_worktree_path() {
local current_dir
current_dir=$(get_current_dir)
# Get the worktree path if in a worktree
if [ -d "$current_dir/.git" ] && [ -f "$current_dir/.git" ]; then
# This is a worktree, extract the worktree path
local worktree_path
worktree_path=$(git -C "$current_dir" rev-parse --show-toplevel 2>/dev/null)
if [ -n "$worktree_path" ]; then
# Make it relative to home directory
echo "$worktree_path" | sed "s|^$HOME|~|"
fi
elif [ -d "$current_dir/.git/worktrees" ]; then
# This is the main repo with worktrees
echo "$current_dir" | sed "s|^$HOME|~|"
else
# Regular git repo or no worktree
local git_dir
git_dir=$(git -C "$current_dir" rev-parse --show-toplevel 2>/dev/null)
if [ -n "$git_dir" ]; then
echo "$git_dir" | sed "s|^$HOME|~|"
fi
fi
}
echo "[$(get_model_name)] +$(get_lines_added) -$(get_lines_removed) ↑$(get_output_tokens) ↓$(get_input_tokens) | $(get_used_percent)..$(get_remaining_percent)% \$$(get_cost) | $(get_worktree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment