{"id":46847526,"url":"https://github.com/sstraus/claude-commander","last_synced_at":"2026-03-10T15:11:19.219Z","repository":{"id":335488563,"uuid":"1145966219","full_name":"sstraus/claude-commander","owner":"sstraus","description":"Run Claude Code with a socket API for programmatic command injection","archived":false,"fork":false,"pushed_at":"2026-01-30T15:15:00.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T06:03:28.737Z","etag":null,"topics":["automation","claude","cli","pty","rust","socket-api"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sstraus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-30T12:55:49.000Z","updated_at":"2026-01-31T02:11:48.000Z","dependencies_parsed_at":"2026-01-31T06:03:36.243Z","dependency_job_id":null,"html_url":"https://github.com/sstraus/claude-commander","commit_stats":null,"previous_names":["sstraus/claude-commander"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sstraus/claude-commander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sstraus%2Fclaude-commander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sstraus%2Fclaude-commander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sstraus%2Fclaude-commander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sstraus%2Fclaude-commander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sstraus","download_url":"https://codeload.github.com/sstraus/claude-commander/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sstraus%2Fclaude-commander/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30338988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:03:31.997Z","status":"ssl_error","status_checked_at":"2026-03-10T15:01:30.431Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","claude","cli","pty","rust","socket-api"],"created_at":"2026-03-10T15:11:18.556Z","updated_at":"2026-03-10T15:11:19.199Z","avatar_url":"https://github.com/sstraus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Commander\n\nRun [Claude Code](https://claude.ai/code) with a socket API for programmatic command injection.\n\n## Features\n\n- **Full TUI**: See Claude Code's interactive UI in your terminal\n- **Socket API**: Send prompts via Unix socket / Windows named pipe\n- **Zero overhead**: Native Rust binary, ~600KB\n- **Cross-platform**: macOS, Linux, Windows\n\n## Installation\n\n### Download binary\n\nDownload from [Releases](https://github.com/sstraus/claude-commander/releases):\n\n```bash\n# macOS (Apple Silicon)\ncurl -L https://github.com/sstraus/claude-commander/releases/latest/download/claudec-macos-arm64 -o claudec\nchmod +x claudec\n\n# macOS (Intel)\ncurl -L https://github.com/sstraus/claude-commander/releases/latest/download/claudec-macos-x64 -o claudec\nchmod +x claudec\n\n# Linux (x64)\ncurl -L https://github.com/sstraus/claude-commander/releases/latest/download/claudec-linux-x64 -o claudec\nchmod +x claudec\n\n# Linux (ARM64)\ncurl -L https://github.com/sstraus/claude-commander/releases/latest/download/claudec-linux-arm64 -o claudec\nchmod +x claudec\n```\n\n### Build from source\n\n```bash\ncargo install --git https://github.com/sstraus/claude-commander\n```\n\n## Usage\n\n### Start Claude Commander\n\n```bash\nclaudec\n\n# With arguments for Claude Code\nclaudec -d /path/to/project\n```\n\nThis will:\n1. Launch Claude Code TUI\n2. Detect the session ID from Claude's session file (after logo appears)\n3. Start socket server at `/tmp/claudec-\u003cSESSION_ID\u003e.sock` (Unix) or `\\\\.\\pipe\\claudec-\u003cSESSION_ID\u003e` (Windows)\n4. You can interact via keyboard AND socket API\n\n### Send commands\n\n**Using the Node.js client:**\n\n```bash\nnode client/claude-send.js send \"Hello Claude\"\nnode client/claude-send.js ping\nnode client/claude-send.js status\n```\n\n**Using netcat (Unix):**\n\n```bash\n# Replace \u003cSESSION_ID\u003e with the actual session ID shown by claudec\necho '{\"action\":\"send\",\"text\":\"Hello Claude\"}' | nc -U /tmp/claudec-\u003cSESSION_ID\u003e.sock\n```\n\n**Using Node.js:**\n\n```js\nconst net = require('net');\n\nfunction send(sessionId, cmd) {\n  const sock = process.platform === 'win32'\n    ? `\\\\\\\\.\\\\pipe\\\\claudec-${sessionId}`\n    : `/tmp/claudec-${sessionId}.sock`;\n\n  return new Promise((resolve, reject) =\u003e {\n    const c = net.createConnection(sock, () =\u003e c.write(JSON.stringify(cmd) + '\\n'));\n    c.on('data', d =\u003e { resolve(JSON.parse(d.toString())); c.end(); });\n    c.on('error', reject);\n  });\n}\n\nawait send('abc123-def456', { action: 'send', text: 'Hello Claude' });\n```\n\n## API\n\nAll commands are JSON objects, newline-delimited.\n\n### send\n\nSend text to Claude Code.\n\n```json\n{\"action\": \"send\", \"text\": \"Hello Claude\"}\n{\"action\": \"send\", \"text\": \"partial\", \"submit\": false}\n```\n\n### keys\n\nSend raw key sequences.\n\n```json\n{\"action\": \"keys\", \"keys\": \"\\\\x0d\"}\n```\n\nCommon keys:\n- `\\x0d` - Enter\n- `\\x03` - Ctrl+C\n- `\\x1b` - Escape\n- `\\x1b[A` - Up arrow\n\n### status\n\nGet session status.\n\n```json\n{\"action\": \"status\"}\n```\n\n## Using from Claude Code Hooks\n\nHooks receive session info via stdin JSON. Extract `session_id` to build the socket path:\n\n```bash\n#!/bin/bash\n# Example hook: ~/.claude/hooks/my-hook.sh\n\n# Read hook input from stdin\nINPUT=$(cat)\nSESSION_ID=$(echo \"$INPUT\" | jq -r '.session_id')\n\n# Build socket path\nSOCKET=\"/tmp/claudec-${SESSION_ID}.sock\"\n\n# Send command to claudec\necho '{\"action\":\"send\",\"text\":\"Hello from hook!\"}' | nc -U \"$SOCKET\"\n```\n\nThe hook stdin JSON contains:\n```json\n{\n  \"session_id\": \"abc123-def456-...\",\n  \"cwd\": \"/path/to/project\",\n  ...\n}\n```\n\n## Configuration\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `CLAUDE_SOCKET` | `/tmp/claudec-\u003cSESSION_ID\u003e.sock` | Override socket path |\n| `CLAUDE_CMD` | `claude` | Claude Code command |\n| `CLAUDE_CONFIG_DIR` | `~/.claude` | Claude config directory |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsstraus%2Fclaude-commander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsstraus%2Fclaude-commander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsstraus%2Fclaude-commander/lists"}