
Claude Code 和 Codex 的工作区
每条命令、文件和差异都清晰可见,让您理解智能体编写的代码。
Kiryl Kazlovich 自 2024 年起开发并持续打磨,每天都用它工作。
Find the rounding calls
Each line is rounded before tax, and the rounded lines are added up. I’ll round once, on the total.
Run the checkout tests
The total is now rounded once. All 14 checkout tests pass.
Opus 5.5 · High reasoning
Check the rounding change in cart-total.ts…
The cart total is correct now. taxTotal still rounds each line.
One gap: tax-total.ts still rounds each line…
I sent the gap to the fix session.

Each line is rounded before the sum. I will round once, after tax.
The total is rounded once. All 14 checkout tests pass.
Check the rounding change in cart-total.ts…
One gap: tax-total.ts still rounds each line…
taxTotal rounds each line, as the cart did. I will round once, on the total.
The tax is rounded once, on the total. All 19 tests pass.
The tax path is fixed. Check tax-total.ts again…
在同一个工作区使用两个智能体
开始会话时选择 Claude Code 或 Codex。两个智能体可以同时处理同一个项目。一个侧边栏列出所有会话。
I’ll trace how the cart total is rounded.
Find the rounding calls
Each line is rounded before tax, and the rounded lines are added up. I’ll round once, on the total.
Run the checkout tests
The total is now rounded once. All 14 checkout tests pass.
Opus 5.5 · High reasoning
在桌面和手机上用多个订阅
在桌面端添加你所有的 Claude 账户和 ChatGPT 订阅。在桌面端或手机上启动 Claude Code 和 Codex 会话,轻点一下就能切换当前使用的账户。两个会话可以同时在两个不同的账户上运行。
How the agents write their replies. Claude uses a change from your next message. Codex uses a change in new sessions. An older Codex session can change after Codex compacts its context.
How fast the weekly limit fills, from readings this desktop keeps.
- Peak day
- 286M
- Current streak
- 5 days
- Longest streak
- 12 days
- All time
- 21.4B
Each subscription is a ChatGPT account with its own limits. Sessions use the one in use.
How the agents write their replies. Claude uses a change from your next message. Codex uses a change in new sessions. An older Codex session can change after Codex compacts its context.
How fast the weekly limit fills, from readings this desktop keeps.
Every account reads the same Claude sessions. New turns run on the one in use.
在一条时间线上查看运行的每一步
智能体工作时,每次搜索、文件、命令和改动都会显示为一行。如果您在某个轮次中发送消息,智能体会在当前步骤后阅读。您也可以将消息排入下一轮次的队列。
refundTotal rounds each line, like the cart did. I’ll look at the receipt from the report first.
Run the refund tests
Run the refund tests
Refunds now use half-even rounding, the same as invoices.
What changed
refundTotalrounds once, on the sum of the lines.roundHalfEvenis the one helper for cart, refunds, and invoices.
Run all checkout tests
refundTotal rounds each line, like the cart did. I’ll look at the receipt from the report first.
Run the refund tests
Run the refund tests
Refunds now use half-even rounding, the same as invoices.
What changed
refundTotalrounds once, on the sum of the lines.roundHalfEvenis the one helper for cart, refunds, and invoices.
Run all checkout tests
打开时间线中的任意一行
点击一行,在聊天旁打开。代码有语法高亮。Markdown 和 HTML 显示为渲染后的页面,图片在查看器中打开,差异视图显示原有行和新行。
Run the checkout tests
Run the checkout tests
The summary page is docs/checkout-totals.html. The rule follows docs.taxlib.dev/rounding.
Rounding
Totals are rounded once, after tax. Use round() from the money module, never toFixed.
Half-even, to the cent
docs/checkout-totals.html
How checkout totals are calculated
Round once, on the total.
Some carts were off by a cent. Each line was rounded before tax, so small errors added up.
https://docs.taxlib.dev/rounding
Rounding rules
Round a monetary amount one time, at the end of the calculation. Rounding in the middle moves the result.
Invoices use half-even rounding. An amount that ends in exactly half a cent goes to the nearest even cent.
See Half-even rounding for the full table.
src/checkout/cart-total.ts
- 命令输出命令输出
- 代码代码
- MarkdownMarkdown
- HTMLHTML
- 网页网页
- 差异差异
- 图片图片
- CSV
- 音频
- 视频
- 文件夹文件夹
查看每个子智能体
当智能体启动子智能体或工作流时,“智能体”列表会显示所有项目。工作流显示其阶段,以及每个智能体的模型、Token 和用时。打开智能体,在聊天旁阅读其完整会话。
Review the cart totals in src/checkout/cart-total.ts. Report each defect with its line.
Review the tax path in src/checkout/tax-total.ts. Report each defect with its line.
Find the checkout paths that have no test. List each path.
Review the rounding fix in src/checkout, verify each finding, and run the tests
Review the rounding fix in src/checkout, verify each finding, and run the tests
Three subagents reviewed the fix. Hopper found that taxTotal() still rounds each line. Turing found that no test has tax on more than one line.
GPT 6 Astra · High reasoning
The review workflow is complete. Four agents ran in three phases. One finding holds: taxTotal() still rounds each line. An order with three lines can be off by one cent.
Review the tax path of the rounding fix in src/checkout. Report each finding with its line
Completed·Opus 5.5·high·118k tokens·9 tools·4 min·2 min ago
Run the tax tests
The review of the tax path is complete. It has one finding, and a new test fails on it.
What I found
Line rounding: src/checkout/tax-total.ts rounds each line in taxTotal(), then adds the lines. The cart rounds one time, after the sum.
Failing case: three lines of 0.336 give 1.02. The correct tax is 1.01.
Checks run
pnpm vitest run tax-total: 6 passed, 1 failed (the new case).
pnpm tsc --noEmit: passed.
会话可以互相发送消息
一个会话可以向另一个会话发送消息。例如,Claude Code 会话请 Codex 会话检查其改动。答复会出现在 Claude Code 会话中。
Claude CodeFix checkout rounding
Both totals now use half-even rounding. I’ll ask the review session to check the change.
Both totals now use half-even rounding. I’ll ask the review session to check the change.
CodexReview rounding fix
GPT 6 Astra · High reasoning
GPT 6 Astra · High reasoning
通过手机控制会话
iPhone 和 Android 应用显示在电脑上运行的会话。您可以通过手机阅读时间线并发送消息。
- 13:00
Each line is rounded before the sum. I will round once, after tax.
cart-total.ts+9-4src/checkout/Run the checkout tests$pnpm test checkoutThe total is rounded once. All 14 checkout tests pass.
This sessionReview rounding fixSentCheck the rounding change in cart-total.ts…
Review rounding fixThis sessionOne gap: tax-total.ts still rounds each line…
Fix the tax path the same way.Read tax-total.tssrc/checkout/taxTotal rounds each line, as the cart did. I will round once, on the total.
tax-total.ts+12-5src/checkout/Run the tax tests$pnpm test taxThe tax is rounded once, on the total. All 19 tests pass.
This sessionReview rounding fixSentThe tax path is fixed. Check tax-total.ts again…
0:380:510:500:490:480:470:460:450:440:430:420:410:400:390:38会话时间线
阅读运行中的会话的每条命令、文件改动和消息。轻点某一行即可打开。
- 13:00
Each line is rounded before the sum. I will round once, after tax.
cart-total.ts+9-4src/checkout/Run the checkout tests$pnpm test checkoutThe total is rounded once. All 14 checkout tests pass.
This sessionReview rounding fixSentCheck the rounding change in cart-total.ts…
Review rounding fixThis sessionOne gap: tax-total.ts still rounds each line…
Fix the tax path the same way.Read tax-total.tssrc/checkout/taxTotal rounds each line, as the cart did. I will round once, on the total.
tax-total.ts+12-5src/checkout/Run the tax tests$pnpm test taxThe tax is rounded once, on the total. All 19 tests pass.
This sessionReview rounding fixSentThe tax path is fixed. Check tax-total.ts again…
0:52Loading sessionsMacBook ProMac StudioOffice PCTax label copyshop-web · 3dCoupon stacking ordershop-api · 1dTax rate lookupshop-api · 1dCart badge flickershop-web · 6mRefund path testsshop-api · 4hReview rounding fixshop-api · 2mNew SessionCreate in current projectFix checkout roundingshop-api · nowDictateEditSub-agentsQueueReviewProjectDirectoriesWorkspaceChangesSettings会话切换器
轻点菜单按钮。然后选择电脑和会话,或开始新会话。
- 13:00Message agentDone
Use half-even rounding for tax too.
0:000:070:060:050:040:030:020:010:00Edit transcriptTranscribingDecoding your audio…Opus 5.5High听写
说出您的消息。检查录音转成的文字,然后发送。
- 13:00Chat SettingsDoneModelsReasoningFable 5.1Opus 5.5Sonnet 5Haiku 4.5LowMediumHighExtra HighMaxDefaultAccessPlan modeClaude reads and plans. It asks before itchanges files or runs commands.Accept editsClaude edits files without asking. It asksbefore it runs commands.Auto modeClaude’s safety check approves routineactions. Risky actions still ask.Bypass permissionsClaude runs every tool without asking.ModelsReasoningAstra 6Sol 5.6Terra 5.6Luna 5.6LowMediumHighExtra HighMaxUltraSpeedStandardStandard speed and credit usage.FastAbout 1.5x faster; uses more credits.AccessRead onlyInspect and explain without editing files.Full autoRun automatically within the project;broader access still requires approval.
聊天设置
在同一网格中选择模型和推理级别。然后选择智能体的访问级别。
- 13:00Loading changes...fix/checkout-rounding161Lines133Added28Deleted10Files0Staged10Unstaged2Newsrccheckoutrefund-total.ts+12−5rounding.ts+18−7totals.ts+4−9ordersorder-summary.ts+3−3shared/moneyhalf-even.ts+22testscheckoutrefund-total.test.ts+31rounding.test.ts+24−2fixturesrefunds.json+16−1CHANGELOG.md+2package.json+1−1ProjectDirectoriesWorkspaceChangesSettingsrefund-total.tssrc/checkout1@@ -1,4 +1,5 @@2import type { LineItem } from './totals';3−import { roundLine } from './rounding';4+import { orderTotal } from './rounding';5+import type { Refund } from '../orders/order-summary';67/** What a customer gets back for returned items. */8@@ -9,7 +10,13 @@ export function refundFor(9 items: LineItem[],10 returned: Set<string>,11−): number {12− return items13− .filter((item) => returned.has(item.sku))14− .reduce((sum, item) => sum + roundLine(item), 0);15+): Refund {16+ const back = items.filter((item) =>17+ returned.has(item.sku),18+ );19+ // Round once, on the total, as the order does.20+ const amount = orderTotal(back);21+ return {22+ amount,23+ lines: back.length,24+ };25}Donerounding.tssrc/checkout1@@ -1,8 +1,8 @@2import type { LineItem } from './totals';3+import { halfEven } from '../shared/money/half-even';45−const CENTS = 100;6−7−export function roundLine(amount: number): number {8− return Math.round(amount * CENTS) / CENTS;9+/** Amounts stay in minor units until the last step. */10+export function toMinor(amount: number): number {11+ return amount * 100;12}1314@@ -12,8 +12,19 @@ export function lineTotal(item: LineItem)15 const net = item.unitPrice * item.quantity;16− return roundLine(net * (1 + item.taxRate));17+ return net * (1 + item.taxRate);18}1920−export function orderTotal(items: LineItem[]): number {21− return items.reduce((sum, item) => sum + lineTotal(item), 0);22+/**23+ * Rounds once, on the total. Rounding each line24+ * first lost up to one cent per order.25+ */26+export function orderTotal(items: LineItem[]): number {27+ let sum = 0;28+ for (const item of items) {29+ sum += lineTotal(item);30+ }31+ return halfEven(toMinor(sum)) / 100;32}3334+export function refundTotal(items: LineItem[]): number {35+ return -orderTotal(items);36+}1 / 102 / 10
“改动”标签页
查看项目中修改过的文件及其行数。轻点文件即可阅读差异。
- 13:00ClaudeAnthropic · Max planwork@acme.devme@hey.comLimits5h3% left96% leftResets 11:40 AMResets 2:25 PMWeekly64% left58% leftResets Oct 7 at 2:00 PMResets Oct 6 at 8:30 AMWeekly · Fable82% left100% leftResets Oct 7 at 2:00 PMResets Oct 6 at 8:30 AMUsage over timeWeekly limit used36% now42% now100%50%0%ThuFri
The desktop keeps a reading each time it checks
the limits.Accountswork@acme.devThis computer, shared with other Claudeapps5h 3% · Weekly 64%Maxme@hey.comAdded in HB Code5h 96% · Weekly 58%MaxAdd Claude accounts on the desktop.
Claude限额与账户
查看每项限额还剩多少。轻点另一个账户,在接下来的轮次中使用它。
- 13:001:031:121:111:101:091:081:071:061:051:041:03Fix checkout roundingThis session
Check the rounding change in cart-total.ts…
Read cart-total.tssrc/checkout/$rg "Math.round" src/checkoutThe cart total is correct now. taxTotal still rounds each line.
CheckResultCart totalCorrectTax totalRounds each lineThis sessionFix checkout roundingSentOne gap: tax-total.ts still rounds each line…
I sent the gap to the fix session.
Task complete·1 min 12 sGPT 6 Astra · High reasoningAndroid 上的时间线
Android 应用显示相同的行。Codex 轮次结束时会显示模型和“任务完成”标记。
- 13:00shop-webSessionsCart badge flicker12:54 PMTax label copyOct 6Cart drawer focus trapOct 6Product image lazy loadOct 5Search filter chipsOct 3Wishlist syncOct 2Price format in cartSep 30Checkout button stateSep 29ProjectDirectoriesWorkspaceChangesSettings
Android 上的“项目”标签页
查看项目的所有会话。轻点会话即可打开。
- 13:00rounding.mddocs/checkoutDone
Checkout rounding
The cart and the tax round one time, on the total. The rule is in cart-total.ts.
Example order
LineAmountSubtotal$44.50Coupon VIP10-$4.45Tax$3.30Total$43.35Rule
- 1.Add the lines and the coupon.
- 2.Add the tax.
- 3.Round the result one time, to the cent.
1 of 4Android 上的文件预览
从“目录”标签页打开项目文件。Markdown 文件显示为格式化文本。
HB Code 为两个智能体添加的工具
每个 Claude Code 和 Codex 会话都能使用这些工具。写下您的需求,智能体会选择工具。
- Create explainer videoThe cart rounding fixRendering frames: 630 / 1260Writing scenesCreating narrationRendering frames: 630 / 1260Checking framesRevision 1
The cart rounding fix
Rendering frames: 630 / 1260Writing scenesCreating narrationRendering frames: 630 / 1260Checking framesChecking frames
- Agent
- Claude
- Revision
- 1
- Scenes
- 4
- Video length
- 42.0 seconds
video-cart-rounding-fix.mp4ReviewThe total is rounded once, after tax
SubtotalTaxRound onceTotal00:18 / 00:421x讲解视频
智能体根据简要说明制作一段 30 至 120 秒的配音视频。视频可以在电脑和手机上播放。
- Open browser pageRounding rules — taxlib.devClick "Half-even rule"Rounding rules — taxlib.devExtracted pageHalf-even rule — taxlib.devRounding rulesHalf-even ruledocs.taxlib.dev/rounding/half-even
Rounding rules
Round a money value once, at the end of the calculation.
Rounding at every step can move a total by a cent.
Half-even rule
HB CodeClick “Half-even rule”Read the pageClick “Half-even rule”Read the pageHalf-even rule
A value exactly halfway between two cents goes to the even cent.
Over many totals, the rounding errors cancel out.
您的 Chrome 浏览器
智能体在您自己的 Chrome 中搜索网页、阅读页面、点击和输入。页面上的标签会标明每个操作。
- Explain the rounding fix as audio.Generate speechThe rounding fix, explained · SulafatThe total is rounded once, after tax.
The rounding fix, explained
Playing0:000:380:420:460:500:540:581:021:061:101:141:181:221:261:301:341:381:421:461:501:54/ 3:10语音
智能体根据答复或操作讲解制作音频文件。您可以在电脑或手机上播放。
- Get the setup steps from this tutorial.Extract video contextTutorial · YouTubeFind the steps to set up half-even rounding.
The video gives three steps:
- 1.Install the tax library. (02:10)
- 2.Set the rounding mode to half-even. (05:40)
- 3.Round the total one time, after tax. (09:15)
视频笔记
智能体从 YouTube 视频或录屏中提取步骤、命令和决策。
- Mobile notificationRefund tests passAll 15 tests pass. The diff is ready for your review.
Friday, October 9
13:02
Refund tests passnowAll 15 tests pass. The diff is ready for your review.
手机提醒
工作完成、失败或需要您决定时,智能体会向手机发送提醒。
讲解视频、语音和视频笔记使用您自己的 Gemini API 密钥。浏览器工具需要 Chrome 的 HB Code Browser Bridge 扩展。手机提醒需要开启通知并连接手机。
为日常工作而设计
HB Code 通过 Anthropic 的 Claude Agent SDK 运行 Claude Code,通过自行构建的 OpenAI Codex app-server 运行 Codex。每个智能体保留自己的历史记录和登录状态。
- 13:002 Queued MessagesDoneWaiting for desktopSendingAccepted
Add a test for zero-quantity lines.
Waiting for desktopSendingAcceptedThen run the checkout tests again.
消息会等待电脑连接
如果手机未连接到电脑,消息会留在手机队列中。每条消息都有唯一标识,因此再次尝试不会重复发送。
New session
In shop-api. The agent stays fixed for the session.
Agent
CodexClaudeStart a new conversationOr continue a saved Claude conversation
Tax rounding notes12 min agoWhere does the tax path round a value?CancelStart Claude sessionContinue conversation继续已保存的对话
新会话可以继续智能体为项目文件夹保存的对话。对于 Claude Code,这也包括在终端中开始的对话。重启后,每个会话都会带着完整历史记录打开。
Color theme
Each theme has a light and a dark version. The change applies immediately.
HB CodeHB CodeGraphiteCatppuccinNordNordSolarizedGruvboxGruvboxRosé PineTokyo NightTokyo NightEverforestOne十种配色主题
每种主题都有浅色和深色版本。手机使用您在电脑上选择的主题。
- cart.tsAutosrc/checkout/cart.ts1import { round } from './money';23// Round once, after tax.4export function total(cart: Cart) {5 const net = sum(cart.lines);6 const tax = net * cart.taxRate;7 return round(net + tax, 2);8}910function sum(lines: Line[]) {11 return lines.reduce(addLine, 0);12}
文件查看器中的语法高亮
文件查看器显示代码的语法高亮和行号。Markdown 文件和网页以格式化文本打开。
下载 HB Code
在 Mac 或 Windows 电脑上安装桌面应用。安装 iPhone 或 Android 应用,即可通过手机控制会话。
Mac 应用需要搭载 Apple 芯片(M1 或更新)的 Mac,以及 macOS 12 或更新版本。