Agent Mode Explained in Dyad

Back to Blog
Article

Agent Mode Explained in Dyad

How AI agent mode works in Dyad, from autonomous task tracking and log reading to proactive debugging and layered file editing.

Most AI app builders give you a chat box. You type a request, the AI writes some code, and you hope it works. When it does not, you paste the error back in and try again. That loop gets old fast, especially when the AI keeps losing track of what it already tried.

AI agent mode changes this. Instead of waiting for you to report every error, the agent tracks its own tasks, reads logs, and fixes problems before you even notice them. Dyad ships with this capability built in, and a version of it is free.

What AI agent mode actually does

An AI agent mode is a chat mode where the AI operates with more autonomy. Rather than responding to a single instruction and stopping, it maintains a task list, monitors the results of its work, and continues until the job is done.

In Dyad, Agent mode works like this:

  1. You describe what you want (e.g., "add a settings page with dark mode toggle and user profile editing").
  2. The agent breaks that into subtasks and tracks them.
  3. It writes code, checks the app preview, reads server and browser logs, and catches errors.
  4. If something breaks, it debugs the issue on its own, without waiting for you to paste an error message.
  5. It continues through the task list until everything is complete.

This is different from a standard code generation prompt, where the AI writes code once and hands it back to you. The agent loop means fewer round trips between you and the AI.

Three chat modes, three levels of autonomy

Dyad offers three chat modes. Each one gives the AI a different level of control.

Build mode

Build mode is the default for free users. You send a prompt, the AI generates code, and Dyad applies it to your project. The AI sees your codebase (or the files you select), but it does not monitor logs or track tasks across multiple steps. This works well for straightforward changes: adding a component, tweaking styles, fixing a known bug.

Basic Agent mode (free)

Basic Agent mode is available to all users at no cost, with a 5-message daily quota (150 messages per month). You bring your own API key from any supported provider (OpenAI, Anthropic, Google, or a local model through Ollama). The Basic Agent gathers context automatically and can debug its own errors. Once you hit the daily limit, you switch back to Build mode.

This is a good middle ground. You get the autonomous debugging loop for the tasks that need it, without paying a subscription.

Full Agent mode (Pro)

The full Agent mode is available to Dyad Pro members ($20/month). It adds multiple AI models working together, website cloning, faster file edits through Turbo Edits, and advanced code search across your codebase. Pro Agent mode is the default for Pro users when they start a new chat.

How the agent debugs on its own

The debugging loop is where AI agent mode makes the biggest practical difference.

In Build mode, a typical debugging session looks like this:

  1. AI writes code.
  2. You see an error in the preview.
  3. You copy the error and paste it into the chat.
  4. AI suggests a fix.
  5. Repeat until it works.

In Agent mode, steps 2 and 3 happen automatically. The agent reads server logs, browser console output, and even Supabase edge function logs. When it spots an error, it diagnoses the cause and applies a fix without you doing anything.

This is especially useful for errors that only show up in the console (not the UI), or for cascading issues where fixing one thing reveals the next problem. The agent handles the whole chain.

Smarter file editing with layered search and replace

One of the common frustrations with AI code generation is botched edits. The AI tries to modify a file, targets the wrong section, and introduces new bugs. Dyad's Agent mode addresses this with a layered editing approach.

For small, targeted changes, it uses precise search-and-replace. For larger modifications, it falls back to Turbo Edits, which uses a secondary model specialized in applying code changes. The agent also reviews its own edits and retries with better instructions if the initial attempt does not land correctly.

This layered strategy significantly reduces the "edit loops" where the agent repeatedly fails to make the right change in the right place.

How context gathering works

AI agent mode is only as good as the context it has. Dyad has evolved its context system over several releases.

Smart Context uses a lightweight model to select the most relevant files from your codebase for each conversation. Instead of dumping your entire project into the prompt (expensive and often counterproductive), it picks what matters.

Deep Smart Context goes further. It remembers your entire conversation history, searches through your codebase multiple times in a single response, and uses caching to keep credit usage efficient. This is the default for Pro users.

When the agent combines these context modes with its ability to read logs and track tasks, it can handle multi-step work that spans several files and services. For example, adding a new API route, connecting it to a Supabase table, updating the frontend to call it, and fixing any type errors along the way.

When to use each mode

Use Build mode for quick, isolated changes. Adding a button, changing a color, updating copy. If you know exactly what you want changed and can describe it in one sentence, Build mode is fast and direct.

Use Basic Agent mode for tasks that might produce errors you cannot easily predict. Integrating a new library, wiring up authentication, connecting to an external API. The autonomous debugging loop saves time here.

Use full Agent mode for larger features that touch multiple files and require the AI to plan, execute, and verify across several steps. Building an entire settings page, cloning a website layout, or refactoring a data model across your app.

What AI agent mode does not do

It is worth being clear about limits. The agent does not replace understanding your app. It can get stuck in loops on unusual edge cases. It works best when your prompt is specific about what you want, even if you do not need to specify how. Broad prompts like "make this app better" give the agent less to work with than "add form validation to the sign-up page and show inline error messages."

The agent also consumes more tokens per interaction than Build mode, since it runs multiple steps and reads logs. If you are watching API costs closely, use Build mode for simple tasks and save AI agent mode for the work that benefits from autonomy.

Try it

Dyad is open source (MIT license, with FSL 1.1 for Pro features) and runs locally on Mac, Windows, and Linux. You can use AI agent mode today, for free, with your own API keys. Download it at dyad.sh and switch to Basic Agent mode from the chat mode selector.