XiaoZhi ESP32 is an MCP-based voice chatbot that runs on supported ESP32 devices and uses large language models for conversation and control across devices. It is intended for developers building voice interfaces with networking, audio streaming, wake-word detection, and MCP-based capabilities. The catalogue instruction supports work with this project.
Borrowing it
Nothing to install: this file belongs to 78/xiaozhi-esp32. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/78/xiaozhi-esp32/main/AGENTS.mdgit clone --depth 1 https://github.com/78/xiaozhi-esp32Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/78/xiaozhi-esp32/agents-md)<a href="https://agentmods.dev/instructions/78/xiaozhi-esp32/agents-md"><img src="https://agentmods.dev/badge/instructions/78/xiaozhi-esp32/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/78/xiaozhi-esp32/agents-md"><img src="https://agentmods.dev/badge/instructions/78/xiaozhi-esp32/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01075 | $0.01075 |
| Opus 5.5 | $0.00430 | $0.00430 |
| Sonnet 5.5 | $0.00215 | $0.00215 |
| Haiku 4.5 | $0.00108 | $0.00108 |
Grade A, and why
xiaozhi-esp32 AGENTS.md scanned grade A with 0 findings 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 16d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Project
XiaoZhi is an ESP-IDF C/C++ voice-assistant firmware supporting many chips, boards, displays, audio devices, and network transports. A build selects exactly one board implementation.
Use the ESP-IDF release/v6.1 branch when possible. The minimum supported SDK is ESP-IDF v6.0.1. IDF 5.x is not supported.
Architecture
main/application.*: main event loop, protocol lifecycle, and high-level behavior.main/device_state_machine.*: legal runtime state transitions.main/boards/common/: board interfaces and reusable hardware/network helpers.main/boards/**/: board-specific pins, initialization, and build variants.main/audio/: codecs, audio tasks, engines, wake words, and queues.main/protocols/: transport-neutral API plus WebSocket and MQTT/UDP.main/display/andmain/led/: reusable UI implementations.main/mcp_server.*: common device-side MCP tools and dispatch.main/Kconfig.projbuild: board and feature configuration.main/CMakeLists.txt: source, board, locale, font, and asset selection.scripts/build.py: canonical board/variant build entry point.
Read the closest existing implementation before adding a new one. Prefer the narrowest owning layer; do not put board-specific behavior into core modules.
Required Rules
- Preserve unrelated worktree changes and keep patches focused.
- A build must export exactly one board factory through
DECLARE_BOARD(...). - Never alter an existing board's pins to support different hardware. Add a uniquely named board or release variant; board identity affects OTA compatibility.
- Core code depends on
Boardinterfaces, never a concrete board class or boardconfig.h. - Treat camera, backlight, display, LED, battery, and similar capabilities as optional.
- Change runtime state through
Application::SetDeviceState()and the state machine. - Callbacks may run outside the main task. Schedule application mutations with
Application::Schedule()or event bits. - Do not block the main event loop or audio tasks. Avoid unbounded queues and repeated large allocations in audio paths.
- Keep shared message semantics in
Protocol; verify both transports when changing its contract. - Validate network input and preserve
cJSONownership. NVS keys are persistent API and require migration when changed. - Guard target-specific features with Kconfig/component rules. Do not assume every target has PSRAM or S3/P4 resources.
- Do not manually edit generated/vendor output:
build/,releases/,managed_components/,components/,sdkconfig*,main/assets/lang_config.h, or generated mmap headers. - Format only touched C/C++ files with the repository
.clang-format; avoid unrelated mass formatting.
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.
- 16d ago Changed · +5 tokens per session e4657b6bbf89
- 1mo ago Changed · -1 lines · -9 tokens per session bdc857442bd5
- 2mo ago First seen · 95 lines · 1,079 tokens per session scan A b8b4a28987b9
xiaozhi-esp32 AGENTS.md is an instructions file published in the GitHub repository 78/xiaozhi-esp32 (32,690 stars, last pushed 2d ago), licensed MIT. It adds 1,075 tokens to every session, about $0.0043 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
xiaozhi-esp32 AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| xiaozhi-esp32 AGENTS.md78/xiaozhi-esp32 | Instructions file | 33k | 2d ago | MIT | A | 1,075 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |