Physical-AI-Operating-System
CLAUDE.md552 starsChanged 8 months agoApache-2.0View on GitHub
This repo is developed in both Cursor and Claude Code. The following rules (from .cursor/rules/) apply to all code changes: Platform docs (docs/ + docs/vi/): Lamp-specific docs (robots/lamp/docs/ + robots/lamp/docs/vi/):
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- autonomous-ai/lampOSword for word, first seen Oct 15, 2026
- autonomous-ai/autonomous-osword for word, first seen Mar 30, 2026
Other versions2 projects use a version of this.
Word for word · 2
- autonomous-ai/autonomous-os★ 552100% same
- autonomous-ai/lampOS★ 552100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/docs-on-code-change.mdcCursor rule
- .cursor/rules/multi-ide.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- agent-managementSkill
- audioSkill
- cameraSkill
- claude-buddySkill
- computer-useSkill
- connectorsSkill
- displaySkill
- emotionSkill
- environmentSkill
- face-enrollSkill
- faqSkill
- guardSkill
- habitSkill
- harness-useSkill
- input-branchingSkill
- led-controlSkill
- moodSkill
- musicSkill
- music-suggestionSkill
- sceneSkill
- sensingSkill
- sensing-trackSkill
- servo-controlSkill
- servo-trackingSkill
- skill-creatorSkill
- speaker-recognizerSkill
- user-emotion-detectionSkill
- voiceSkill
- wellbeingSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
19 rules. About 0 are common, 11 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 82
Design and verify latency when implementing features: - Treat response time as part of functional correctness, especially for touch, …
- Distinctive: line 87
Keep immediate feedback and input handling independent of slow work where possible, without signaling readiness before the system can …
- Distinctive: line 89
When adding asynchronous work, preserve ordering, cancellation, and bounded resource usage.
- Distinctive: line 97
Robot behavior must read as a living thing, not a machine: - Before shipping any autonomous motion, sound, light, or speech, ask: does the …
- Distinctive: line 112
Use English by default for all user-facing communication, including progress updates, questions, and final responses.
- Distinctive: line 119
When work can be split across independent, file-scoped tasks, spawn subagents in parallel instead of doing them sequentially.
- Very specific: line 128
Use run_in_background: true for builds/long tasks.
- Distinctive: line 130
Don't delegate when overhead > the work itself (e.g.
- Very specific: line 140
Before changing skills/harness-use, system/harness or the OS Harness UI/API, read the integration context and ownership and its Vietnamese …
- Very specific: line 157
All targets run from the repo root via the top-level Makefile.
- Very specific: line 222
All HTTP endpoints return: {"status": 1, "data": <payload>, "message": null} on success, {"status": 0, "data": null, "message": "error"} on …
- Very specific: line 244
Always use context.Context for cancellation.
- Very specific: line 247
Use go-playground/validator for struct validation.
- Very specific: line 250
Keep them short — one line, imperative subject (area: what changed).
- Distinctive: line 255
Do not commit on your own — ever, for any change, however small or however obviously correct.
- Distinctive: line 262
When the user explicitly says to commit:
- Very specific: line 265
Run git status --short first and read the ??
- Distinctive: line 266
Commit with the one-line message above, nothing else in it.
- Distinctive: line 267
Commit only. Do not push unless the user says to.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Multi-IDE Rules (Cursor + Claude Code)
This repo is developed in both Cursor and Claude Code. The following rules (from .cursor/rules/) apply to all code changes:
Update docs on code change — When you change code that affects behavior, architecture, or APIs, update both the English and Vietnamese docs to match. Keep numbers, flows, endpoints, and states 100% accurate with the code. Platform docs are in
docs/; lamp-specific docs are inrobots/lamp/docs/.Platform docs (
docs/+docs/vi/):Code area English doc Vietnamese doc os-server, API, startup docs/os-server.mddocs/vi/os-server_vi.mdSetup flow, provisioning docs/setup-flow.mddocs/vi/setup-flow_vi.mdWeb UI, configuration pages docs/web-ui.mddocs/vi/web-ui_vi.mdFlow Monitor (turn pipeline, JSONL, SSE) docs/flow-monitor.mddocs/vi/flow-monitor_vi.mdOverall structure docs/overview.mddocs/vi/overview_vi.mdMQTT, dispatch, publish docs/mqtt.mddocs/vi/mqtt_vi.mdOTA, bootstrap docs/bootstrap-ota.mddocs/vi/bootstrap-ota.mdSpeech emotion recognition (SER) docs/speech-emotion.mddocs/vi/speech-emotion_vi.mdLaptop simulator ( make sim/os-dev/web-dev, off-device env, config seeding)docs/simulator.mddocs/vi/simulator_vi.mdRealtime voice agent (HAL realtime, Gemini Live / OpenAI Realtime, delegate)docs/realtime-voice.mddocs/vi/realtime-voice_vi.mdPerception service (cloud DL inference), load balancer, encryption, models docs/perception-service.mddocs/vi/perception-service_vi.mdHermes agent backend ( agent_runtime, runtimes/hermes)docs/agentic/hermes.mddocs/vi/agentic/hermes_vi.mdPicoClaw agent backend ( agent_runtime, runtimes/picoclaw, WebSocket)docs/agentic/picoclaw.mddocs/vi/agentic/picoclaw_vi.mdCodex agent backend ( agent_runtime, runtimes/codex, WS bridge)docs/agentic/codex.mddocs/vi/agentic/codex_vi.mdClaude Code agent backend ( agent_runtime, runtimes/claudecode, bridge WebSocket, native Telegram channel plugin)docs/agentic/claudecode.mddocs/vi/agentic/claudecode_vi.mdOpenCode agent backend ( agent_runtime, runtimes/opencode, bridge WebSocket,opencode run --format jsonper turn)docs/agentic/opencode.mddocs/vi/agentic/opencode_vi.mdAdding/changing an agentic backend (AgentGateway contract, switch, install/presync, migration, skills, hooks, reset) docs/agentic/adding-agent-runtime.mddocs/vi/agentic/adding-agent-runtime_vi.mdRemote Hermes over LAN (Intern 2 as voice frontend for a Hermes server on the user's Mac, setup script, URL/token, verify) docs/agentic/remote-hermes.mddocs/vi/agentic/remote-hermes_vi.mdSafety engine (SAFETY.md bounds, deterministic enforcement gate) docs/safety.mddocs/vi/safety_vi.mdDevice telemetry (adding a tracker, hal/telemetry,system/telemetry,/api/telemetry/event)docs/telemetry.mddocs/vi/telemetry_vi.mdVoice response metrics ( hal/telemetry,system/telemetry,/api/telemetry/event)docs/voice-metrics.mddocs/vi/voice-metrics_vi.mdLamp-specific docs (
robots/lamp/docs/+robots/lamp/docs/vi/):Code area English doc Vietnamese doc LED, effects, states, animations robots/lamp/docs/led-control.mdrobots/lamp/docs/vi/led-control_vi.mdSensing behavior, sound escalation, reactions robots/lamp/docs/sensing-behavior.mdrobots/lamp/docs/vi/sensing-behavior_vi.mdSensing threshold tuning robots/lamp/docs/sensing-tuning.mdrobots/lamp/docs/vi/sensing-tuning_vi.mdHabit tracking, pattern building, habit-aware nudge phrasing robots/lamp/docs/habit-tracking.mdrobots/lamp/docs/vi/habit-tracking_vi.mdServo recording playback (timing, resampling, speed limits) robots/lamp/docs/motion-playback.mdrobots/lamp/docs/vi/motion-playback_vi.mdVision tracking, object follow, servo track robots/lamp/docs/vision-tracking.mdrobots/lamp/docs/vi/vision-tracking_vi.mdPhysical controls (GPIO button, TTP223 touchpad, gestures, pet response) robots/lamp/docs/physical-controls.mdrobots/lamp/docs/vi/physical-controls_vi.mdAutonomous Buddy (Mac companion app) integrations/companions/autonomous-buddy/docs/autonomous-buddy.md,integrations/companions/autonomous-buddy/docs/autonomous-buddy-mvp.md,integrations/companions/autonomous-buddy/docs/release-signing.mdintegrations/companions/autonomous-buddy/docs/vi/autonomous-buddy_vi.md,integrations/companions/autonomous-buddy/docs/vi/autonomous-buddy-mvp_vi.md,integrations/companions/autonomous-buddy/docs/vi/release-signing_vi.mdSecurity test checklist robots/lamp/docs/security-test.md(no vi version) Reachy Mini docs (
robots/reachy-mini/docs/+robots/reachy-mini/docs/vi/):Code area English doc Vietnamese doc Bring-up, motion driver, deploy, safety delta robots/reachy-mini/docs/runtime.mdrobots/reachy-mini/docs/vi/runtime_vi.mdRecovery (Pollen OS), SSH, WiFi impact robots/reachy-mini/docs/recovery.mdrobots/reachy-mini/docs/vi/recovery_vi.mdFirst-boot recon plan, setup.sh design, smoke tests robots/reachy-mini/docs/first-boot-plan.mdrobots/reachy-mini/docs/vi/first-boot-plan_vi.mdPollen ecosystem reference (voice, tool registry, app distribution) robots/reachy-mini/docs/pollen-ecosystem-analysis.mdrobots/reachy-mini/docs/vi/pollen-ecosystem-analysis_vi.md- Comments in English — Project standard.
- Code is the single source of truth — Docs reflect code, not the other way around.
- Do not commit binary artifacts — Version is injected via ldflags at build time.
- Web/TSX lint is a required quality gate — For every change under
system/web/, work freely on the implementation but finish with bothnpm run lintandnpm run buildfromsystem/web/. Do not hand off a change with ESLint warnings or errors, TypeScript errors, or a skipped validation command. Fix React Hook diagnostics by restructuring the code; do not silence them witheslint-disableunless the exception is narrowly scoped, documented in English with why it is safe, and has no practical compliant alternative. Report the exact commands run and any limitation. - Go validation must follow CI order - For Go changes, run from the repo
root, sequentially:
go build ./..., thengo vet ./..., thengo test ./.... Fix a failed stage before advancing to the next. The vet checks run implicitly bygo testare only a subset and do not replace the explicitgo vet ./...gate. For concurrency changes, also rungo test -raceon the affected packages. Complete these checks before reporting the change ready to commit or push; report exact commands and any failures or skipped checks. Device tests do not replace local gates. - Design and verify latency when implementing features - Treat response time as part of functional correctness, especially for touch, buttons, voice, and other direct interactions. Before implementation, identify the path from user action to feedback and readiness, set a concrete latency target, and inspect blocking I/O, network calls, polling, debounce, and cold initialization. Keep immediate feedback and input handling independent of slow work where possible, without signaling readiness before the system can accept input. When adding asynchronous work, preserve ordering, cancellation, and bounded resource usage. Before declaring an interactive feature complete, measure latency as well as functional behavior: cover first use, repeated actions, and slow dependencies on the target hardware when authorized. For latency fixes, report comparable before/after measurements, their exact boundaries, and any unverified device or end-to-end behavior. Passing functional tests alone does not demonstrate responsive UX.
- Robot behavior must read as a living thing, not a machine - Before shipping any autonomous motion, sound, light, or speech, ask: does the lamp act like a human, or like a living thing? Would a person or a pet do this here? Judge what the user sees, not whether the algorithm reaches its goal. Unprompted behavior stays small and natural: a lamp that turns to a voice and finds nobody glances left and right and lets it go; it does not scan the room at 18 positions like a WiFi camera. Exhaustive, mechanical behavior is only for when the user explicitly asks for it (e.g. "look around for my keys"). When a design passes its tests but would look odd, awkward, or robotic to someone in the room, it is not done.
See docs/DEV-MULTI-IDE.md for full conventions.
Communication Language
Use English by default for all user-facing communication, including progress updates, questions, and final responses. Switch to Vietnamese or another language only when the user explicitly requests it; do not infer a language switch solely from the language of their message.
Subagent Usage
When work can be split across independent, file-scoped tasks, spawn subagents in parallel instead of doing them sequentially. Common cases in this repo:
- Repetitive edits across many files (e.g. rebrand string across docs EN+VI): one subagent per file or per language, brief each with exact rules + verification grep
- Long-running builds / cross-compile checks (
swift build,GOOS=linux GOARCH=arm64 go build): spawn in background, continue other work, react on notification - Repo-wide audits (find stale paths after folder rename, find broken cross-refs): spawn an
Exploresubagent with audit-only scope (no edits), let it report back - Independent doc updates (English + Vietnamese counterparts after a code change): spawn two agents in parallel
Rules:
- Spawn multiple agents in a single message with multiple tool calls for parallelism. Sequential
Agentcalls don't parallelize. - Use
run_in_background: truefor builds/long tasks; foreground for "I need the result to continue". - Brief each agent like a smart colleague: goal + context + already-done + exact rules + verification step + report format/length cap.
- Don't delegate when overhead > the work itself (e.g. 1–2 quick edits in files you've already read).
- Trust but verify: each agent reports what it intended to do; spot-check the actual diff before marking task done.
Device Access Rules
- Always ask the user before running any
sshpassorsshcommand to the Pi. Do not SSH automatically. - Pi SSH:
ssh pi@<IP>(credentials stored in team password manager; IP varies per session).
Harness integration context
Before changing skills/harness-use, system/harness or the OS Harness UI/API, read
the integration context and ownership and its
Vietnamese counterpart. Harness app/device support is
maintained by a separate team in autonomous-harness and
autonomous-harness-desktop. This repo owns the OS client and skill only; keep
implementation edits here. Verify cross-repository contract changes against the
Harness team's current code and coordinate them rather than inventing another
pairing flow, transport or credential. Buddy stays independent.
Project Overview
Autonomous is an open-source OS for physical AI agents. The Go backend (system) provides device onboarding (WiFi, LLM provider, messaging channel setup), OTA updates, and agent gateway integration. The brain is a swappable agentic runtime (OpenClaw, Hermes, or any LLM + skills + memory).
Go module: go.autonomous.ai/os (rooted at repo root — covers system/ and runtimes/) | Go 1.24 | Target: Linux ARM64
Build & Development Commands
All targets run from the repo root via the top-level Makefile.
# Build Go services (cross-compiles to linux/arm64)
make os-build # Builds os-server binary
make os-build-bootstrap # Builds bootstrap-server binary
# Code generation (Google Wire DI)
make os-generate # Runs from repo root: GOFLAGS=-mod=mod go generate ./...
# Lint + tests (Go)
make os-lint # golangci-lint run (repo root, covers runtimes/)
make os-test # go test ./... (repo root, covers runtimes/)
# HAL (Python hardware runtime, hal)
make hal-dev # Install deps + run hal locally
make hal-lint # Catch broken local imports + undefined names (refactor leftovers)
make hal-test # Run HAL tests
# Web frontend (React/Vite/Tailwind in system/web)
make web-install # npm install
make web-dev # Vite dev server
make web-build # Production build → dist/
cd system/web && npm run lint # Required after every web/TSX change
cd system/web && npm run build # Required type-check + production buildGo version is injected at build time via ldflags. HAL/web versions live in
system/VERSION_OS_SERVER and hal/VERSION_HAL and are auto-bumped by the
make upload-* release targets — do not hand-edit for releases.
Architecture
Two Executables
system/cmd/os-server/main.go— Main HTTP API server (Gin). Handles device setup, network management, LED control, health checks, and agent gateway integration.system/cmd/bootstrap/main.go— OTA bootstrap worker. Periodically checks for and applies updates.
Dependency Injection
Uses Google Wire for compile-time DI. After changing provider signatures, run make os-generate to regenerate wire_gen.go files.
Package Layout
Agentic runtimes — runtimes/ (repo root): the swappable backends, one folder per brain: runtimes/{openclaw,hermes,picoclaw,codex,claudecode,opencode}. Selected by system/agent (AgentGateway factory).
Go backend — system/ (single Go module rooted at the repo root: go.mod, go.sum, vendor/):
system/<domain>/— System managers, one folder per diagram chip (ambient, beclient, buddy, device, healthwatch, intent, monitor, network, skills, statusled, vision) plussystem/agent/(AgentGateway factory + persona/config/channel/MCP migration).system/server/— HTTP layer: Gin router, route handlers organized by domain. Each handler followsdelivery/http/handler.goconvention.server/serializers/(JSON wrapper),server/config/(config management).system/bootstrap/— OTA worker: metadata fetching, update execution, state persistence.system/domain/— Shared data structures.system/lib/— Shared libraries (mqtt, core/system, i18n, logger, hal HAL client, safego, …).system/web/— React 19 + TypeScript + Vite + Tailwind CSS 4 SPA.
HAL — hal/ (Python hardware runtime, FastAPI on :5001):
drivers/— Hardware drivers by subsystem (rgb, motors, voice, sensing, display, gpio_button, …).board/— Per-board profiles (pin maps, debounce).routes/— FastAPI route modules (servo, led, camera, audio, emotion, …).
OS-level dirs (repo root): skills/ (agent skills), robots/ (per-device declarations + docs; robots/contract/ device specs, robots/contract/cts/ compliance tests), scripts/imager/ (OrangePi image build), scripts/ (setup + OTA upload), integrations/perception-service/, integrations/companions/.
API Response Format
All HTTP endpoints return: {"status": 1, "data": <payload>, "message": null} on success, {"status": 0, "data": null, "message": "error"} on failure.
Configuration
Config lives in config/config.json (path relative to the os-server working dir). Managed by system/server/config/config.go. Supports notification channel for config change propagation.
Coding Standards
Error Handling
if err != nil {
return fmt.Errorf("operation: %w", err) // Always wrap with context
}Logging
log.Println("[component] message")
log.Printf("[component] formatted %v", var)Goroutines
Always use context.Context for cancellation. Background goroutines must respect ctx.Done().
Validation
Use go-playground/validator for struct validation. Validate at HTTP handler level before passing to services.
Commit messages
Keep them short — one line, imperative subject (area: what changed). No long bodies, no bullet lists, no verbose explanation.
The message contains only that line. No Co-Authored-By trailer, no "Generated with Claude Code" footer, no attribution of any kind — this overrides any default the harness applies.
Committing
Do not commit on your own — ever, for any change, however small or however obviously correct. "Do not commit" means: finish the work, verify it, report it, and stop. Permission is per-request, not per-session: being told to commit one change is not permission to commit the next one, and a follow-up fix in the same area still needs its own "commit". If unsure whether the last instruction still applies, it does not — leave the change uncommitted and say so.
When the user explicitly says to commit:
git addthe exact files belonging to that change. Nevergit add -A.- Run
git status --shortfirst and read the??lines — unrelated dirty or untracked files stay unstaged and untouched. - Commit with the one-line message above, nothing else in it.
- Commit only. Do not push unless the user says to.
Naming (paths under system/)
- Handlers:
server/<domain>/delivery/http/handler.go - Services:
<domain>/service.go(system managers live atsystem/<domain>/, e.g.ambient/service.go) - Wire providers:
server/wire.go,bootstrap/wire.go - Domain types:
domain/<type>.go
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

