Claude Tools

Enabling Chatbot-to-Chatbot Calls: Practical Guide to Agent-to-Agent Interactions with Anthropic's Computer Use

Discover how AI agents can directly interact by one controlling another's tools, using Anthropic's computer use beta. Build reliable agent systems for real-world tasks like browsing and automation.

J

Jennifer Yu

Workflow Automation Specialist

December 29, 2025 min read
Share:

Agent-to-Agent Communication: The Next Frontier in AI Workflows

In today's AI landscape, individual chatbots excel at specific tasks, but true power emerges when they collaborate. Imagine one agent scouring the web for data while another manipulates software interfaces seamlessly. This isn't science fiction—it's achievable today using tools like Anthropic's computer use beta, which lets agents control desktops and browsers programmatically.

Traditional setups force agents to communicate indirectly via APIs or shared databases, introducing friction. The innovative approach? Have one agent 'call' another by taking over its screen or browser session. This mimics human collaboration, where you might hand off control during a remote session. No custom protocols needed—just leverage existing tools for immediate results.

Anthropic's Computer Use: The Key Enabler

Anthropic recently launched computer use in beta, a capability for Claude models (specifically Claude 3.5 Sonnet) that allows precise mouse, keyboard, and screen interactions. It's not just screenshots; the model analyzes visual elements and executes actions with sub-2-second latencies in optimal conditions.

This tool shines in agentic workflows. For instance, a 'browser agent' can navigate sites, while a 'shell agent' handles terminal commands. The magic happens when one agent uses computer use to interact with the other agent's interface, effectively outsourcing complex subtasks.

Hands-On: Building Your First Agent-to-Agent System

Anthropic provides a ready-to-run quickstart to demonstrate this. Check out the GitHub repo for complete code in Python and TypeScript.

Step 1: Set Up the Browser Agent

The browser agent launches a Playwright-controlled Chromium instance, exposing it via HTTP for remote access. It processes natural language instructions to browse, click, and extract data.

Here's a simplified setup:

npm install @anthropic-ai/sdk playwright

Core code snippet for the browser agent server:

import { Anthropic } from '@anthropic-ai/sdk';
import { chromium } from 'playwright';

const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });

// Launch browser and expose via /computer-use endpoint
async function handleComputerUseRequest(browserUrl: string, instruction: string) {
  const response = await anthropic.messages.create({
    model: 'claude-3-5-sonnet-20241022',
    max_tokens: 1024,
    tools: [{ type: 'computer_use', params: { browser_url: browserUrl } }],
    messages: [{ role: 'user', content: instruction }],
  });
  // Execute tool calls on the browser
}

Run it locally: npm run browser-agent. It spins up at http://localhost:3000.

Step 2: Deploy the Shell Agent

The shell agent manages a terminal emulator (xterm.js) in a web view, handling bash commands securely.

Quick install:

npm install xterm
npm run shell-agent

It runs on http://localhost:3001, ready for remote control via computer use.

Step 3: Orchestrate with a Router Agent

A lightweight router (also Claude-powered) decides which specialist to call:

  • Web research? Browser agent.
  • System ops? Shell agent.

Example router prompt:

You are a task router. For each user request, select the best agent:
- Browser: web navigation, scraping.
- Shell: file ops, scripts.
Respond with: AGENT_NAME: instruction

Step 4: Agent Calls Agent

The router delegates to a specialist, then uses computer use to 'phone' it:

const specialistResponse = await callSpecialistAgent(task);
const takeoverUrl = specialistResponse.browserUrl || shellUrl;
const controlResponse = await anthropic.messages.create({
  model: 'claude-3-5-sonnet-20241022',
  tools: [{ type: 'computer_use', params: { browser_url: takeoverUrl } }],
  messages: [{ role: 'user', content: `Complete this: ${subtask}` }],
});

This creates a chain: Router → Specialist launch → Control takeover → Task execution → Results back.

Test it: npm run demo from the repo. Watch one agent browse Hacker News while another inspects its session.

Real-World Deployments

Teams are already productionizing this. Stream, a chat SDK provider, built a DevRel agent swarm:

  • Research bot: Gathers SDK integration examples via browser agent.
  • Code bot: Shell agent writes/tests snippets.
  • Reviewer bot: Computer-use controls the code bot's IDE for fixes.

Result? Automated docs and demos, slashing manual work. Their setup uses the quickstart as a base, scaled with queues for concurrency.

For scalability, integrate with actor frameworks. LastMile AI's Apify actor for Anthropic computer use runs agents in cloud sandboxes, perfect for distributed tasks like e-commerce scraping or CI/CD automation.

// Example Apify actor usage
const actor = await Apify.call('lastmile-ai/anthropic-computer-use', {
  prompt: 'Navigate to example.com and extract prices',
  computerUseEnabled: true,
});

Cross-Provider Examples: OpenAI's Swarm

This pattern isn't Anthropic-exclusive. OpenAI's Swarm framework (lightweight agent orchestration) pairs with their o1 models for similar handoffs. A 'researcher' agent hands browser control to a 'analyzer' via shared sessions.

Practical tip: Use VNC/WebRTC for cross-model compatibility. Tools like noVNC bridge Anthropic computer use with OpenAI agents seamlessly.

Challenges and Best Practices

While powerful, agent-to-agent isn't plug-and-play:

  • Latency: Each takeover adds 5-20s. Mitigate with async delegation and short sessions.
  • Cost: Computer use tokens are pricey (~$10/1M input). Batch instructions; use cheaper models for routing.
  • Reliability: Vision errors on dynamic UIs. Add retries, element selectors, and fallback APIs.

Pro Tips:

  • Sandbox everything: Docker + Playwright for browsers, ttyd for shells.
  • Monitor visually: Stream sessions to Weights & Biases or custom dashboards.
  • Hybridize: Direct APIs for structured data, computer use for unstructured UIs.
ChallengeSolutionExample
UI ChangesCSS selectors in promptsClick button with class 'btn-primary'
ConcurrencyActor queues (Apify)10 parallel scrapers
SecurityEphemeral VMsFirecracker microVMs

Future Outlook

Direct agent protocols loom—think HTTP-for-agents with standardized 'takeover' endpoints. Projects like AutoGen and LangGraph are evolving toward this. For now, computer use offers the quickest path to collaborative intelligence.

Start small: Fork the Anthropic quickstart, add your tools, and iterate. In dev workflows, sales automation, or research pipelines, agent-to-agent unlocks 10x efficiency.

This setup turns solo bots into teams, paving the way for autonomous AI operations.


<div style="text-align: center; margin-top: 2rem;"> <a href="https://www.deeplearning.ai/the-batch/my-chatbot-will-call-your-chatbot/" target="_blank" rel="noopener noreferrer" class="view-full-resource-btn" style="display: inline-block; background-color: #f97316; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.2s;">View Full Resource</a> </div>
The #1 Newsletter in AI

Stay ahead of the AI curve

The most important updates, news, and content — delivered in one weekly newsletter.

No spam. Unsubscribe anytime. Privacy policy

ai-agents
anthropic-claude
computer-use
agent-communication
llm-tools
J

About Jennifer Yu

Workflow Automation Specialist

Jennifer covers workflow strategy, no-code platforms, and clear implementation guidance for teams adopting automation.

Comments (0)