Help Embedder verify its work
Embedder performs best when it can verify its own work. Without clear success criteria, it may generate solutions that appear correct but fail in practice. In those cases, you become the only source of feedback, and every mistake requires manual review and intervention.| Strategy | Before | After |
|---|---|---|
| Provide verification criteria | ”implement a function that reads a temperature sensor" | "implement read_temperature(). When the sensor returns raw value 0x0190, the function should return 25.0°C. Include unit tests with mocked I²C reads and verify outputs for [0x0000 -> 0.0°C, 0x0190 -> 25.0°C, 0x0320 -> 50.0°C]. Tests must pass.” |
| Address root causes, not symptoms | ”the build is failing" | "the build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don’t suppress the error” |
Explore and plan, then code
Letting Embedder jump straight to coding can produce code that solves the wrong problem. Use Plan Mode to separate research and planning from execution. The recommended workflow has four phases:Explore
Enter Plan Mode. Embedder reads files and answers questions without making changes.
Embedder (Plan Mode)
Plan
Ask Embedder to create a detailed implementation plan.When Embedder is done creating a plan, you can either approve it and continue with execution or give it feedback on what to change. You can manually edit the plan by going to
Embedder (Plan Mode)
.embedder/plans in your projects directory.Implement
Switch back to Act Mode and let Embedder code, verifying against its plan.
Embedder (Act Mode)
Provide specific context in prompts
Embedder can often infer your intent, but it does not have implicit knowledge of your goals or assumptions. Be explicit and precise in your instructions. Reference the exact files to modify, state any constraints or requirements, and link to relevant examples or patterns to follow.| Strategy | Before | After |
|---|---|---|
| Scope the task. Specify which file, what scenario, and testing preferences. | ”Add tests for uart.c" | "Write a hardware-level test for drivers/uart.c that verifies RX buffer overflow handling. Simulate 256+ bytes arriving back-to-back and assert no memory corruption. Avoid mocks; use existing HAL test harness.” |
| Point to sources. Direct Embedder to the source that can answer a question. | ”Why is the SPI driver so complicated?" | "Read drivers/spi.c and its git history and summarize how the SPI driver has evolved. Explain any hardware constraints that influenced the design.” |
| Reference existing patterns. Point Embedder to patterns in your codebase. | ”Add an I2C sensor driver" | "Look at how drivers/adc.c and drivers/uart.c structure init/config/read functions. Follow the same pattern to implement drivers/i2c_temp_sensor.c. Match naming, error handling, and ISR style. Don’t introduce new frameworks.” |
| Describe the symptom. Provide the symptom, the likely location, and what “fixed” looks like. | ”Fix the LED bug" | "The status LED randomly stops blinking after ~10 minutes. Likely related to the timer ISR in src/timer.c. Reproduce with a long-running loop, add logging to confirm missed interrupts, then fix so the LED maintains a stable 1 Hz blink for 30+ minutes.” |
Providing context
You can provide rich data to Embedder in several ways:- Reference files with @ instead of describing where code lives.
- Reference documentation in your project workspace.
- Give URLs for documentation and online references.
Setup your environment
A small amount of upfront setup can make Embedder far more effective in every session. Taking the time to configure your environment and provide the right context helps the agent work more accurately, consistently, and efficiently from the start.Writing an EMBEDDER.md file
Embedder automatically reads an EMBEDDER.md file at the beginning of every session. Use this file to define important details such as common bash commands, coding conventions, and workflow guidelines. This provides persistent context that cannot be reliably inferred from the codebase alone.
The /init command scans your project to identify build systems, test frameworks, and recurring patterns. This creates a strong starting point that you can then customize and refine.
There is no strict structure required for EMBEDDER.md, but it should remain concise and easy to understand. Aim for clear, human readable instructions rather than lengthy documentation.
Embedder.md
EMBEDDER.md is loaded at the start of every session, so only include information that applies broadly across your entire project.
Keep the file short and focused. For each line, ask yourself, “If this were missing, would Embedder make mistakes?” If the answer is no, remove it. An oversized or cluttered EMBEDDER.md dilutes the important guidance and makes it more likely that Embedder overlooks your actual instructions.
| Include | Exclude |
|---|---|
| Commands Embedder can’t guess | Anything Embedder can see in code or docs |
| Unique code style rules | Standard language conventions |
| Testing instructions and preferred test runners | Detailed API documentation (link to docs instead) |
| Repository etiquette | Information that changes frequently |
| Developer environment quirks (required env vars) | File-by-file descriptions of the codebase |
| Common gotchas or non-obvious behaviors | Self-evident practices like “write clean code” |
EMBEDDER.md is probably too long and the rule is getting buried. If it asks questions that are already answered in the file, the phrasing is likely ambiguous or unclear.
Treat EMBEDDER.md like code: review it when behavior goes wrong, regularly prune unnecessary or redundant lines, and test changes to confirm that Embedder’s behavior actually shifts. You can also improve adherence by adding clear emphasis such as “IMPORTANT” or “YOU MUST.”
Check the file into git so your team can contribute, since small improvements compound over time and make the document increasingly valuable.
Provide documentation
Many platforms and peripherals have pre-indexed documentation. If you find Embedder is getting things wrong about your board or peripherals, consider uploading supplemental documentation via the web console. If you’ve added your own platform or peripheral, be sure to upload sufficient and up to date documentation. You can add more documentation for your platform or peripherals by using the/console command and uploading more documentation in the projects section of the web app.
Use CLI tools
The most efficient way to interact with external services is through CLI tools. If you use GitHub, install thegh CLI. Embedder knows how to use it for creating issues, opening pull requests, and reading comments. Without gh, Embedder can still use the GitHub API, but unauthenticated requests often hit rate limits.
Embedder is also great at learning CLI tools it doesn’t already know. Try prompts like Use 'cli-tool --help' to learn about more about the cli tool, then use it to solve A, B, C.
Ask questions about your codebase
When onboarding to a new codebase, use Embedder for learning and exploration. You can ask Embedder questions you would ask another engineer:- How does error logging work?
- How do I read data from the sensor used in this project?
- What does
handle_sample()do on line 134 offoo.c? - What edge cases does
TIMER_CTRLhandle? - Why does this code call
foo1()instead offoo2()on line 173?
Manage your session
Conversations are persistent, and the changes made during them can be reversed.Course-correct early and often
Embedder performs best with a tight feedback loop. Correcting Embedder quickly produces better solutions at a faster pace.Esc: Stop Embedder mid-action with theEsckey. Context is preserved, so you can redirect.Ctrl + z (2x)or/rewind: PressCtrl + z (2x)or run/rewindto open the rewind menu and restore previous conversation and code state.Ctrl + z or /undo: PressCtrl + zor run/undoto have Embedder revert its most recent change./clear: Reset context between unrelated tasks. Long sessions with irrelevant context can reduce performance.
/clear and start fresh with a more specific prompt that incorporates what you learned. A clean session with a better prompt almost always outperforms a long session with accumulated corrections.
Manage context aggressively
Embedder automatically compresses conversation history during long sessions, preserving important code and decisions while freeing space. During longer sessions, Embedder’s context window can fill with irrelevant information. This reduces performance and sometimes distracts Embedder.- Use
/clearfrequently between tasks to reset the context window entirely - When auto compression triggers, Embedder summarizes what matters most, including code patterns, file states, and key decisions
- For more control, you can run
/compressto choose when compression occurs - Customize compression behavior in
EMBEDDER.mdwith instructions like"When compressing, make sure to keep track of the full list of modified files"to make sure any important context survives summarization
Use subagents for investigation
Subagents are one of the most effective tools for keeping sessions focused. When Embedder researches a codebase, it reads many files, which can slow performance in long sessions. Subagents complete the task in a separate context window and report back summaries:Rewind to previous checkpoints
Embedder automatically checkpoints before changes. Run/undo to undo the last change or /rewind to open the checkpoint menu.
Instead of carefully planning all your moves, you can tell Embedder to try something and if it doesn’t work, rewind and try it another way.
Resume conversations
Embedder keeps a copy of conversations locally. When a task spans multiple sessions (you start a feature, get interrupted, come back the next day) you don’t have to re-explain the context.Avoid pitfalls
These are some helpful tips to avoid common mistakes.- Run
/clearbetween unrelated tasks. Otherwise, you may bloat your context window with lots of irrelevant information. - Run
/clearafter failures. If Embedder does something wrong, after two or three failed corrections run/clearand write a better initial prompt incorporating what you learned, as context will be polluted with failed approaches. - Add additional documentation. If Embedder seems to be misunderstanding aspects of your hardware. Consider uploading additional, or replacing current, documentation.
- Prune
EMBEDDER.mdoften. IfEMBEDDER.mdis too long, Embedder will ignore much of it as the important rules will get lost in the noise. The less guidelines inEMBEDDER.mdthe more focused Embedder will be on upholding those guidelines. - Scope tasks and use subagents. If you ask Embedder to “explore” something and don’t scope it down, Embedder can end up filling its context rapidly. Scope tasks or use subagents to preserve context.