---
name: claude-code-control-5885f9d800c4
description: Control Claude Code programmatically through visible Terminal.app
  windows on macOS.
---

# Claude Code Control

Control Claude Code programmatically through visible Terminal.app windows on macOS.

## How It Works

Uses AppleScript to:
1. Open Terminal.app and launch `claude code` in a project directory
2. Type commands via System Events keystrokes
3. Capture screenshots of just the Terminal window (not full screen)
4. Record full sessions with timestamped logs

## Requirements

- macOS
- Node.js 18+
- Claude Code installed and authenticated
- Accessibility permissions for Terminal.app + Script Editor (System Settings → Privacy & Security → Accessibility)

## Usage

```javascript
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


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/claude-code-control/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/claude-code-control/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, DevOps / SRE, ML / AI Engineer
Specialties: Backend
Tools: Applescript, Terminal
Country applicability: United Kingdom, United States
Classification basis: Source catalog labels
Instruction SHA-256: 04f7d736722cecf82080de234c332cfe5104c15c3c337cc9fd709fe49f8a4adf
