Code Mode
Code Mode lets an AI client send Elaichi a short program that calls several of your connected tools in one step, instead of calling them one at a time. It works in any AI client that connects to Elaichi, such as Claude, ChatGPT, Cursor or Microsoft Copilot.
Without Code Mode, a client finds a tool, runs it, reads the whole result, then decides what to do next. A job like "find last week's unread emails from customers and summarize each one" can take a dozen round trips, and every full result passes through the conversation.
With Code Mode, the program calls your tools, loops over the results, picks out what matters, and returns only the answer. The intermediate data stays out of the conversation.
What changes for the client
The client gets one more tool next to search_tools and execute_tool: run_code. It takes the body of a JavaScript function. The function calls tools as await tools.<name>(args), using the exact names search_tools returns. Each call takes the same arguments execute_tool would.
Nothing else changes. search_tools and execute_tool behave as they did before, and the client picks whichever fits the task.
You do not write the programs. The AI client does. You can see each program in your client's tool-call details.
What a program can and cannot do
| Topic | What happens |
|---|---|
| Access | Every tool call in a program goes through the same checks as a direct call: your own toolboxes and connections, your organization's restrictions, and the scopes you granted on the consent screen. A program cannot reach anything you could not reach yourself. |
| Deleting | A program can call a tool that deletes only if you granted the client Delete things when you connected it. This is the same rule as a direct call. |
| Internet | A program has no network access of its own. It reaches the outside world only through your connected tools. |
| Audit log | Each run is one entry in your audit log, and each tool call inside it is its own entry, linked to the run. Elaichi does not store the program text, because it often contains your data. The log keeps a fingerprint of the program instead. |
What you see in chat
In clients that show Elaichi's cards (clients that support MCP Apps, such as Claude), each run gets a short receipt. It says whether the program finished, lists every change it made on its own line (for example, "Created a contact in Work"), and says how many lookups it made. A change that failed, or was still running when the program ended, says so.
Limits
| Limit | Value |
|---|---|
| Tool calls in one run | 50 |
| Run time | 30 seconds |
| Result size | 100,000 characters |
| Runs your organization can start | 20 per minute and 1,000 per day (the day resets at midnight UTC) |
A run that reaches a limit stops and says which limit it reached. Tool calls it already made are not undone. When your organization reaches a run limit, the client does the rest with execute_tool, one call at a time.
Availability
Code Mode is part of every organization's connected tools, the same way execute_tool is. There is nothing to turn on. Any AI client that can run your connected tools gets run_code next to them. A client that never calls run_code behaves exactly as before.