
Claude Code と Codex のワークスペース
コマンド、ファイル、diff はすべて表示されたままです。そのため、エージェントが書くコードを理解できます。
2024 年から、Kiryl Kazlovich が毎日使いながら開発し、磨き続けています。
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 でセッションを始めます。どちらも同じプロジェクトで同時に作業でき、すべてのセッションが 1 つのサイドバーに並びます。
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 アカウントと ChatGPT サブスクリプションを追加します。それぞれの上限が表示されます。次のターンのアカウントは、デスクトップならワンクリック、スマートフォンならワンタップで切り替えます。
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.
エージェントの作業がステップごとに見える
検索、ファイルの読み取り、コマンド、編集が、それぞれスレッドの 1 行になります。ターンの途中でメッセージを送ると、エージェントは今のステップの後にそれを読みます。次のターン用にキューに入れることもできます。
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
コマンド、ファイル、diff をチャットの横で開く
行をクリックすると、スレッドの横に開きます。コードはシンタックスハイライト付きで表示されます。Markdown と HTML はページとして、CSV は表として表示され、diff には変更前と変更後の行が表示されます。
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
- Web ページWeb ページ
- DiffDiff
- 画像画像
- CSV
- 音声
- 動画
- フォルダフォルダ
サブエージェントをすべて表示
エージェントがサブエージェントやワークフローを始めると、Agents の一覧にそれぞれがモデル、トークン数、時間とともに並びます。ワークフローにはフェーズも表示されます。エージェントをクリックすると、そのスレッド全体を読めます。
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-agentsQueueReviewProjectFilesChatChangesSettingsセッションの切り替え
メニューボタンをタップして、デスクトップとセッションを選ぶか、新しいセッションを始めます。
- 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.
Chat Settings
モデルと推論レベルを 1 つのグリッドで選びます。次に、エージェントのアクセスレベルを選びます。
- 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−1ProjectFilesChatChangesSettingsrefund-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
Changes タブ
プロジェクトで変更されたファイルが、行数とともに並びます。ファイルをタップすると diff を読めます。
- 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 アプリにも同じ行が表示されます。各ターンの最後には Task complete の印が付きます。
- 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 29ProjectFilesChatChangesSettings
Android の Project タブ
プロジェクトのすべてのセッションが 1 つの一覧に並びます。セッションをタップすると開きます。
- 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 で Web を検索し、ページを読み、クリックし、文字を入力します。ページ上のラベルに、各操作の名前が表示されます。
- 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 は、Claude Code を Anthropic の Claude Agent SDK で実行し、Codex を OpenAI の Codex app-server の独自ビルドで実行します。各エージェントは、自分の履歴とサインインを別々に持ちます。
- 13:002 Queued MessagesDoneWaiting for desktopSendingAccepted
Add a test for zero-quantity lines.
Waiting for desktopSendingAcceptedThen run the checkout tests again.
メッセージはデスクトップを待つ
スマートフォンがデスクトップにつながらないとき、メッセージはスマートフォンで待機します。接続が戻ると送信され、再送しても 2 回届くことはありません。
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 NightEverforestOne10 種類のカラーテーマ
各テーマにライト版とダーク版があります。スマートフォンは、デスクトップで選んだテーマを使います。
- 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}
コマンドとファイルのシンタックスハイライト
コマンドはシェルの色で表示され、コマンド内のスクリプトにはその言語の色が付きます。ファイルはシンタックスハイライトと行番号付きで開きます。
HB Code をダウンロード
Mac か Windows PC にデスクトップアプリを入れます。スマートフォンからセッションを操作するには、iPhone アプリか Android アプリを入れます。
Mac アプリには、macOS 12 以降の Apple シリコン搭載 Mac(M1 以降)が必要です。