據 AlphaMoat 統計,截至 2026-09,Claude Code Runner 累計下載 3,862 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 2,701 位,在「開發程式設計」分類(577 個)中排名第 351 位。
| 平台 | 累計安裝 | 累計下載 | 星標 | 評論 |
|---|---|---|---|---|
| ClawHub ↗ | 101 | 3513 | 1 | - |
| SkillHub ↗ | 100 | 3862 | 2 | — |
各平台的計數口徑不同,統計時間不一致。
它可切換執行使用者、將專案複製到臨時目錄、執行任務後同步改動,並捕獲標準輸出與錯誤;還會自動回答確認提示。執行依賴 Unix 類系統和已安裝的 Claude Code,切換使用者需要 root 或 sudo 許可權。自動確認及回寫專案都可能產生實際影響,使用前應檢查任務許可權、臨時副本和同步範圍。
資料釋出於 2026-10-29
以下是根據技能文件生成的示例,不代表實際執行結果。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。 該技能有同名的其他版本,調整前的資料歸屬當前下載量最大的這一個。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-09 | 3862 | — | 2 |
| 2026-08 | 3517 | +5.4% | 2 |
| 2026-07 | 3336 | +22.4% | 2 |
| 2026-06 | 2725 | +9.2% | 1 |
| 2026-05 | 2496 | — | 1 |
| 2026-03 | 1082 | — | 1 |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
--- name: claude-code-runner description: "Execute programming tasks via Claude Code using PTY-based invocation. Handles non-TTY environments, auto-responds to prompts, and manages file synchronization." --- # Claude Code Runner ## Overview A wrapper skill for running Claude Code programmatically in non-interactive environments. Uses PTY (pseudo-terminal) to handle TTY-required operations and automatically responds to confirmation prompts.
## Features
- **PTY-based execution**: Works in non-TTY environments (containers, CI/CD, background processes)
- **Auto-respond to prompts**: Automatically answers "Do you want to..." confirmations
- **User switching**: Runs as specified non-root user
- **File synchronization**: Copies project to temp directory, executes, syncs changes back
- **Timeout handling**: Configurable timeout with proper cleanup
- **Output capture**: Captures and returns full stdout/stderr
## Installation
```bash
# Clone the skill
git clone https://github.com/lhl09120/claude-code-runner-en.git
# Make script executable
chmod +x claude-code-runner-en/scripts/run_claude.py
```
## Usage
### Basic Usage
```python
from claude_code_runner import run_claude_code
result = run_claude_code(
workdir='/path/to/project',
prompt='Refactor the authentication module to use JWT tokens',
user='lighthouse',
timeout=300
)
print(result)
```
### Via Command Line
```bash
python3 scripts/run_claude.py /path/to/project "Your task description here"
```
### Advanced Options
```python
result = run_claude_code(
workdir='/root/repo/my-project',
prompt='''
1. Review the codebase
2. Identify security vulnerabilities
3. Fix any issues found
4. Add appropriate tests
''',
user='developer',
timeout=600 # 10 minutes
)
```
## API Reference
### `run_claude_code(workdir, prompt, user='lighthouse', timeout=300)`
Execute a Claude Code task in a PTY environment.
**Parameters:**
- `workdir` (str): Working directory containing the project
- `prompt` (str): Natural language task description
- `user` (str): User to run as (default: 'lighthouse')
- `timeout` (int): Timeout in seconds (default: 300)
**Returns:**
- `str`: Combined stdout and stderr output
**Behavior:**
1. Copies project to temporary directory
2. Changes ownership to specified user
3. Executes Claude Code via PTY
4. Auto-responds to confirmation prompts
5. Syncs changes back to original directory
6. Cleans up temporary files
## Use Cases
### 1. Automated Code Review
```python
result = run_claude_code(
workdir='/root/repo/project',
prompt='Review this codebase and identify potential bugs or improvements'
)
```
### 2. Refactoring Tasks
```python
result = run_claude_code(
workdir='/root/repo/legacy-app',
prompt='Refactor the database layer to use SQLAlchemy ORM instead of raw SQL'
)
```
### 3. Adding Features
```python
result = run_claude_code(
workdir='/root/repo/api-service',
prompt='''
Add a new REST endpoint for user profile management:
- GET /api/users/{id}/profile
- PUT /api/users/{id}/profile
- Include validation and error handling
- Add unit tests
'''
)
```
### 4. Bug Fixes
```python
result = run_claude_code(
workdir='/root/repo/web-app',
prompt='Fix the memory leak in the WebSocket connection handler'
)
```
## Requirements
- Python 3.8+
- Claude Code installed and in PATH
- Unix-like environment (Linux/macOS)
- Root or sudo access (for user switching)
## Configuration
### Environment Variables
- `CLAUDE_CODE_USER`: Default user to run as (default: 'lighthouse')
- `CLAUDE_CODE_TIMEOUT`: Default timeout in seconds (default: 300)
### Customization
Edit `scripts/run_claude.py` to customize:
- Auto-response keywords
- Temp directory location
- Sync behavior
- Output formatting
## Troubleshooting
### "Permission denied" errors
Ensure the script is run with sufficient privileges to:
- Create temporary directories
- Change file ownership
- Switch to target user
### Claude Code not found
Make sure Claude Code is installed and in the system PATH:
```bash
which claude
```
### Task timeout
Increase the timeout for long-running tasks:
```python
run_claude_code(workdir, prompt, timeout=600) # 10 minutes
```
### Interactive prompts not auto-responded
Add new prompt patterns to the auto-respond logic:
```python
if b'new prompt text' in output:
os.write(master_fd, b'y\n')
```
## Limitations
- Requires Unix-like environment (uses PTY)
- Requires root/sudo for user switching
- Claude Code must be installed separately
- May not handle all edge cases of interactive prompts
## License
MIT License
Copyright (c) 2026 lhl09120
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.
See LICENSE file for full details.
## Changelog
### v1.0.0 (2026-02-27)
- Initial release
- PTY-based Claude Code execution
- Auto-response to confirmation prompts
- File synchronization
- User switching support
用 gh 命令列工具檢視 GitHub 上的 PR 檢查、工作流執行與 API 查詢的技能。
聚合 16 個搜尋引擎、無需 API Key 的檢索技能。
用命令列直接列出、配置、授權並呼叫 MCP 服務與工具。
根據文字描述生成 Mermaid 圖表程式碼。
用受管 OAuth 訪問 YouTube Data API,檢索影片並管理頻道內容。
透過受管的 OAuth 連線訪問 GitHub REST API。
覆蓋規劃、實現、驗證與測試的編碼工作流技能。
整理 Docker 常用命令與容器工作流的技能。
資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。