Repository navigation
Description
Summary
Many bb CLI commands print the raw SDK result as JSON.stringify(result, null, 2) in the human (no --json) mode. The output is byte-for-byte identical with and without --json. The --json flag is therefore meaningless on these commands, and the default output is verbose nested JSON with epoch-millisecond timestamps. Agents call these commands inside long contexts, and the pretty-printed JSON spends many tokens and recalls badly.
Reported by Cole in the Discord bug forum post "Token and LLM recall inefficiency for bb cli" (2026-08-19). The example there was bb thread history thr_siptvrc76v, which printed a 9 KB pretty JSON array. Cole also noted that the human outputs show Date.now() epoch numbers instead of relative or ISO dates.
Versions and environment
- bb 0.39.0, from source at
23a4eaed886ced7bbb69b49dfa7b01349312cc98(main) - Linux 7.0.0-29-generic, Node from the repo toolchain
- Reporter (Cole) saw the same output on the released CLI.
Steps to reproduce
# any thread with history; get one with `bb thread list`
bb thread history thr_f3ndpkf6iz --limit 1 | wc -c
bb thread history thr_f3ndpkf6iz --limit 1 --json | wc -c
diff <(bb thread history thr_f3ndpkf6iz --limit 1) <(bb thread history thr_f3ndpkf6iz --limit 1 --json) && echo IDENTICAL
bb machine show bee
bb thread tabs show thr_f3ndpkf6iz
bb project history proj_3azzxemfidExpected vs actual
Actual:
$ bb thread history thr_f3ndpkf6iz --limit 1 | wc -c
196
$ bb thread history thr_f3ndpkf6iz --limit 1 --json | wc -c
196
$ diff ... && echo IDENTICAL
IDENTICAL
$ bb thread history thr_f3ndpkf6iz
[
{
"id": "phist_nisrgxjasn",
"createdAt": 1784845035019,
"input": [
{
"type": "text",
"text": "what is the status",
"mentions": []
}
]
},
...
$ bb machine show bee
{
"id": "host_j8fm4di6ds",
"name": "bee",
"type": "persistent",
"status": "connected",
"maxPermissionMode": "full",
"lastSeenAt": 1787248793022,
"lastRejectedProtocolVersion": null,
"createdAt": 1784415215437,
"updatedAt": 1787248793022
}
Expected: a compact human format when --json is absent, like bb thread list and bb machine list already do. For example, one line per history entry with a relative or ISO time and the prompt text, such as:
phist_nisrgxjasn 2026-07-23T01:23:55Z (3 weeks ago) what is the status
phist_sj8cpvb4ax 2026-07-23T00:29:33Z (3 weeks ago) what is taking so long now
--json keeps the full machine-readable shape.
Evidence
Commands whose human path is the JSON fallback (each one calls outputJson(opts, result) and then prints the same JSON.stringify(result, null, 2)):
bb thread search,bb thread history,bb thread queue list,bb thread tabs showviaprintHumanJson:and call sites at L162, L178, L235, L426bb/apps/cli/src/commands/thread/organization.ts
Lines 71 to 73 in 23a4eae
function printHumanJson(value: unknown): void { console.log(JSON.stringify(value, null, 2)); } bb project history,bb project branches,bb project paths,bb project commands,bb project files:(also L403, L424, L441, L460)bb/apps/cli/src/commands/project.ts
Line 365 in 23a4eae
console.log(JSON.stringify(result, null, 2)); bb machine show,bb machine status:and L241bb/apps/cli/src/commands/machine.ts
Line 158 in 23a4eae
console.log(JSON.stringify(host, null, 2)); bb terminal show:bb/apps/cli/src/commands/terminal.ts
Line 163 in 23a4eae
console.log(JSON.stringify(session, null, 2)); bb settings show, keybindingslist,usage,version:(also L206, L280, L295)bb/apps/cli/src/commands/settings.ts
Line 136 in 23a4eae
console.log(JSON.stringify(result, null, 2)); bb thread logevents path:bb/apps/cli/src/commands/thread/show.ts
Line 467 in 23a4eae
console.log(JSON.stringify(events, null, 2));
Found with grep -rn "JSON.stringify([a-zA-Z]*, null, 2)" apps/cli/src minus the outputJson helper. Timestamps in all of these are epoch milliseconds (createdAt, lastSeenAt, updatedAt), which no reader, human or model, can convert in their head.
Investigation thread: thr_z5jrf23w43.
What you ruled out
- Not a duplicate of bb thread log truncates silently: human view shows only the newest 20 segments, --json returns the oldest 100, no paging or 'more' indicator #1768. That issue covers
bb thread logtruncation and paging; this issue covers the missing human format and the--jsonflag that changes nothing on many commands. - Not a duplicate of bb thread list prints ids but no titles #1648 (closed). That was
bb thread listtitles;bb thread listnow has a real table and is not in the list above. - Still happens on
mainat23a4eaed8. --limitworks, so the output size is not a paging bug.
Suggested priority and effort
Medium priority: every agent that uses these commands pays the token cost on every call, and --json advertises a distinction that does not exist. Workaround: pipe through jq. Effort: low to medium per command; a shared helper for tables, relative/ISO time, and a --json passthrough would cover all of the sites above. Cole offered to help design the LLM-facing format.
AGENT GENERATED: by Claude Opus 5
Activity
colelawrence commentedon Aug 20, 2026
I feel like the output design can be refined still, for example, I wouldn't include ids
->
Where you can group messages by
N days agoup until 2 weeks ->N weeks agoup until 2 months ->N months agoup until 2 years ->N years agoAnother idea here that can be very nice, is that you don't expose those IDs because you have the timestamps and you can expose the agent to retrieve the thread message details by timestamp or by id, and
--after=[ISO|phist_]&--before=[ISO|phist_]kinda makes senseSawyerHood commentedon Aug 24, 2026
---Auto-Generated---
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2052.html
The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).