给 Claude Code 的状态栏整整容:一条命令把模型、花费、Git 状态全塞进去

Type: article
Author: unknown
Primary Topic: Claude Code 状态栏自定义配置
Ingested: 2026-04-28

Summary

本文介绍如何通过 Claude Code 的 statusLine 配置项运行自定义 Shell 脚本,将模型名称、当前目录、上下文使用率、费用、耗时及 Git 分支状态集成到底部状态栏。脚本通过 stdin 接收会话 JSON 数据,使用 jq 解析后格式化输出,并对 Git 状态做 5 秒缓存优化性能。配置简单,只需在 settings.json 中指定脚本路径即可生效。

Key Concepts

Entities

Source

Relations


Auto-generated on 2026-04-28