claude-code
Skill này làm gì
Skill này chỉ cho AI cách chạy Claude Code ở chế độ không tương tác như một trợ lý chỉnh sửa mã, phân tích dự án hoặc review công việc. Skill dành cho nhà phát triển muốn một mô hình thứ hai để review hoặc thực hiện tác vụ.
Khi nào nên dùng
- ✓Khi bạn muốn giao một tác vụ viết code hoặc refactor cho Claude Code và nhận lại kết quả.
- ✓Khi bạn muốn ý kiến thứ hai hoặc một bản review độc lập từ một mô hình AI khác.
- ✓Khi bạn muốn nhiều trợ lý Claude Code cùng làm các phần khác nhau của một tác vụ cùng lúc.
Liên kết skill
https://github.com/kortix-ai/suna/blob/dev/.agents/skills/claude-cli/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Nhờ Claude Code review các thay đổi mã của tôi và liệt kê mọi lỗi nó tìm thấy.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết một chỉ dẫn rõ ràng, chạy lệnh claude ở chế độ headless với thư mục và thiết lập quyền phù hợp, lưu đầu ra, rồi tự kiểm tra các file đã thay đổi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Claude Code as a Sub-Agent
Claude Code is Anthropic's terminal coding agent. Its headless mode,
claude -p (a.k.a. --print), makes it a disposable sub-agent: you write the
metaprompt, Claude explores/edits/runs commands on its own, and returns a final
message you capture and verify. You stay the planner; Claude is the implementer —
it's a strong long-context planner, so this is useful for reviews, big-picture
design, and cross-cutting refactors.
Golden rule: Claude's self-report is a claim, not the truth. Capture its output, then independently verify the artifacts yourself (read the files, re-run the tests) before treating the task as done.
Verified locally: claude 2.1.167. Confirm install with claude --version.
The core command
claude -p "your metaprompt here" \
--add-dir <workdir> \
--permission-mode <default|acceptEdits|plan|bypassPermissions> \
--output-format json >/tmp/claude_<rand>.json 2>>/tmp/claude_<rand>.log
-p, --print— headless: print the response and exit. Required for scripting.- Prompt as the arg, OR pipe via stdin:
echo "$PROMPT" | claude -p(good for long/generated prompts). --output-format—text(default),json(single object withresult+session_id+ cost/usage), orstream-json(NDJSON events as they arrive). Usejsonfor clean capture and to grab thesession_idfor resume.- Redirect stdout to a capture file and stderr to a log so progress noise
doesn't pollute your context. Generate
<rand>once per run. --model <alias|id>— pin the model (e.g.opus,sonnet, or a full id).--add-dir <dir>...— extra directories Claude may read/write.--append-system-prompt <text>— inject extra instructions/persona.
Permission modes (pick the least privilege)
default— Claude asks before edits/commands. In headless-pit cannot prompt, so write actions are effectively blocked → good for read-only review/analysis.plan— Claude plans but does not edit. Use for "design this / find the bug".acceptEdits— auto-accepts file edits. Use for real implementation.bypassPermissions(or--dangerously-skip-permissions) — no gating at all. Powerful; only use when the user has explicitly authorized autonomous edits AND the working dir is scoped, or in a throwaway dir. When unsure, ask which mode before granting write access.
Output & session resume
- Parse
--output-format json: theresultfield is the final message; thesession_idfield lets you continue the same conversation. - Resume with context intact:
claude -p --continue "now also update the tests" # most recent session claude -p --resume <session-id> "..." # a specific session - Use resume for multi-turn delegation (draft → refine → fix) instead of re-sending all context.
Delegation patterns
- One-shot task — scope
--add-dir,acceptEdits, capture, verify. - Second opinion / adversarial review —
planmode, ask Claude to critique your diff or find bugs. Different model, different blind spots. - Plan/implement split — Claude designs; you implement (or vice-versa).
- Parallel fan-out — for N independent tasks, launch N
claude -pruns, each with its own capture/log file. For concurrent WRITE runs, give each its owngit worktree adddir and point--add-dirthere to avoid edit collisions.
The supervision loop (never skip)
- Delegate —
claude -p ... --output-format json >out 2>>log. - Capture — read the
resultfromout(andlog/stream-json for detail). - Verify INDEPENDENTLY — do not trust "tests pass" / "done":
git status/git diffto see what actually changed.- Read the changed files yourself.
- Re-run the build/tests/linter yourself and read the real output.
- Iterate — if wrong,
claude -p --continue "<correction>"and repeat. - Report — state what changed, what you verified, and how. Say plainly when something failed or was skipped.
Cleanup: remove /tmp/claude_* capture/log files (and any throwaway worktrees)
when done.
Câu hỏi thường gặp
AI có tin báo cáo của Claude Code không?
Không. Skill nói phần tự báo cáo chỉ là một lời khẳng định, nên cần kiểm tra file đã thay đổi và các bài test trước khi coi tác vụ là xong.
Có cần cài Claude Code không?
Có. Phải cài công cụ dòng lệnh claude, và skill yêu cầu kiểm tra phiên bản trước.
Công việc có thể chạy song song không?
Có. Skill có hướng dẫn chạy nhiều agent cùng lúc, ví dụ trên các phần khác nhau của một tác vụ.
Chi tiết
Mô tả gốc của tác giả
Drive Anthropic's Claude Code CLI (`claude -p`) as a non-interactive coding sub-agent from inside Codex. Use when you want to delegate a coding/analysis/refactor task to Claude, get a second opinion / adversarial review from another model, hand off long-context planning, or fan out parallel agents. Covers the exact `claude -p` flags, permission modes, output capture, JSON/stream-json modes, session resume, parallel fan-out, and the mandatory "delegate → capture → independently verify, never trust the self-report" supervision loop.
repo: kortix-ai/suna
Độ phổ biến
- Sao GitHub
- 20k
- Vị trí xếp hạng
- #10370
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
codex-cli
20kCho phép agent của bạn giao việc viết code hoặc review cho Codex CLI của OpenAI và nhận kết quả về, để một mô hình thứ hai kiểm tra công việc.
commit-dis
20kCho phép agent của bạn lưu riêng các thay đổi trong cuộc trò chuyện này thành một commit trên nhánh Git hiện tại, không push và không tạo nhánh mới.
composio
20kGiúp agent của bạn dùng Composio để kết nối các ứng dụng như Gmail, Slack, GitHub và Notion, cho agent riêng hoặc cho sản phẩm bạn tự xây.
e2e
20kDạy agent của bạn viết test đầu cuối để điều khiển ứng dụng web hoặc di động bằng mục tiêu viết thường và các kiểm tra chính xác.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.