const cc = require('./index');
// Launch Claude Code visibly
const session = await cc.launch('/path/to/project');
// Send a command (types it + presses Enter)
const result = await cc.send(session, 'write tests for app.py', 30);
// result.screenshot → path to Terminal window screenshot
// Save session recording
await cc.saveSession(session, './recording.json');
// Close
await cc.close(session);
API
Function
Description
launch(path, opts?)
Open Terminal + start Claude Code. Returns session ID
send(id, command, waitSec?)
Type command, wait, screenshot. Returns {screenshot, duration_ms}
verifyScreen(id, desc)
Take a verification screenshot
approveSecurity(id)
Handle "trust this folder" prompt
handleLogin(id)
Send /login command
saveSession(id, path)
Save session log to JSON
close(id) / closeAll()
Exit Claude Code gracefully
takeScreenshot(path?)
Capture Terminal window
focusTerminal()
Bring Terminal to front
Pro Features (Coming Soon)
🎬 Video recording of sessions
🤖 Multi-agent / multi-terminal orchestration
📊 Session analytics
🔄 Session replay
🌐 Remote control via SSH
1---2name: claude-code-control3description: Claude Code Control4---5# Claude Code Control67Control Claude Code programmatically through visible Terminal.app windows on macOS.89## How It Works1011Uses AppleScript to:121. Open Terminal.app and launch `claude code` in a project directory132. Type commands via System Events keystrokes143. Capture screenshots of just the Terminal window (not full screen)154. Record full sessions with timestamped logs1617## Requirements1819- macOS20- Node.js 18+21- Claude Code installed and authenticated22- Accessibility permissions for Terminal.app + Script Editor (System Settings → Privacy & Security → Accessibility)2324## Usage2526```javascript27const cc = require('./index');2829// Launch Claude Code visibly30const session = await cc.launch('/path/to/project');3132// Send a command (types it + presses Enter)33const result = await cc.send(session, 'write tests for app.py', 30);34// result.screenshot → path to Terminal window screenshot3536// Save session recording37await cc.saveSession(session, './recording.json');3839// Close40await cc.close(session);41```4243## API4445| Function | Description |46|---|---|47| `launch(path, opts?)` | Open Terminal + start Claude Code. Returns session ID |48| `send(id, command, waitSec?)` | Type command, wait, screenshot. Returns `{screenshot, duration_ms}` |49| `verifyScreen(id, desc)` | Take a verification screenshot |50| `approveSecurity(id)` | Handle "trust this folder" prompt |51| `handleLogin(id)` | Send `/login` command |52| `saveSession(id, path)` | Save session log to JSON |53| `close(id)` / `closeAll()` | Exit Claude Code gracefully |54| `takeScreenshot(path?)` | Capture Terminal window |55| `focusTerminal()` | Bring Terminal to front |5657## Pro Features (Coming Soon)5859- 🎬 Video recording of sessions60- 🤖 Multi-agent / multi-terminal orchestration61- 📊 Session analytics62- 🔄 Session replay63- 🌐 Remote control via SSH
Run npx skillmds@latest add javimosch/claude-code-control in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Claude Code Control It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
javimosch (@javimosch) published this skill. Their other Agent Skills are listed on their SkillMD profile.