Skip to content
Back to skills

Claude Code Control

ASecurity

Control Claude Code programmatically through visible Terminal.app

  • 14 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 7, 2026
ai-agentsjavascriptrustjavanodeapisecurity

Works with

  • claude code
  • terminal
  • api

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill claude-code-control --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Code Control?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Claude Code Control
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-claude-code-control/badge)](https://www.skillsdirectory.com/skills/modbender-claude-code-control)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Claude Code Control
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

Files in this skill

  • README.md4.7 KB
  • SKILL.md2 KB
  • examples/run-atlas-tests.js2.4 KB
  • index-old.js7.5 KB
  • index-shell.js8.2 KB
  • index-v2.js4.9 KB
  • index.js11.2 KB
  • manual-tests.js7.4 KB
  • package-lock.json16 KB
  • package.json965 B
  • tasks/build-economics-widget.js2.6 KB
  • tasks/route-task.js4.3 KB
  • test-focus.js1.6 KB
  • test-vision.js3.4 KB
  • test.js2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…