Static artifact sharing should copy content behind one tokenized tunnel
General lesson: when an agent workspace needs public static previews, use one plugin-level loopback listener and one tunnel, then route explicit published copies by unguessable share tokens. Organize those copies by thread/project metadata in the UI, but never expose arbitrary worktree paths directly. This applies to modest HTML/image artifacts; large binaries or high-availability production hosting need a real object store/CDN.
Why: a server per thread multiplies ports, tunnels, orphan cleanup, and unstable URLs. Copy-on-publish prevents later worktree mutation, deletion, symlink traversal, or accidental exposure of neighboring files from changing what is public. Deleting a share should revoke its token first, then remove owned content; deleting a thread can trigger the same cleanup, while archiving should preserve by default.
Validation: test the listener, persisted metadata/content, token router, and tunnel as separate boundaries. Probe the actual bound loopback port and the public URL, including index resolution, nested assets, traversal rejection, revoked-token 404s, and restart recovery.
Applies when: a desktop or agent workspace needs shareable static HTML/images grouped by task or thread. Keywords: BB plugin static hosting Cloudflare tunnel thread artifacts token cleanup