- CLAUDE.md: Klare Modell-Strategie (Opus für Planung/Review, Sonnet für Impl., Haiku für Tests) - Agents und Skills: konsistente Modellangaben (n8n-architect, plan-reviewer, go/SKILL, plan-review/SKILL) - Statusline: sichere Fehlerbehandlung bei fehlenden Befehlen (jq, secret-tool) - pre-bash-checks.sh: robustere Validierungen (-n statt -z für Präsenzprüfung), vermeidung von edge cases - phase-4-implementierung.md: Konsistenz in der Workflow-Beschreibung Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.5 KiB
Bash
45 lines
1.5 KiB
Bash
#!/bin/bash
|
|
set -eo pipefail
|
|
|
|
input=$(cat)
|
|
|
|
IFS=$'\t' read -r current_dir model total_input total_output context_size used_percent cost_usd < <(
|
|
echo "$input" | jq -r '[
|
|
.workspace.current_dir // "",
|
|
.model.display_name // "?",
|
|
(.context_window.total_input_tokens // 0),
|
|
(.context_window.total_output_tokens // 0),
|
|
(.context_window.context_window_size // 200000),
|
|
((.context_window.used_percentage // 0) | floor),
|
|
(.cost.total_cost_usd // 0)
|
|
] | @tsv'
|
|
)
|
|
|
|
total_tokens=$(( (total_input + total_output) / 1000 ))
|
|
context_limit_k=$(( context_size / 1000 ))
|
|
|
|
cost_formatted=$(LC_NUMERIC=C awk "BEGIN {
|
|
cents = int($cost_usd * 100 + 0.5)
|
|
if (cents < 100) printf \"%d¢\", cents
|
|
else printf \"\$%.2f\", $cost_usd
|
|
}")
|
|
|
|
user=$(whoami)
|
|
host=$(hostname -s)
|
|
|
|
git_branch=""
|
|
if [ -n "$current_dir" ] && git -C "$current_dir" rev-parse --git-dir > /dev/null 2>&1; then
|
|
branch=$(git -C "$current_dir" branch --show-current 2>/dev/null)
|
|
[ -n "$branch" ] && git_branch=" \033[33m($branch)\033[00m"
|
|
fi
|
|
|
|
chroot_prefix=""
|
|
if [ -r /etc/debian_chroot ]; then
|
|
chroot_prefix="($(cat /etc/debian_chroot))"
|
|
fi
|
|
|
|
printf "${chroot_prefix}\033[32m${user}@${host}\033[00m:\033[34m${current_dir}\033[00m${git_branch}"
|
|
printf " \033[90m|\033[00m \033[36m${model}\033[00m"
|
|
printf " \033[90m|\033[00m \033[35m${total_tokens}K/${context_limit_k}K (${used_percent}%%)\033[00m"
|
|
printf " \033[90m|\033[00m \033[33m${cost_formatted}\033[00m"
|