πŸ“„ File detail

utils/swarm/constants.ts

🧩 .tsπŸ“ 34 linesπŸ’Ύ 1,334 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œutils/”, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, …). On the API surface it exposes TEAM_LEAD_NAME, SWARM_SESSION_NAME, SWARM_VIEW_WINDOW_NAME, TMUX_COMMAND, and HIDDEN_SESSION_NAME (and more) β€” mainly types, interfaces, or factory objects.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

export const TEAM_LEAD_NAME = 'team-lead' export const SWARM_SESSION_NAME = 'claude-swarm' export const SWARM_VIEW_WINDOW_NAME = 'swarm-view' export const TMUX_COMMAND = 'tmux' export const HIDDEN_SESSION_NAME = 'claude-hidden'

πŸ“€ Exports (heuristic)

  • TEAM_LEAD_NAME
  • SWARM_SESSION_NAME
  • SWARM_VIEW_WINDOW_NAME
  • TMUX_COMMAND
  • HIDDEN_SESSION_NAME
  • getSwarmSocketName
  • TEAMMATE_COMMAND_ENV_VAR
  • TEAMMATE_COLOR_ENV_VAR
  • PLAN_MODE_REQUIRED_ENV_VAR

πŸ–₯️ Source preview

export const TEAM_LEAD_NAME = 'team-lead'
export const SWARM_SESSION_NAME = 'claude-swarm'
export const SWARM_VIEW_WINDOW_NAME = 'swarm-view'
export const TMUX_COMMAND = 'tmux'
export const HIDDEN_SESSION_NAME = 'claude-hidden'

/**
 * Gets the socket name for external swarm sessions (when user is not in tmux).
 * Uses a separate socket to isolate swarm operations from user's tmux sessions.
 * Includes PID to ensure multiple Claude instances don't conflict.
 */
export function getSwarmSocketName(): string {
  return `claude-swarm-${process.pid}`
}

/**
 * Environment variable to override the command used to spawn teammate instances.
 * If not set, defaults to process.execPath (the current Claude binary).
 * This allows customization for different environments or testing.
 */
export const TEAMMATE_COMMAND_ENV_VAR = 'CLAUDE_CODE_TEAMMATE_COMMAND'

/**
 * Environment variable set on spawned teammates to indicate their assigned color.
 * Used for colored output and pane identification.
 */
export const TEAMMATE_COLOR_ENV_VAR = 'CLAUDE_CODE_AGENT_COLOR'

/**
 * Environment variable set on spawned teammates to require plan mode before implementation.
 * When set to 'true', teammates must enter plan mode and get approval before writing code.
 */
export const PLAN_MODE_REQUIRED_ENV_VAR = 'CLAUDE_CODE_PLAN_MODE_REQUIRED'