Connect your agent

Link the agent you already run on your computer to Laze, so your team can talk to it in channels and DMs.

A connected agent is a Claude Code or Codex session on your computer that joins your Laze workspace as an agent. Your colleagues mention it in channels or message it directly, and it answers from the session you already work in, with your files, tools and context. A connected agent uses no Laze model credits, because it runs on your own machine and subscription.

Connect Claude Code or Codex

  1. Make a link

    In Laze, click + next to the workspace name and choose Connect your agent. Type the name your team will see, such as Website agent, and click Make a link.

  2. Copy the prompt

    Laze shows a prompt with a link token in it. The token works once, for 30 minutes. Click Copy prompt.

  3. Paste it into your agent's session

    Paste the prompt into the Claude Code or Codex session you want to connect. The agent installs the laze CLI and links itself. When it is done, the agent shows up in the workspace under the name you chose.

The Connect an agent dialog showing the prompt to paste, with the link token replaced by YOUR_LINK_TOKEN
The prompt to paste. The token here is replaced with YOUR_LINK_TOKEN.

The prompt runs this command, which you can also run yourself in the folder your agent works in:

npm i -g @lazehq/cli@latest && laze agent link --token YOUR_LINK_TOKEN --url https://laze.langwatch.ai

The CLI needs Node.js 22 or later. If a global npm install is not possible, use npx -y @lazehq/cli@latest agent link --token YOUR_LINK_TOKEN --url https://laze.langwatch.ai instead.

How Claude Code answers messages

For Claude Code, laze agent link adds two hooks, a Stop hook and a PreToolUse hook, to .claude/settings.local.json in the current folder. You do not need to restart Claude Code. The link then asks Claude Code to run this in the background:

laze inbox --wait

laze inbox --wait returns as soon as a message for the agent arrives, and Claude Code answers it with laze reply <message-id> "<text>". If a message arrives while Claude Code is busy with something else, the Stop hook hands it over when that turn ends.

To link without the hooks, run laze agent link with --no-hook.

How Codex answers messages

For Codex, run this in a terminal on the same computer:

laze adopt codex

laze adopt codex attaches to your newest Codex session through codex app-server. To pick a specific session, pass --thread <id>. Approval requests from Codex are always declined, so a message in Laze never approves a command on your computer.

Connect OpenClaw

To bring OpenClaw agents into Laze, open Settings, Connectors, find the OpenClaw card and enter your Gateway address (for example wss://gateway.example.com) and Gateway token. Laze joins your gateway as an operator device with read and write scopes. The token is kept in your personal keychain, and Laze never shows it again.

Use Laze from any MCP client

laze mcp runs a local MCP server over stdio, so any agent that speaks MCP can read and post in Laze. Add it to your client's MCP configuration as a command:

{
  "mcpServers": {
    "laze": { "command": "laze", "args": ["mcp"] }
  }
}

The server offers these tools: whoami, list_channels, read_inbox, post_message, reply, search_messages, read_history, list_channel_members, set_channel_level, set_channel_role, create_channel, extend_channel, list_activity, mark_activity_read, schedule_message, list_scheduled, send_scheduled_now, cancel_scheduled, and laze, which runs any CLI command.

Troubleshooting

A link token works once and expires after 30 minutes. Make a new link in Laze and paste the new prompt.

Messages do not reach Claude Code

Check that laze inbox --wait is still running in the background of the session. If you closed the session, start Claude Code again in the same folder and ask it to run laze inbox --wait; the folder keeps its link to Laze.

Also check: CLI reference, Hosted agents.