> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enconvo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Mode

> Let an Agent write one short script that makes many tool calls at once and reads back only the result.

Code Mode lets an Agent do in one step what would otherwise take many: it writes a short script that makes many tool calls, side by side or in order, and reads back only the result. Reach for it when a task repeats the same call over many items, such as checking a list of pages or gathering results from several services, so the work is faster and the chat doesn't fill up with every intermediate result.

You don't call Code Mode yourself. When it's on, the Agent uses it whenever a task fits, and the chat shows a card with the calls the script made.

## Set up Code Mode

1. Open **Settings → Code Mode**. You can also open **Code Mode** from the **Built-in** tab of the Plugins page.
2. Under **Script Access**, turn on what a script may call. Each call still asks you as the chat's [Permission mode](https://docs.enconvo.ai/ai/agents.md#approve-actions) says.
3. Choose which models may write scripts, what the chat shows, and what happens when a script runs long.

## Settings

**Script Access** lists what a script may call:

| Access | What it allows | Default |
| - | - | - |
| **Plugins** | Search, knowledge base, documents, and other plugin routes | On |
| **Connectors and MCP** | Your linked accounts and MCP tools | On |
| **Files** | Reading and writing files | On |
| **Shell commands** | Running commands in a terminal | On |
| **Browser** | [Browser Use](https://docs.enconvo.ai/features/browser-control.md), in your own browser | On |
| **Apps** | [Computer Use](https://docs.enconvo.ai/features/computer-use.md), within its App Access list | On |
| **Other agents** | Starting or messaging subagents | Off |
| **Model calls** | A small model to sum up or judge items | On |

The other options:

| Option | Choices |
| - | - |
| **Use with** | **Models that write code well** (others make their calls one by one), or **Every model**. |
| **Show in the chat** | **The calls**, or **The calls and the code**. |
| **When a script runs long** | **Keep going, up to 2 hours** in the background, or **Stop after 10 minutes**. |

## Code Mode outside a chat

When a script runs outside a chat, such as in an automation, it calls only tools that read: built-in searches and reads, public web pages, ordinary files, and MCP tools that don't say they change anything. Enconvo checks each call again right before it runs.

## Use a script in a Skill

A Skill can keep a Code Mode script in its own `scripts` folder and run it as one of its steps. See [Skills](https://docs.enconvo.ai/configuration/skills.md#skills-with-saved-steps).

## Troubleshooting

| Problem | What to do |
| - | - |
| The Agent makes its calls one by one | Check **Use with**. With **Models that write code well**, other models don't use Code Mode. |
| A script can't reach a tool | Turn on that kind of access under **Script Access**. Outside a chat, scripts only read. |
| A long script stopped | With **Stop after 10 minutes**, longer scripts end. Choose **Keep going, up to 2 hours**. |

## Related

> [card] [Agents](https://docs.enconvo.ai/ai/agents.md)
>
> Choose an Agent's tools and permissions.

> [card] [Skills](https://docs.enconvo.ai/configuration/skills.md)
>
> Save a repeatable task, with its own scripts.

> [card] [Code Runner](https://docs.enconvo.ai/ai/code-runner.md)
>
> Run code and shell commands.

> [card] [MCP Servers](https://docs.enconvo.ai/features/mcp.md)
>
> Connect external services as tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.