bubbaloop CLAUDE.md

Project instructions for Bubbaloop, a physical-AI orchestration system built on Zenoh. They describe the repository layout, architecture documents, node SDK, dashboard, and main development practices.

In plain words
What is it for?
They guide development across Bubbaloop’s Rust crates, React dashboard, node SDK, schemas, authentication, and data-flow features. They also cover agent setup, validation, security boundaries, and contribution workflows.
Why use it?
They help an agent find the right files and keep architecture and roadmap documents updated as the system changes. They also clarify how the command-line tool, daemon, and MCP server fit together.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/kornia/bubbaloop/claude-md
Clone the repo
git clone --depth 1 https://github.com/kornia/bubbaloop
Per session 4,789 This file is loaded in full into every session.
When invoked 4,789 The same file β€” it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04789 $0.04789
Opus 5 $0.02395 $0.02395
Sonnet 5 $0.00958 $0.00958
Haiku 4.5 $0.00479 $0.00479

Measured 3d ago against content hash 6f9da005c53f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

bubbaloop CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories β€” prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency β€” measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- mold linker config ready in `.cargo/config.toml` β€” activate with `sudo apt install mold clang`
CLAUDE.md Β· 243 lines

How it starts

The opening of the file, as written. The whole thing β€” 243 lines β€” stays where its author put it; the contents beside it link to each section on GitHub.

🦐 Bubbaloop

Physical AI orchestration built on Zenoh. Single binary: CLI + daemon + MCP server.

Living Documents (update these as architecture evolves)

  • ARCHITECTURE.md β€” Layer model, node contract, security, open-core boundary
  • ROADMAP.md β€” Implementation phases (YAML skills, agent, SQLite memory, scheduling)
  • CONTRIBUTING.md β€” Agentic workflows, agent tiers, validation, two-critic loop
  • docs/concepts/dataflow.md β€” Provenance envelope, manifest queryable, bubbaloop dataflow CLI + MCP tool (how the SDK answers "what's wired, what's flowing")

Structure

crates/bubbaloop/           # Main binary (CLI + daemon + MCP server)
crates/bubbaloop-node/      # Node SDK (standalone, NOT in workspace β€” batteries-included framework)
crates/bubbaloop-node-build/ # Build helper for nodes (wraps prost-build, standalone)
crates/bubbaloop-schemas/   # Protobuf schemas (standalone, NOT in workspace β€” never add to workspace)
dashboard/                  # React + Vite + TypeScript

Key source files in crates/bubbaloop/src/:

  • cli/login.rs β€” login/logout/status + has_claude_credentials() (env var β†’ OAuth β†’ key file)
  • cli/agent_setup.rs β€” bubbaloop agent setup: interactive provider/model/identity wizard (no daemon needed)
  • cli/agent_client.rs β€” Thin Zenoh CLI client for agent chat/list (pub/sub, no LLM)
  • agent/mod.rs β€” Agent core: EventSink trait, run_agent_turn(), AgentTurnInput (soul_path triggers onboarding)
  • agent/gateway.rs β€” Zenoh gateway wire format (AgentMessage, AgentEvent, topic builders)
  • agent/runtime.rs β€” Multi-agent runtime: AgentsConfig, AgentRuntime, ZenohSink, agent_loop; agent_directory() (pub)
  • agent/prompt.rs β€” System prompt builder; build_system_prompt_with_soul_path() injects onboarding prompt for new agents
  • agent/soul.rs β€” Soul struct, first-run onboarding, notify hot-reload (~/.bubbaloop/soul/)
  • agent/provider/mod.rs β€” ModelProvider trait, Message, ContentBlock (incl. Image), ToolDefinition, StreamEvent
  • agent/provider/gemini.rs β€” Gemini API client (recommended default β€” free tier, vision-capable)
  • agent/provider/claude.rs β€” Claude API client with dual auth (API key + OAuth bearer token)
  • agent/provider/ollama.rs β€” Ollama local LLM client with tool calling (/api/chat)
  • agent/camera.rs β€” grab_frame implementation: Zenoh query for one JPEG frame + JSON metadata attachment, emits ContentBlock::Image
  • agent/gateway.rs β€” Zenoh + HTTP+SSE agent gateway; per-agent cancel topic bubbaloop/global/{machine_id}/agent/{agent_id}/cancel
  • agent/memory/ β€” 4-tier: world state (live SQLite) + short-term (RAM) + episodic (NDJSON) + semantic (SQLite)
  • agent/heartbeat.rs β€” Adaptive heartbeat: arousal + decay + state collection
  • agent/dispatch.rs β€” Internal tool dispatch (47 public MCP tools + ~43 agent-internal tools incl. grab_frame, telemetry, beliefs, constraints, missions)
  • cli/node/mod.rs β€” node CRUD, validation, list/add/remove
  • cli/node/install.rs β€” install, precompiled binary download, GitHub clone
  • cli/node/lifecycle.rs β€” start, stop, restart, logs
  • cli/node/build.rs β€” build node
  • daemon/mod.rs β€” skill runtime: registry + lifecycle + health + MCP + telemetry watchdog
  • daemon/telemetry/ β€” Resource watchdog: sampler (sysinfo), circuit breaker, SQLite storage, hot-reload config
  • daemon/node_manager.rs (57KB) β€” node lifecycle, build queue, health
  • daemon/systemd.rs (38KB) β€” D-Bus/zbus integration
  • daemon/registry.rs β€” ~/.bubbaloop/nodes.json management
  • registry.rs β€” marketplace fetch/parse/cache, find_curl()
  • marketplace.rs β€” shared precompiled binary download logic (used by CLI and MCP)
  • mcp/mod.rs β€” MCP tools, BubbaLoopMcpServer, ServerHandler impl
  • mcp/platform.rs β€” PlatformOperations trait, DaemonPlatform, MockPlatform

Read the full file on GitHub Β· 243 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen Β· 243 lines Β· 4,789 tokens per session scan B 6f9da005c53f

Subscribe to this mod's changes

bubbaloop CLAUDE.md is an instructions file published in the GitHub repository kornia/bubbaloop (28 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 4,789 tokens to every session, about $0.0239 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.