<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>软件工程 on AI Developer Starter</title><link>https://aistarter.dev/blog/%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B/</link><description>Recent content in 软件工程 on AI Developer Starter</description><generator>Hugo</generator><language>zh-Hans</language><copyright>Copyright © 2025, HuanCheng Bai.</copyright><lastBuildDate>Sun, 31 Aug 2025 10:17:27 +0800</lastBuildDate><atom:link href="https://aistarter.dev/blog/%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B/index.xml" rel="self" type="application/rss+xml"/><item><title>一日一技：使用 Claude Code Usage Monitor 做个用量大屏</title><link>https://aistarter.dev/claudecodemonitor/</link><pubDate>Sun, 31 Aug 2025 10:17:27 +0800</pubDate><guid>https://aistarter.dev/claudecodemonitor/</guid><description>&lt;p>在 &lt;a href="https://aistarter.dev/ccusage/">你的 Claude Code 中 CCUsage 来检测当前对话用量&lt;/a> 中，我介绍了如何在 Claude Code 中加入一个统计 UI，实现展示内容。&lt;/p>
&lt;p>&lt;img src="https://file.bokerumen.com/c6f61bb1-ac10-4d54-8228-b22dfb8e6b65.png" alt="">&lt;/p>
&lt;p>但他的分析主要还是一边修改代码一边看。如果你和我一样，平时会开多个窗口来干活，这个时候看每个窗口的统计就有点累了，而 &lt;a href="https://aistarter.dev/ccusage/">ccusage&lt;/a> 展示的表格的方式又不够有趣，这个时候，你就可以考虑使用 &lt;a href="https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor">Claude Code Usage Monitor&lt;/a> 来做个监控大屏。&lt;/p>
&lt;h2 id="安装">安装&lt;/h2>
&lt;p>如果你和我一样，使用 &lt;code>uv&lt;/code> 来管理你的 Python 环境，那么你可以执行如下代码，来安装，并启动 Claude Code Usage Monitor。&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>&lt;span style="color:#60a0b0;font-style:italic"># Install directly from PyPI with uv (easiest)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2&lt;/span>&lt;span>uv tool install claude-monitor
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3&lt;/span>&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4&lt;/span>&lt;span>&lt;span style="color:#60a0b0;font-style:italic"># Run from anywhere&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5&lt;/span>&lt;span>claude-monitor &lt;span style="color:#60a0b0;font-style:italic"># or cmonitor, ccmonitor for short&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>或者，如果你喜欢用 &lt;code>pip&lt;/code>，则可以执行如下命令&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>&lt;span style="color:#60a0b0;font-style:italic"># Install from PyPI&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2&lt;/span>&lt;span>pip install claude-monitor
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3&lt;/span>&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4&lt;/span>&lt;span>&lt;span style="color:#60a0b0;font-style:italic"># If claude-monitor command is not found, add ~/.local/bin to PATH:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5&lt;/span>&lt;span>&lt;span style="color:#007020">echo&lt;/span> &lt;span style="color:#4070a0">&amp;#39;export PATH=&amp;#34;$HOME/.local/bin:$PATH&amp;#34;&amp;#39;&lt;/span> &amp;gt;&amp;gt; ~/.bashrc
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6&lt;/span>&lt;span>&lt;span style="color:#007020">source&lt;/span> ~/.bashrc &lt;span style="color:#60a0b0;font-style:italic"># or restart your terminal&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7&lt;/span>&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">8&lt;/span>&lt;span>&lt;span style="color:#60a0b0;font-style:italic"># Run from anywhere&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">9&lt;/span>&lt;span>claude-monitor &lt;span style="color:#60a0b0;font-style:italic"># or cmonitor, ccmonitor for short&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="用法">用法&lt;/h2>
&lt;p>安装完成后，你就可以直接执行 &lt;code>claude-monitor&lt;/code> 来启动 Claude Code Usage Monitor 了。不过，为了让他更精准的使用，我推荐你可以执行一些简单的命令，来优化其展示。
&lt;img src="https://file.bokerumen.com/28b752fb-b266-4587-a892-9f0c2f72eb2b.png" alt="">&lt;/p></description></item><item><title>一日一技：在你的 Claude Code 中引入 CCUsage，统计你的每日 ClaudeCode 消耗</title><link>https://aistarter.dev/ccusage/</link><pubDate>Sun, 10 Aug 2025 10:14:54 +0800</pubDate><guid>https://aistarter.dev/ccusage/</guid><description>&lt;p>在使用 Claude Code 时，如果你使用的是自己的 Claude 订阅登录的，那么大部分时候，你不太需要关心你的使用成本；但除了使用 Claude 订阅，还有不少人是使用 Claude API 或者是 Claude 中转站点来使用订阅的，使用不同的模型的成本不同，很有可能会让你发现，一下子跑完了自己的所有余额和预算，因此，你需要更加关注自己的使用情况。&lt;/p>
&lt;h2 id="安装">安装&lt;/h2>
&lt;p>你可以直接执行 &lt;code>npm install -g&lt;/code> ccusage 来安装 CCUsage，或者可以选择使用 npx 来执行，比如直接执行 &lt;code>npx ccusage&lt;/code> 就可以执行了。&lt;/p>
&lt;h2 id="用法">用法&lt;/h2>
&lt;h3 id="用法-1-直接在命令行中查看">用法 1 ：直接在命令行中查看&lt;/h3>
&lt;p>直接在命令行中执行 npx ccusage，会自动为你展示出最近几天的消耗量，并按日进行展示。比如，你可以看到我最近已经消耗了 90 美元的模型。&lt;/p>
&lt;p>&lt;img src="https://file.bokerumen.com/e586cf1e-285b-463b-910f-e3317578a047.png" alt="">&lt;/p>
&lt;h3 id="用法-2-基于项目查看">用法 2 ：基于项目查看&lt;/h3>
&lt;p>如果你和我一样，同时使用 CC 开发多个项目，那么你可能也会有像我这样按项目统计成本消耗的需求。你可以执行 &lt;code>npx ccusage -i&lt;/code> 来展示 by 项目查看。这样就可以快速的统计不同的项目的成本消耗了。&lt;/p>
&lt;h3 id="用法3--将-ccusage-配置到-claude-code-的状态栏中实时观测">用法3 ： 将 CCUsage 配置到 Claude Code 的状态栏中实时观测&lt;/h3>
&lt;p>如果你希望在使用 Claude Code Vibe Coding 的时候，可以随时查看你的消耗状态，则可以考虑将 CCUsage 配置到你的 Claude Code 当中。&lt;/p>
&lt;p>使用编辑器打开 &lt;code>~/.claude/settings.json&lt;/code> ，在其中添加如下代码，即可实现在状态栏中实时展示消耗情况。&lt;/p></description></item></channel></rss>