Keep on to blur preview images; turn off to show them clearly


🧠在家居士 | 🥦素食者 | 🏃🏻马拉松爱好者 | 💰省钱小能手 | 搭🪜技术资深学者 | 👨💻科技宅 | 🆕更新狂 | 🆅 六边型战五渣


🍎 Founder of @proxyman_app - Capture HTTP(s) in a few clicks 💻 Build apps for developers ⚡️ TinyShield: Monitor your network

![自定义ClaudeCode 的statusline,感受花钱的爽感!/statusline 命令设置,如需抄作业,我的脚本如下:
#!/bin/bash
# ============================================================================
# CLAUDE CODE STATUS PANEL - CYBERPUNK ASCII ART EDITION
# ============================================================================
input=$(cat)
# --[ DATA EXTRACTION ]-------------------------------------------------------
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0 | . * 100 | floor / 100')
lines_add=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
lines_del=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
api_ms=$(echo "$input" | jq -r '.cost.total_api_duration_ms // 0')
model=$(echo "$input" | jq -r '.model.display_name // "—"')
# --[ TIME FORMAT ]-----------------------------------------------------------
api_s=$((api_ms / 1000))
# --[ ANSI COLOR CODES ]------------------------------------------------------
# Hermès 爱马仕配色
BG_HERMES='\033[48;5;29m'
FG_HERMES_GREEN='\033[38;5;29m'
FG_HERMES_ORANGE='\033[38;5;208m'
FG_WHITE='\033[38;5;255m'
FG_BLACK='\033[38;5;232m'
FG_GRAY='\033[38;5;245m'
BOLD='\033[1m'
RESET='\033[0m'
# --[ CYBERPUNK ASCII PANEL ]-------------------------------------------------
# 固定宽度 26 字符
W=26
# --[ LINE 1: HEADER ]--
cwd_name=$(basename "$(echo "$input" | jq -r '.cwd // "CLAUDE"')")
header=" ░░▒▒▓▓██${cwd_name}██▓▓▒▒░░ "
header_len=${#header}
pad=$((W - header_len))
printf "\n"
printf "${BG_HERMES}${FG_BLACK}${BOLD}%s%*s${RESET}\n" "$header" $pad ""
# --[ LINE 2: METRICS ]--
printf " ${FG_HERMES_ORANGE}💰 \$${cost}${RESET}"
printf " ${FG_GRAY}│${RESET}"
printf " ${FG_HERMES_GREEN}+${lines_add}${RESET} ${FG_HERMES_ORANGE}-${lines_del}${RESET}"
printf " ${FG_GRAY}│${RESET}"
printf " ${FG_WHITE}${model}${RESET}"
printf "\n"
# --[ LINE 3: FOOTER ]--
# 从 transcript 文件解析 token 数据
transcript=$(echo "$input" | jq -r '.transcript_path // ""')
if [[ -n "$transcript" && -f "$transcript" ]]; then
in_tokens=$(jq -s '[.[] | select(.type == "assistant") | .message.usage.input_tokens // 0] | add // 0' "$transcript" 2>/dev/null)
out_tokens=$(jq -s '[.[] | select(.type == "assistant") | .message.usage.output_tokens // 0] | add // 0' "$transcript" 2>/dev/null)
in_tokens=${in_tokens:-0}
out_tokens=${out_tokens:-0}
else
in_tokens=0
out_tokens=0
fi
# 格式化函数
fmt_tokens() {
local t=$1
if [[ $t -ge 1000000 ]]; then
echo "$(echo "scale=1; $t / 1000000" | bc)M"
elif [[ $t -ge 1000 ]]; then
echo "$(echo "scale=1; $t / 1000" | bc)k"
else
echo "$t"
fi
}
in_fmt=$(fmt_tokens $in_tokens)
out_fmt=$(fmt_tokens $out_tokens)
footer=" ░▒▓ ↑${in_fmt} ↓${out_fmt} ▓▒░ "
footer_len=${#footer}
pad_total=$((W - footer_len))
pad_left=$((pad_total / 2))
pad_right=$((pad_total - pad_left))
printf "${BG_HERMES}${FG_BLACK}${BOLD}%*s%s%*s${RESET}\n" $pad_left "" "$footer" $pad_right "" 自定义ClaudeCode 的statusline,感受花钱的爽感!/statusline 命令设置,如需抄作业,我的脚本如下:
#!/bin/bash
# ============================================================================
# CLAUDE CODE STATUS PANEL - CYBERPUNK ASCII ART EDITION
# ============================================================================
input=$(cat)
# --[ DATA EXTRACTION ]-------------------------------------------------------
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0 | . * 100 | floor / 100')
lines_add=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
lines_del=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
api_ms=$(echo "$input" | jq -r '.cost.total_api_duration_ms // 0')
model=$(echo "$input" | jq -r '.model.display_name // "—"')
# --[ TIME FORMAT ]-----------------------------------------------------------
api_s=$((api_ms / 1000))
# --[ ANSI COLOR CODES ]------------------------------------------------------
# Hermès 爱马仕配色
BG_HERMES='\033[48;5;29m'
FG_HERMES_GREEN='\033[38;5;29m'
FG_HERMES_ORANGE='\033[38;5;208m'
FG_WHITE='\033[38;5;255m'
FG_BLACK='\033[38;5;232m'
FG_GRAY='\033[38;5;245m'
BOLD='\033[1m'
RESET='\033[0m'
# --[ CYBERPUNK ASCII PANEL ]-------------------------------------------------
# 固定宽度 26 字符
W=26
# --[ LINE 1: HEADER ]--
cwd_name=$(basename "$(echo "$input" | jq -r '.cwd // "CLAUDE"')")
header=" ░░▒▒▓▓██${cwd_name}██▓▓▒▒░░ "
header_len=${#header}
pad=$((W - header_len))
printf "\n"
printf "${BG_HERMES}${FG_BLACK}${BOLD}%s%*s${RESET}\n" "$header" $pad ""
# --[ LINE 2: METRICS ]--
printf " ${FG_HERMES_ORANGE}💰 \$${cost}${RESET}"
printf " ${FG_GRAY}│${RESET}"
printf " ${FG_HERMES_GREEN}+${lines_add}${RESET} ${FG_HERMES_ORANGE}-${lines_del}${RESET}"
printf " ${FG_GRAY}│${RESET}"
printf " ${FG_WHITE}${model}${RESET}"
printf "\n"
# --[ LINE 3: FOOTER ]--
# 从 transcript 文件解析 token 数据
transcript=$(echo "$input" | jq -r '.transcript_path // ""')
if [[ -n "$transcript" && -f "$transcript" ]]; then
in_tokens=$(jq -s '[.[] | select(.type == "assistant") | .message.usage.input_tokens // 0] | add // 0' "$transcript" 2>/dev/null)
out_tokens=$(jq -s '[.[] | select(.type == "assistant") | .message.usage.output_tokens // 0] | add // 0' "$transcript" 2>/dev/null)
in_tokens=${in_tokens:-0}
out_tokens=${out_tokens:-0}
else
in_tokens=0
out_tokens=0
fi
# 格式化函数
fmt_tokens() {
local t=$1
if [[ $t -ge 1000000 ]]; then
echo "$(echo "scale=1; $t / 1000000" | bc)M"
elif [[ $t -ge 1000 ]]; then
echo "$(echo "scale=1; $t / 1000" | bc)k"
else
echo "$t"
fi
}
in_fmt=$(fmt_tokens $in_tokens)
out_fmt=$(fmt_tokens $out_tokens)
footer=" ░▒▓ ↑${in_fmt} ↓${out_fmt} ▓▒░ "
footer_len=${#footer}
pad_total=$((W - footer_len))
pad_left=$((pad_total / 2))
pad_right=$((pad_total - pad_left))
printf "${BG_HERMES}${FG_BLACK}${BOLD}%*s%s%*s${RESET}\n" $pad_left "" "$footer" $pad_right ""](/_next/image?url=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FG66GyKZWEAAlFM9.jpg&w=3840&q=75)
产品🎬 https://t.co/Xd1e236W65 顾问服务💬 https://t.co/UVx8yZHIBo 课程📖 https://t.co/T13Crt8lg5


Invented principles of meta-learning (1987), GANs (1990), Transformers (1991), very deep learning (1991), etc. Our AI is used many billions of times every day.


