第 8 期:Git 状态与工具活动

⏱ 预计阅读 4 分钟 更新于 2026/5/7
💡 进群学习加 wx: agentupdate
(申请发送: agentupdate)

本期核心:让你实时看到 Claude 在做什么——编辑哪个文件、运行哪个 Agent、完成了几个 Todo。


8.1 Git 状态显示

[Opus] │ my-project git:(main* !3 +1 ?2 ↑2 ↓1)
符号 含义
* 有未提交更改
!3 3 个已修改文件
+1 1 个新增/暂存文件
已删除文件(0 时省略)
?2 2 个未跟踪文件
↑2 领先远程 2 个提交
↓1 落后远程 1 个提交

8.2 Git 配置

{
  "gitStatus": {
    "enabled": true,
    "showDirty": true,
    "showAheadBehind": true,
    "showFileStats": true,
    "pushWarningThreshold": 5,
    "pushCriticalThreshold": 10,
    "branchOverflow": "truncate"
  }
}
配置 说明
showDirty 显示 * 标记
showAheadBehind 显示 ↑N ↓N
showFileStats 显示 !M +A ✘D ?U
pushWarningThreshold 未推送提交数 ≥N 时变黄
pushCriticalThreshold 未推送提交数 ≥N 时变红

8.3 工具活动行

启用 showTools: true 后:

◐ Edit: auth.ts | ✓ Read ×3 | ✓ Grep ×2
信息 含义
◐ Edit: auth.ts 正在编辑 auth.ts
✓ Read ×3 已完成 3 次 Read
✓ Grep ×2 已完成 2 次 Grep

8.4 Agent 状态行

启用 showAgents: true 后:

◐ explore [haiku]: Finding auth code (2m 15s)
信息 含义
explore Agent 名称
[haiku] 使用的模型
Finding auth code 当前任务描述
(2m 15s) 已运行时长

8.5 Todo 进度行

启用 showTodos: true 后:

▸ Fix authentication bug (2/5)
信息 含义
当前进行中的任务
Fix authentication bug 任务名称
(2/5) 已完成 2/共 5 个任务

下期预告:第 9 期探索 HUD 的高级功能——缓存倒计时、费用显示、输出速度、自定义颜色等。