Claude Code Launcher
Overview
This skill automates the process of launching Claude Code in a new terminal window with Remote Control enabled. It streamlines the workflow of:
- 1. Opening a fresh terminal window
- Navigating to a project directory
- Starting Claude Code
- Activating Remote Control mode
- Handling user confirmations (if needed)
- Capturing and displaying the final state
Perfect for switching between projects quickly or sharing Claude Code sessions across devices.
Usage
Basic Launch
CODEBLOCK0
With Options
CODEBLOCK1
From OpenClaw Chat
Simply ask:
- - "Launch Claude Code in proposal-generator with Remote Control"
- "Open the ai-native-lms project and enable Remote Control"
- "Start Claude Code in ~/dev/edikar-standalone"
How It Works
Step 1: Terminal Preparation
- - Opens a new Terminal window using macOS automation
- Ensures fresh shell environment (
zsh) - Waits for the window to be ready
Step 2: Project Navigation
- - Changes directory to the specified project path
- Validates that the directory exists
- Reports any path resolution errors
Step 3: Claude Code Launch
- - Executes
claude code command - Waits for Claude Code interface to fully load (~5 seconds)
- Monitors for startup errors (missing dependencies, permission issues)
Step 4: Remote Control Activation
- - Types
/remote-control command into Claude Code - Presses Enter to submit
- Waits for Remote Control UI to appear (~3-6 seconds)
Step 5: User Confirmation
- - Detects the "Continue" option in Remote Control menu
- Presses Enter to confirm (or prompts user if needed)
- Validates that Remote Control is now active
Step 6: Session Capture
- - Takes a screenshot of the final state
- Displays the Remote Control session URL
- Extracts and displays QR code information
- Reports success or any errors encountered
Error Handling
The skill handles these common scenarios:
| Issue | Recovery |
|---|
| Terminal fails to open | Retries once, then reports error |
| Project path doesn't exist |
Displays helpful path resolution suggestions |
| Claude Code not installed | Reports missing dependency and suggests
brew install claude |
| Claude Code hangs | Timeout after 15 seconds, allows manual intervention |
| Remote Control fails to activate | Logs error details, suggests checking Claude version |
| Terminal permissions denied | Requests user to enable Screen Recording in System Preferences |
| Network connectivity issue | Waits up to 10 seconds for reconnection |
Resources
scripts/launchclaudecode.sh
Main automation script using Peekaboo CLI for:
- - Terminal window management
- Keyboard/text input automation
- Screenshot capture
- Error detection and recovery
- Logging all operations to INLINECODE4
references/troubleshooting.md
Common issues and solutions:
- - Permission setup (Screen Recording, Accessibility)
- Claude Code installation and updates
- Terminal app configuration
- Network troubleshooting
Prerequisites
✅ Installed: peekaboo (for UI automation)
✅ Installed: claude CLI (Claude Code)
✅ System: macOS with Terminal.app
✅ Permissions: Screen Recording + Accessibility enabled
To enable permissions:
CODEBLOCK2
What You Get
After launching, you'll have:
- - ✅ New Terminal window with Claude Code running
- ✅ Remote Control session active and shareable
- ✅ Session URL for accessing from other devices
- ✅ QR code for mobile devices (scan in Claude app)
- ✅ Full context of your project available to Claude
- ✅ Capability to pause/resume across devices
Example Workflow
CODEBLOCK3
Related Commands
- -
/remote-control - Activate Remote Control in Claude Code - INLINECODE8 - Start Claude Code interactive session
- INLINECODE9 - macOS UI automation (used internally)
Need help? See
references/troubleshooting.md for common issues and solutions.
Claude Code 启动器
概述
该技能可自动在新终端窗口中启动Claude Code并启用远程控制功能。它简化了以下工作流程:
- 1. 打开新终端窗口
- 导航至项目目录
- 启动Claude Code
- 激活远程控制模式
- 处理用户确认(如需)
- 捕获并显示最终状态
非常适合快速切换项目或在设备间共享Claude Code会话。
使用方法
基础启动
bash
claude-code-launcher /path/to/project
带选项启动
bash
claude-code-launcher /path/to/project --verbose --screenshot
在OpenClaw聊天中使用
只需输入:
- - 在proposal-generator中启动Claude Code并启用远程控制
- 打开ai-native-lms项目并启用远程控制
- 在~/dev/edikar-standalone中启动Claude Code
工作原理
步骤1:终端准备
- - 使用macOS自动化打开新终端窗口
- 确保使用全新的shell环境(zsh)
- 等待窗口准备就绪
步骤2:项目导航
- - 切换到指定项目路径
- 验证目录是否存在
- 报告路径解析错误
步骤3:启动Claude Code
- - 执行claude code命令
- 等待Claude Code界面完全加载(约5秒)
- 监控启动错误(缺少依赖、权限问题)
步骤4:激活远程控制
- - 在Claude Code中输入/remote-control命令
- 按回车提交
- 等待远程控制UI出现(约3-6秒)
步骤5:用户确认
- - 检测远程控制菜单中的继续选项
- 按回车确认(或根据需要提示用户)
- 验证远程控制已激活
步骤6:会话捕获
- - 截取最终状态截图
- 显示远程控制会话URL
- 提取并显示二维码信息
- 报告成功或遇到的错误
错误处理
该技能处理以下常见场景:
| 问题 | 恢复措施 |
|---|
| 终端无法打开 | 重试一次,然后报告错误 |
| 项目路径不存在 |
显示有用的路径解析建议 |
| Claude Code未安装 | 报告缺少依赖并建议brew install claude |
| Claude Code无响应 | 15秒后超时,允许手动干预 |
| 远程控制无法激活 | 记录错误详情,建议检查Claude版本 |
| 终端权限被拒绝 | 请求用户在系统偏好设置中启用屏幕录制 |
| 网络连接问题 | 等待最多10秒重新连接 |
资源
scripts/launchclaudecode.sh
使用Peekaboo CLI的主要自动化脚本,用于:
- - 终端窗口管理
- 键盘/文本输入自动化
- 截图捕获
- 错误检测与恢复
- 将所有操作记录到~/.openclaw/workspace/logs/claude-code-launcher.log
references/troubleshooting.md
常见问题及解决方案:
- - 权限设置(屏幕录制、辅助功能)
- Claude Code安装与更新
- 终端应用配置
- 网络故障排除
前提条件
✅ 已安装: peekaboo(用于UI自动化)
✅ 已安装: claude CLI(Claude Code)
✅ 系统: 配备Terminal.app的macOS
✅ 权限: 已启用屏幕录制和辅助功能
启用权限:
系统设置 → 隐私与安全性 → 屏幕录制 → 启用OpenClaw
系统设置 → 隐私与安全性 → 辅助功能 → 启用OpenClaw
使用效果
启动后,您将获得:
- - ✅ 运行Claude Code的新终端窗口
- ✅ 已激活且可共享的远程控制会话
- ✅ 可从其他设备访问的会话URL
- ✅ 移动设备二维码(在Claude应用中扫描)
- ✅ Claude可访问项目的完整上下文
- ✅ 跨设备暂停/恢复功能
示例工作流程
用户:在edikar-standalone中启动Claude Code并启用远程控制
↓
技能打开新终端
↓
cd ~/dev/edikar-standalone
↓
claude code
↓
/remote-control
↓
[确认继续]
↓
截图已捕获
↓
用户看到:
- 会话URL:https://claude.ai/code/session_...
- 显示二维码
- 可从手机/平板访问
相关命令
- - /remote-control - 在Claude Code中激活远程控制
- claude code - 启动Claude Code交互式会话
- peekaboo - macOS UI自动化(内部使用)
需要帮助? 请参阅references/troubleshooting.md了解常见问题及解决方案。