Repository navigation
Description
Summary
Every Claude Code thread is started with the shared thread-storage root (<data-dir>/thread-storage) as an additional working directory, not the thread's own folder (<data-dir>/thread-storage/<thread id>, the value of BB_THREAD_STORAGE). The root shows up in the agent's system prompt, and agents copy it: one wrote its test reports and a screenshot straight into the root. Anything that only reads the thread's own folder then rejects those files. I expected each thread to see, and be able to write to, only its own folder.
Versions and environment
- bb 0.49.0 (
bb-appvia npm, run as a systemd user service), Linux x64. The same code is onmainat da3e60b. - Provider: Claude Code (claude-opus-5-5).
- Direct access over Tailscale. The server was moved onto an enrolled machine, so the data dir is the installer default
~/.bb-machines/<server-host>.
Steps to reproduce
- Start a Claude Code thread in any project.
- Ask:
Print your "Additional working directories" line and the output of echo $BB_THREAD_STORAGE. - Compare the two paths.
Expected vs actual
- Expected: the extra working directory is the thread's own folder, the same path as
$BB_THREAD_STORAGE. - Actual: the extra working directory is the parent
<data-dir>/thread-storage;$BB_THREAD_STORAGEis<data-dir>/thread-storage/<thread id>.
How it went wrong in practice: an agent asked to save test reports for an inline UI block ran
S=<data-dir>/thread-storage && uv run pytest … --junitxml=$S/v4lj-py.xmlthen referenced <data-dir>/thread-storage/v4lj-py.xml in its reply. The inline UI plugin refused it: only files in this thread's workspace, its thread storage or /tmp can be loaded. The agent's Claude Code transcript has no mention of that path except the additionalWorkingDirectories entry; the path contains the machine-specific data-dir name, so it could not have been guessed.
Evidence
runtimeWorkspaceWriteRootsadds the storage root to every environment runtime's write roots:bb/apps/host-daemon/src/runtime-manager.ts
Lines 327 to 332 in da3e60b
private runtimeWorkspaceWriteRoots( args: RuntimeWorkspaceWriteRootsArgs, ): string[] { const roots = [...args.workspaceRoots]; if (args.threadStorageRootPath) { roots.push(args.threadStorageRootPath); - The Claude Code provider passes those roots on as
additionalDirectories(--add-dir) and the sandboxallowWrite:and #L151bb/plugins/provider-claude-code/src/bridge/session-options.ts
Lines 239 to 240 in da3e60b
const additionalDirectories = isWorkspaceWriteSession(params) ? (params.additionalWorkspaceWriteRoots ?? []) - Only
BB_THREAD_STORAGEgets the per-thread path.
A side effect of the same root: every thread's file tools and sandbox are allowed to write into every other thread's storage folder. I read this from the code and did not test it.
What you ruled out
- Not the plugin: its loader correctly limits reads to the thread's own folder; the file was in the wrong place.
- Not specific to the data dir: its location only changes the path text. The root is added whenever
threadStorageRootPathis set, which includes the default~/.bb. - Searched issues for
BB_THREAD_STORAGE,threadStorageRootPath,additionalWorkspaceWriteRoots, "thread storage root": nothing matching. Closest is Agent-launched Desktop inherits parent thread storage root, breaking workflow workers #1366 (closed, different failure).
Suggested priority and effort (optional)
Low to medium. Seen in 1 of ~66 recent threads, and each time it happens the user sees broken output. Workaround: a custom instruction pointing agents at $BB_THREAD_STORAGE. Fix sketch: give each thread its own folder as the extra directory and write root, since the Claude Code session options are built per thread. The runtime is per environment, so the maintainers may prefer a different place for it.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. (Seen on 0.49.0, the latest release; onmainI read the code but did not run it.) - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
AGENT GENERATED: written by Claude Code in a bb thread on a private instance, from the agent's transcript and the bb 0.49.0 sources.
Activity
bb-slop-cop commentedon Nov 16, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,host, andprovider-claude-code; no existing classifications were replaced.confirmed-repro.BB_THREAD_STORAGEpoints to the per-thread child.Grant each thread its own storage folder instead of the shared storag…