From 865a1923f53ad9205448265b26af3d24d04fb23b Mon Sep 17 00:00:00 2001 From: Bas Grolleman Date: Sat, 4 Jul 2026 14:47:22 +0200 Subject: [PATCH] Adding claude config --- claude/settings.json | 45 +++++++++++++++++++++- claude/statusline-command.sh | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 claude/statusline-command.sh diff --git a/claude/settings.json b/claude/settings.json index a8b5a88..1bed264 100644 --- a/claude/settings.json +++ b/claude/settings.json @@ -1,5 +1,7 @@ { - "theme": "dark", + "permissions": { + "defaultMode": "auto" + }, "hooks": { "Stop": [ { @@ -21,5 +23,46 @@ ] } ] + }, + "statusLine": { + "type": "command", + "command": "bash \"/home/bgrolleman/.claude/statusline-command.sh\"" + }, + "enabledPlugins": { + "frontend-design@claude-plugins-official": true, + "lua-lsp@claude-plugins-official": true, + "ponytail@ponytail": true + }, + "extraKnownMarketplaces": { + "ponytail": { + "source": { + "source": "github", + "repo": "DietrichGebert/ponytail" + } + }, + "caveman": { + "source": { + "source": "github", + "repo": "juliusbrussee/caveman" + } + } + }, + "effortLevel": "high", + "advisorModel": "opus", + "voice": { + "enabled": true, + "mode": "hold" + }, + "theme": "dark", + "agentPushNotifEnabled": true, + "skipAutoPermissionPrompt": true, + "voiceEnabled": true, + "mcpServers": { + "comfyui-image-gen": { + "command": "/home/bgrolleman/Project/ComfyUI/.venv/bin/python", + "args": [ + "/home/bgrolleman/Project/ComfyUI/mcp_server.py" + ] + } } } diff --git a/claude/statusline-command.sh b/claude/statusline-command.sh new file mode 100644 index 0000000..9dca9ba --- /dev/null +++ b/claude/statusline-command.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# Claude Code status line +# Shows: model display name, a progress bar for context-window tokens +# remaining in this session, current git branch, active subagent (if any), +# and enabled plugins (read from ~/.claude/settings.json). + +input=$(cat) + +model=$(echo "$input" | jq -r '.model.display_name // "unknown"') +cwd=$(echo "$input" | jq -r '.workspace.current_dir // empty') +remaining=$(echo "$input" | jq -r '.context_window.remaining_percentage // empty') +agent_name=$(echo "$input" | jq -r '.agent.name // empty') + +# --- Colors (kept modest; Claude Code renders the status line dimmed) --- +c_model='\033[36m' # cyan +c_bar='\033[32m' # green +c_branch='\033[33m' # yellow +c_agent='\033[35m' # magenta +c_plugin='\033[34m' # blue +c_reset='\033[0m' + +# --- Git branch (skip optional locks; silent if not a repo) --- +branch="" +if [ -n "$cwd" ]; then + branch=$(git --no-optional-locks -C "$cwd" branch --show-current 2>/dev/null) +fi + +# --- Enabled plugins, read from settings.json (not present on stdin) --- +settings_file="$HOME/.claude/settings.json" +plugins="" +if [ -f "$settings_file" ]; then + plugins=$(jq -r '.enabledPlugins // {} | to_entries[] | select(.value == true) | .key | split("@")[0]' "$settings_file" 2>/dev/null | paste -sd, -) +fi + +# --- Context-window remaining-tokens progress bar --- +bar="" +if [ -n "$remaining" ]; then + pct=${remaining%.*} + [ -z "$pct" ] && pct=0 + [ "$pct" -lt 0 ] 2>/dev/null && pct=0 + [ "$pct" -gt 100 ] 2>/dev/null && pct=100 + total_blocks=10 + filled=$(( pct * total_blocks / 100 )) + [ "$filled" -gt "$total_blocks" ] && filled=$total_blocks + [ "$filled" -lt 0 ] && filled=0 + empty=$(( total_blocks - filled )) + bar="[" + i=0 + while [ "$i" -lt "$filled" ]; do bar="${bar}█"; i=$((i + 1)); done + i=0 + while [ "$i" -lt "$empty" ]; do bar="${bar}░"; i=$((i + 1)); done + bar="${bar}] ${pct}% left" +fi + +# --- Assemble the status line --- +printf "${c_model}%s${c_reset}" "$model" + +if [ -n "$bar" ]; then + printf " ${c_bar}%s${c_reset}" "$bar" +fi + +if [ -n "$branch" ]; then + printf " ${c_branch}git:%s${c_reset}" "$branch" +fi + +if [ -n "$agent_name" ]; then + printf " ${c_agent}agent:%s${c_reset}" "$agent_name" +fi + +if [ -n "$plugins" ]; then + printf " ${c_plugin}plugins:%s${c_reset}" "$plugins" +fi + +printf '\n'