ClavueClavue
CLI · TUI · models

Multi-Agent Workspace Layout

Learn to configure split panes, focus rules, and isolation worktrees for parallel AI agents in imux. Ensure safe, concurrent development workflows.

AdvancedAgent Workflows
multi-agentsplit-panesorchestration

Imux transforms the terminal from a single-threaded command line into a collaborative canvas. By leveraging multi-agent workspaces, developers can run distinct AI agents in isolated contexts simultaneously, allowing for parallel code review, refactoring, and implementation without context collision.

This tutorial covers the structural layout of a multi-agent environment. We will focus on splitting panes for visual separation, establishing focus rules to direct commands correctly, and using worktree isolation to prevent file conflicts between agents. Understanding these mechanics is crucial for maintaining stability when agents operate concurrently.

Whether you are using the native macOS imux desktop app or the Clavue platform, the principles of workspace layout remain consistent. We will walk through the configuration steps to set up a robust, multi-agent terminal environment.

Prerequisites

  • imux desktop app installed (macOS)
  • Clavue account with active membership
  • Basic familiarity with terminal split commands
  • A project repository with Git initialized

Steps

  1. 01

    Initialize the Multi-Agent Workspace

    Start by ensuring your project is in a clean state. Open imux and navigate to your project root. To prepare for multi-agent operations, create a dedicated workspace directory. This acts as the root for your agents. Use the imux workspace init command if available, or simply create a folder structure like agents/ to store temporary worktrees. This separation prevents agents from modifying your main source files directly until changes are reviewed.

  2. 02

    Configure Split Panes for Parallel Agents

    Imux supports native pane splitting. Use the keyboard shortcut Cmd+\ to split the terminal vertically or Cmd+Shift+E for horizontal splits. This allows you to host multiple agent sessions side-by-side. For example, assign the left pane to a 'Refactorer' agent and the right pane to a 'Tester' agent. Ensure each pane has its own distinct agent context by launching separate agent instances within each split. This visual separation helps in monitoring parallel progress without switching tabs.

  3. 03

    Establish Focus Rules and Command Routing

    In a multi-agent setup, it is critical to know which agent receives your input. Imux uses a focus system where only the active pane processes keyboard shortcuts and commands. Use Ctrl+H or Ctrl+J (or your configured keybindings) to move focus between panes. When interacting with agents, ensure the target pane is highlighted. You can also use slash commands like /agent:refactor to explicitly route instructions to specific agents if your configuration supports context-aware routing. This prevents accidental commands from being executed in the wrong context.

  4. 04

    Implement Isolation via Git Worktrees

    To maintain safety, each agent should operate in its own Git worktree. This isolates their changes from the main branch and from each other. In each split pane, run git worktree add agents/agent-1 and git worktree add agents/agent-2. Configure each agent to work within its respective directory. This ensures that if one agent makes a mistake, it does not corrupt the main codebase or interfere with another agent's progress. It also allows you to easily review and merge changes from multiple agents independently.

  5. 05

    Monitor Status Strip Signals

    Imux provides a status strip at the bottom of the terminal window that displays real-time signals about agent activity, network status, and memory usage. Pay attention to these indicators. A flashing icon might indicate an agent is busy or has encountered an error. Use the status strip to quickly assess the health of your multi-agent workflow. If an agent stalls, the status strip can help you decide whether to interrupt the session or adjust the prompt. Regularly check these signals to maintain a smooth development flow.

  6. 06

    Review and Merge Agent Changes

    Once agents have completed their tasks, review the changes in their respective worktrees. Use git diff in each worktree directory to inspect modifications. If the changes are satisfactory, commit them and merge them into the main branch. Imux's sidebar can help visualize these changes. After merging, clean up the worktrees using git worktree remove agents/agent-1. This keeps your workspace tidy and ready for the next round of multi-agent collaboration.

Why Isolation Matters

Multi-agent workflows can become chaotic if agents share the same file system context. Isolation via worktrees ensures that agents operate in controlled environments. This reduces the risk of race conditions, accidental overwrites, and context pollution. It also makes it easier to revert changes if an agent produces incorrect output.

Focus Management Best Practices

Always verify which pane is active before typing. Imux's focus indicators are subtle but crucial. If you frequently switch between agents, consider using distinct colors or labels for each pane to make focus management more intuitive. This reduces cognitive load and prevents errors.

Integrating with Clavue Platform

For advanced multi-agent orchestration, integrate your imux workspace with the Clavue platform. Clavue provides enhanced membership features and model access that can be leveraged for complex agent interactions. Use Clavue's chat interface to coordinate between multiple imux instances if needed.

Tips

  • Use `imux status` to quickly check the health of all active agents.
  • Keep worktrees small and focused to avoid merge conflicts.
  • Use distinct prompts for each agent to clarify their role.
  • Regularly clean up worktrees to free up disk space.

FAQ

Can I run agents from different models in the same workspace?

Yes, imux supports multiple models. You can configure different agents in separate panes to use different AI models from Clavue, allowing for diverse capabilities in a single workflow.

How do I merge changes from multiple agents safely?

Review each worktree's changes individually using git diff. Commit them separately, then merge them into the main branch. This ensures you can resolve conflicts incrementally.

What happens if an agent crashes or hangs?

Imux's status strip will indicate the issue. You can interrupt the agent using the provided stop command in the active pane. Check the logs for error details.

Do I need a Clavue membership for multi-agent workflows?

While basic imux functionality works without it, advanced model access and enhanced membership features are managed through Clavue. A membership is recommended for full multi-agent capabilities.

Can I use this setup with remote SSH?

Yes, you can configure imux to connect via SSH to remote machines. Ensure that the remote environment has the necessary Git and imux configurations for worktrees to function correctly.