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

# memanto agent auto-activate

> Keep your agent working without running agent activate: renew, restart and resume sessions automatically.

# memanto agent auto-activate

One switch that keeps your agent working without `memanto agent activate`. When it is on:

* sessions **renew** before they expire,
* a session that has already expired **restarts** on the next request, and
* any tool that finds no active agent **resumes the last active agent**: it joins that agent's session when it is still live and starts a fresh one otherwise.

It applies to every tool on this computer that uses the active agent: the CLI, Claude Code and other coding-tool hooks, the [MCP server](https://docs.memanto.ai/integrations/mcp.md), the [desktop widget](https://docs.memanto.ai/cli/system/widget.md), the editor extensions and the [local UI](https://docs.memanto.ai/ui/overview.md).

```bash theme={null}
memanto agent auto-activate [on|off]
```

**Arguments:**

* `on` / `off` - Turn the switch on or off. Omit it to show the current setting and the last active agent.

**Default:** off. With it off, sessions end when they expire (6 hours by default) and you run `memanto agent activate` again.

**Examples:**

```bash theme={null}
memanto agent auto-activate on
```

```
OK Auto-activate on. Sessions renew and restart by themselves and your last active agent resumes automatically; 'memanto agent deactivate' pauses it.
```

```bash theme={null}
memanto agent auto-activate
```

```
Auto-activate: on
Last active agent: customer-support
```

**Notes:**

* The setting is stored as `session.auto_activate_enabled` in `~/.memanto/config.yaml`. The `SESSION_AUTO_ACTIVATE_ENABLED` environment variable sets it for a server process, and the same switch is on the [Settings page](https://docs.memanto.ai/ui/configuration.md) of `memanto ui`.
* [`memanto agent deactivate`](https://docs.memanto.ai/cli/sessions/deactivate) pauses the resume until you activate an agent again.
* Long-running processes (`memanto serve`, the MCP server, the widget) read the setting when they start. Restart them after changing it from the CLI.
* Restarting an expired session still requires management access (a valid API key or a request from this computer), the same as an explicit activation.


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