claude-code
Delegate coding tasks to Claude Code (Anthropic's CLI agent). Use for building features, refactoring, PR reviews, and iterative coding. Requires the claude CLI installed.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Claude Code
Delegate coding tasks to Claude Code via the Hermes terminal. Claude Code is Anthropic's autonomous coding agent CLI.
Prerequisites
- Claude Code installed:
npm install -g @anthropic-ai/claude-code - Authenticated: run
claudeonce to log in - Use
pty=truein terminal calls — Claude Code is an interactive terminal app
One-Shot Tasks
terminal(command="claude 'Add error handling to the API calls'", workdir="/path/to/project", pty=true)
For quick scratch work:
terminal(command="cd $(mktemp -d) && git init && claude 'Build a REST API for todos'", pty=true)
Background Mode (Long Tasks)
For tasks that take minutes, use background mode so you can monitor progress:
# Start in background with PTY
terminal(command="claude 'Refactor the auth module to use JWT'", workdir="~/project", background=true, pty=true)
# Returns session_id
# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")
# Send input if Claude asks a question
process(action="submit", session_id="<id>", data="yes")
# Kill if needed
process(action="kill", session_id="<id>")
PR Reviews
Clone to a temp directory to avoid modifying the working tree:
terminal(command="REVIEW=$(mktemp -d) && git clone https://github.com/user/repo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && claude 'Review this PR against main. Check for bugs, security issues, and style.'", pty=true)
Or use git worktrees:
terminal(command="git worktree add /tmp/pr-42 pr-42-branch", workdir="~/project")
terminal(command="claude 'Review the changes in this branch vs main'", workdir="/tmp/pr-42", pty=true)
Parallel Work
Spawn multiple Claude Code instances for independent tasks:
terminal(command="claude 'Fix the login bug'", workdir="/tmp/issue-1", background=true, pty=true)
terminal(command="claude 'Add unit tests for auth'", workdir="/tmp/issue-2", background=true, pty=true)
# Monitor all
process(action="list")
Key Flags
| Flag | Effect |
|---|---|
claude 'prompt' |
One-shot task, exits when done |
claude --dangerously-skip-permissions |
Auto-approve all file changes |
claude --model <model> |
Use a specific model |
Rules
-
Always use
pty=true— Claude Code is an interactive terminal app and will hang without a PTY -
Use
workdir— keep the agent focused on the right directory -
Background for long tasks — use
background=trueand monitor withprocesstool -
Don't interfere — monitor with
poll/log, don't kill sessions because they're slow - Report results — after completion, check what changed and summarize for the user
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!