iT邦幫忙

2025 iThome 鐵人賽

DAY 22
0
生成式 AI

我與 AI Pair Programming系列 第 22

我與 Claude Code pair:組合工具包 —— Status Line 與 Output Style

  • 分享至 

  • xImage
  •  

今天會是 Claude Code 最後的工具分享,雖然不是我 pair 過程中最核心的工具,但熟練地使用它能夠幫我們創造出更好的 pair 體驗!

Status Line

Status line 是最近幾版新推出的功能,可以讓我們自定義 Claude Code 介面最底部的內容。
想要建立的話,可以透過 /statusline 請 Claude Code 幫忙建立:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635KpbwGxh7HI.png

完成後可以看到類似的內容:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635huZCnjbcPX.png

圖片中最後的金額我是透過 ccusage 這個套件提供的指令做到的。這是一個滿知名的套件,他會根據你的歷史紀錄來推斷你目前的 Claude Code 使用量是多少:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635kYrizX5yn7.png

Status Line 設定寫在哪?

通常來說, status line 的位置會直接放在 settings.json 上:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635TfUvWDhLIs.png

但因為幾乎所有關於 Claude Code 的設定都在那個檔案裡,因此那個檔案會變得越來越肥,讀取和修改的成本會增加。從修改的地方中我們可以看到,其實他是去執行一個 bash 的命令:
https://ithelp.ithome.com.tw/upload/images/20251006/2015163547rZasvrro.png

因此,可以請 Claude Code 幫我們抽成獨立的檔案,之後要修改也會比較方便:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635HcPmUygo81.png

Output Style

這也是最近幾版才更新的功能,他可以指定 Claude Code 預設的回應方式。想要建立的話可以透過 /output-style:new 來請 Claude Code 幫忙做:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635Mvt0nTwnNq.png

當我跟他說:

我會寫一些技術筆記,這個專案是我專門來放技術筆記 demo code 的地方,我希望當我給你技術的關鍵字時,你可以根據關鍵字給我簡單易懂的範例,並且寫成可以單獨發布的 html 檔案。如果靜態的 html 無法完成,請使用原生的 javascript

Claude Code 就會幫我建立一個 md 檔案並放到 ./claude/output-styles 的資料夾底下:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635921EMSMgVD.png

使用的話需要先透過 /output-style 切換到我們剛剛新建立的模式:
https://ithelp.ithome.com.tw/upload/images/20251006/2015163548eAqbSdiC.png

可以看到 Claude Code 預設內建三種模式,而我們剛剛新建立的則在第四個。切換成功後他會提示你目前切換到哪一個 output-style,這時候只要和 Claude Code 對話,他就會按照你的設定的格式回覆你了:
https://ithelp.ithome.com.tw/upload/images/20251006/20151635sruHP4q8x3.png

產出的結果會像這樣:
https://ithelp.ithome.com.tw/upload/images/20251006/201516351OaFJAkjqn.png


今天分享的兩個工具其實不會加速我開發,但 status line 可以幫助我監測 Claude Code 的狀態,output-style 可以幫助更快速的產生文章的 demo code,對我來說都是滿重要的工具。

你也會用這兩個工具來幫助你日常或工作上的開發嗎?歡迎留言跟我分享你的使用方法唷!我們明天見 👋


上一篇
我與 Claude Code pair:第六個工具 —— 使用 Sub Agent
系列文
我與 AI Pair Programming22
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言