据 AlphaMoat 统计,截至 2026-09,Claude Code Runner 累计下载 3,862 次、获 2 个星标,在全部 5,078 个 AI 技能中排名第 2,701 位,在「开发编程」分类(577 个)中排名第 351 位。
| 平台 | 累计安装 | 累计下载 | 星标 | 评论 |
|---|---|---|---|---|
| ClawHub ↗ | 101 | 3,513 | 1 | - |
| SkillHub ↗ | 100 | 3,862 | 2 | — |
各平台的计数口径不同,统计时间不一致。
它可切换运行用户、将项目复制到临时目录、执行任务后同步改动,并捕获标准输出与错误;还会自动回答确认提示。运行依赖 Unix 类系统和已安装的 Claude Code,切换用户需要 root 或 sudo 权限。自动确认及回写项目都可能产生实际影响,使用前应检查任务权限、临时副本和同步范围。
资料发布于 2026-10-29
以下是根据技能文档生成的示例,不代表实际运行结果。
2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。
| 月份 | 累计下载 | 环比 | 星标 |
|---|---|---|---|
| 2026-09 | 3,862 | — | 2 |
| 2026-08 | 3,517 | +5.4% | 2 |
| 2026-07 | 3,336 | +22.4% | 2 |
| 2026-06 | 2,725 | +9.2% | 1 |
| 2026-05 | 2,496 | — | 1 |
| 2026-03 | 1,082 | — | 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),按月更新。口径说明见数据方法。