Claude Agentsのロゴ

Claude Agents

コミュニティ
phuryn
claude-agents

'Ask Claude', 'have Claude build or review this': drive Claude Code headless (claude -p) from another agent as a peer, builder or fresh reviewer.

概要

公開者phuryn
リポジトリproduct-engineering
スキル名claude-agents
スター
189
フォーク
27
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    phurynがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Claude Agents」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/phuryn/product-engineering/tree/main/agent-teams/skills/claude-agents
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/phuryn/product-engineering.git /tmp/product-engineering
mkdir -p .claude/skills
cp -r /tmp/product-engineering/agent-teams/skills/claude-agents .claude/skills/claude-agents
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでClaude Agentsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にClaude Agentsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Claude Agentsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Claude agents — Claude Code headless as a partner

Any agent can run Claude Code non-interactively (claude -p) and get a full Claude Code session back: the repository's instructions, its tools, a conversation that can be continued. Used that way it is a partner, same standing as the agent calling it — a peer that argues a decision through, a builder that takes a stage, or a reviewer that has never seen the build. This skill is how to brief it, which mode to run it in, and the mechanics, through the wrapper in <skill dir>/scripts/claude_agent.py.

The partner discipline (compact)

The full doctrine is the delegation skill; this is what must hold even when this folder is copied alone.

  1. A delegate gets the why, not just the what. The goal in the owner's terms, the decision it feeds, the facts, the reasoning behind non-obvious choices, the constraints that bind and the traps a smart newcomer would walk into, and how the result will be proved. Never a keystroke script: no prescribed paths, filenames, libraries or steps unless they are hard constraints. A brief with the goal in it comes back with judgement; an instruction-only brief comes back compliant and wrong in the large.
  2. Peer, not tool. Its view is not binding, and neither is yours. A choice you would not have made is a disagreement to surface, not a defect.
  3. Early, not late. The cheapest wins are at framing: the angle, the load-bearing claim, what to cut. A late sign-off is the least valuable use.
  4. Iterate. Three to eight turns is normal. Stopping at turn 1 because a draft came back treats a partner as a one-shot generator.
  5. Converge before surfacing. The human arbitrates intent and taste, not trade-offs two agents could argue through. Bring one result, or a disagreement stated cleanly.
  6. A delegated diff is unreviewed code, and the session that wrote it never clears it. Read it, check the disk, re-run the gate yourself; the independent review is a fresh session (independent-review).
  7. What never delegates: deciding what the product should do; accepting or rejecting a review finding; anything that touches a real system, development included (a deploy, a migration applied to any database, a server's secrets, a live setting): the builder makes each one command and names it, and you run it; final verification; the judgement that a stage is done.
  8. Size, not time. If the brief would be nearly as long as the diff, write the diff yourself.

Peer, builder or reviewer

RoleModeWhat it can doSession
Peer — argue a framing, pressure-test a claim, a second opinion on a planconsult (default)Read, Grep, Glob and the read-only shell (git log, git diff, git status); every write is deniedcontinued turn after turn
Builder — a stage with a goal, its binding decisions and how to prove itbuildEdits, shell, tests; a classifier reviews each action (auto mode)continued within the stage
Reviewer — fresh eyes on an artifact, a plan, a changereviewRead, Grep, Glob only; no settings, hooks, plugins, MCP, project instructions or memoryalways new, never saved
  • A review needs a fresh session. Never the building thread resumed or forked (--fork-session copies the builder's beliefs with its transcript), never a subagent of it. --mode review always starts one and never saves it. It has no shell, so it cannot read a git range: a review of commits (a change before a push, a release) goes through the independent-review skill's wrapper, whose --reviewer claude is this same fresh headless session: it writes the range's log and diffs to a file the reviewer pages through, fails short rounds loudly, and runs the loop until nothing introduced is above Low and no High or Critical of any age is open. Don't give review mode git commands instead: an allow rule such as Bash(git diff:*) also lets git diff --output=<file> write. (2026-11-01, an evals product ran each review round by hand with git commands allowed, because this line did not say where a review of commits goes.)
  • When the caller is itself Claude, a headless Claude is the same model family. A consult still buys a fresh context and a different line of reasoning, but blind spots are shared; for an independent review prefer another family (Grok, which the independent-review skill's wrapper runs by default, as grok-agents describes); without Grok, its fallback is this same fresh headless session, which is accepted.
  • In consult and build the delegate reads what you read. The repository's CLAUDE.md (or AGENTS.md when there is no CLAUDE.md), the user's own ~/.claude/CLAUDE.md, the project's auto-memory, its hooks and skills all load. It is not independent of what is written there — which is the point for a builder and the reason review mode loads none of it.

The opening brief

Claude Code reads the repository's instructions on its own in consult and build, so the brief carries what those files do not: the decision at hand, the conversation so far, what you have already tried and rejected.

WhatExample
TARGETWhat we are producing or deciding, and for whom"a call on whether retries belong in the client or the queue", "stage 3: the export endpoint"
RESEARCHWhat is actually knownlogs, measurements, the source quote, what the owner said, prior attempts
DRAFTThe current version and the variants consideredpaste the artifact, not a description of it
REASONINGWhy you are stuck, or what binds the buildwhat you rejected and why; the trap ("the same string feeds another spawn path, so not in the argument builder"); how it will be proved

In review mode it reads nothing on its own, so the brief also names the files that are the binding spec.

Long briefs go in a file and are read from there: the wrapper sends every prompt on stdin, never as an argument.

bash
python <skill dir>/scripts/claude_agent.py --new --cwd <repo> --read <brief file>
python <skill dir>/scripts/claude_agent.py --new --mode build --cwd <worktree> --read <stage brief>
python <skill dir>/scripts/claude_agent.py --mode review --cwd <repo> --read <review brief>

Run a partner on the strongest model the account offers (--model opus tracks the newest Opus; best picks Fable where the account has it) — the wrapper sends xhigh effort by default and max for a review, because without an explicit level Opus, Sonnet and Haiku 5.5 run at medium (model configuration docs, read 2026-10-24).

Follow-up turns

React like a colleague: agree where it is right, push back where it is wrong, ask why where it surprises you, name what it missed. Do not re-package the goal as a new structured prompt; if you are rewriting the goal in turn 3, you have left the conversation.

bash
python <skill dir>/scripts/claude_agent.py --cwd <repo> "agree on the queue, but a poison message would block the shard — doesn't that kill it?"

A plain call continues the session the wrapper last opened in that directory, in the same mode, on the same model and effort.

Signs you are not done: a critique you have not voiced; a choice it made that you do not buy and did not push on; an option neither of you explored; the temptation to ask the human "which of these two?". Signs you have converged: you would defend the result against your own critique; neither of you is finding new angles; what remains is taste. Surface to the human on genuine deadlock, on ambiguity about what they want, or on a fact only they have.

Resume or start fresh

  • Within a stage or a conversation, resume. The default.
  • A new stage or a new question starts fresh, with --new. What the project knows belongs in its docs and the brief, not in a long thread carrying assumptions the docs have since replaced. If a fresh session would miss something, that is a gap in the docs.
  • Parallel builds get a worktree each. The wrapper keeps one session per working directory, so two worktrees never share one. Two sessions in one directory need a state file each: CLAUDE_AGENT_STATE=<a file per session> on every call for it.
  • An earlier session resumes by id: --session <id>. The wrapper prints every run's id; Claude Code finds an id in any project on the machine and keeps transcripts 30 days by default (sessions docs, read 2026-10-24). --session fails rather than starting a new session.
  • A usage limit makes the partner unavailable, as a missing CLI does. The run fails with the limit's message ("You've hit your session limit · resets 3:45pm", errors docs, read 2026-10-24) and a non-zero exit. Wait if the reset is near; otherwise do the work yourself, and the independent review still applies. The state keeps the session, so after the reset the next call continues it.

How you can tell it worked

The answer came from a session that started with only your brief, its exit code and output were read from the run itself, and anything it built was reviewed before it was trusted.

Mechanics

The script is this skill's own scripts/claude_agent.py. Use its absolute path so it works from any directory, and pass --cwd so the session is scoped to the repository it works in. Python standard library only; --check shows the binary, its version and the state file without running anything, --dry-run prints the exact claude command.

CommandEffect
claude_agent.py "<msg>"Continue this directory's session, else start one (consult)
claude_agent.py --new "<msg>"Force a new session
claude_agent.py --session ID "<msg>"Resume that session; no fallback
claude_agent.py --read FILEMessage from FILE (- for stdin)
claude_agent.py --status / --resetShow / forget this directory's session
FlagDefaultNotes
--modeconsult; a resume keeps the session's last modeconsult / build / review (table below). Applied on every turn.
--modelthe CLI'sAlias or full id. Remembered and re-sent on every resume.
--effortxhigh; review maxlow … max. Remembered and re-sent on every resume, which does not keep it.
--cwd DIRcurrent directoryWhere the session works; sessions are scoped to it.
--add-dir DIR—Extra directory the tools may reach; repeatable; re-sent on resume.
--budget USDnone--max-budget-usd: stops the run at that estimated spend.
--max-turns NnoneStops after N agentic turns.
--schema FILE—A JSON Schema; prints the validated structured_output instead of text.
--mcpoffLoad the configured MCP servers (consult, build).
--timeout SEC3600Kills the run; the state keeps the session if it opened.
--log FILE—Appends the raw stream-json events as they arrive, to tail a long build.
--rawoffPrints the whole result event as JSON.

What each mode sends, every turn:

ModeFlags
consult--permission-mode dontAsk --permission-prompts none --tools Read,Grep,Glob,Bash --strict-mcp-config
build--permission-mode auto --permission-prompts none --strict-mcp-config (default tools)
review--restricted --tools Read,Grep,Glob --strict-mcp-config --permission-mode dontAsk --permission-prompts none --no-session-persistence, CLAUDE_CODE_DISABLE_AUTO_MEMORY=1, and CLAUDE_CODE_EFFORT_LEVEL removed

All three add -p --output-format stream-json --verbose --effort <level>. After each run the answer goes to stdout and one line to stderr — new or resumed session id, mode and the permission mode that actually ran, the model that ran, the effort the reply ran at, this run's cost and the session's, turns — plus a warning when any of those differs from what was asked, the list of denied tool calls, and a warning when Claude Code saved no transcript. Read that line before trusting a round. A failed run prints nothing on stdout and exits non-zero (2 for a bad argument to the wrapper).

Session continuity

One small state file per working directory under <claude config dir>/claude-agent/ records the session id Claude Code reported when it opened the session, with its mode, model, effort and extra directories; the next call resumes that id (--resume <id>) with the same settings. Not --continue: that takes the most recent conversation in the directory, whoever started it, and claude -p --continue includes every -p session there (CLI reference, read 2026-10-24).

The state names the last session that opened in the directory, whether the run then succeeded or failed. A usage limit or a timeout part-way through a build leaves it on that session, which holds the brief and the work so far, so the next call continues it; --new starts over. A resume falls back to a new session only when Claude Code has no transcript for the id (No conversation found with session ID, exit 1, no session opened — observed 2026-10-24); with --session it fails instead.

claude -p --resume restores the model and nothing else the wrapper sets. Observed 2026-10-24, Claude Code 2.1.310: a session started on Haiku at effort low with --permission-mode dontAsk, three tools and no MCP servers, resumed with a bare --resume <id>, came back on Haiku — but at effort medium, in permission mode default, with 145 tools and 11 MCP servers. The docs agree: a -p resume starts in the permission mode a new -p run would, and --add-dir, --mcp-config and --settings must be passed again (sessions docs, read 2026-10-24). So the wrapper re-sends mode, model, effort and directories on every turn. When calling claude -p --resume directly, pass them all every time — a build session resumed without its permission mode runs in a mode that denies its writes and reports work it never did.

What a -p session loads

Plain claude -pconsult / buildreview--bare
Project CLAUDE.md / AGENTS.md, user ~/.claude/CLAUDE.mdyesyes (the project file observed)no (observed)no
Auto-memory for the directoryyesyesnono
Hooks, skills, plugins from settingsyesyes; consult lists the skills but has no Skill tool to run themno (--restricted ignores user, project and local settings)no
MCP serversall configured, the account's connectors includednone unless --mcpnoneonly --mcp-config
Loginsubscription or API keysamesameANTHROPIC_API_KEY or apiKeyHelper only

Observed 2026-10-24: a plain claude -p in a scratch folder loaded 145 tools, 11 MCP servers (the account's mail, chat and drive connectors among them), 15 plugins and 110 skills, and its first reply wrote a 47k-token prompt cache — $0.0096 on Haiku 5.5, against $0.0012 with three tools and no MCP. A delegate does not need the owner's mailbox; the modes leave MCP out unless asked. --bare is not usable on a subscription login (it never reads OAuth or the keychain) and skips the project's instructions; the headless docs (read 2026-10-24) say it will become the default for -p in a future release, which would change all of this — re-check claude --help when the wrapper's runs start answering without the project's instructions.

Without --bare or --restricted, a -p run executes the project's hooks, and without --strict-mcp-config connects its .mcp.json servers, even in a folder never trusted, with no trust dialog (headless docs, read 2026-10-24). Consult and build keep the hooks; point them only at repositories you trust.

Permission modes, and why nothing may wait on a prompt

Since 2.1.302 a -p run with no mode set starts in Manual, which denies every call that needs approval, unless a settings file's defaultMode says otherwise (permission-modes docs, read 2026-10-24) — so the mode depends on the machine unless it is passed. The wrapper always passes one, plus --permission-prompts none (2.1.259+): anything that would prompt is denied at once, Claude is told nobody can approve it, and the run continues. dontAsk still runs what an allow rule in the user's settings permits; --restricted (review) does not read those settings.

Observed 2026-10-24: in consult, the Write tool was absent, echo x > f and a python -c file write were both denied (two permission_denials), git status ran, and the disk was unchanged; in review the session had only Read, Grep and Glob and did not attempt a write; in build (auto mode, Haiku 5.5) it edited a file, ran it and ran git status. Auto mode needs a supported model (on the Anthropic API: Opus 4.6+, Sonnet 4.6+, Haiku 5.5, Fable; narrower on cloud providers) and an organization that has not turned it off; otherwise the session starts in Manual (permission-modes docs, read 2026-10-24), and the wrapper's stderr line shows the mode that actually ran. Auto mode is a safety net, not a boundary: production, and every other real system, stays out of a build brief.

Calling it from inside a sandbox

The claude process needs the network, to reach the API, and write access to its config directory (claude auth status prints it as configDirectory), to save the session. A sandbox that blocks either breaks the partner in a different way:

  • Codex workspace-write (Codex CLI 0.159 on Windows, observed 2026-10-24). Default config: the session opened, then the run failed with API Error: Connection refused … (ECONNREFUSED) after about three minutes of retries. With -c sandbox_workspace_write.network_access=true it answered in seven seconds but saved no transcript, so the next call could not continue it — the wrapper now warns when that happens. Adding the config directory as a writable root made a two-turn conversation work:

    bash
    codex exec -s workspace-write \
      -c sandbox_workspace_write.network_access=true \
      -c "sandbox_workspace_write.writable_roots=['<claude config dir>']" ...

    The two keys are in Codex's config reference and its approvals-and-security page (read 2026-10-24), as [sandbox_workspace_write] entries in config.toml too. danger-full-access also works, with no sandbox at all. Codex ran the command through PowerShell, so a message with quotes belongs in a file passed with --read.

  • Other agents' sandboxes (Cursor, Gemini CLI, OpenCode, Grok Build): not tested here. The same two needs apply; check the disk for the transcript, or read the wrapper's warning.

Cost, limits and long runs

  • Login decides the bill. On a Claude subscription a run draws on the plan's usage limits; with an API key it is billed per token. The cost the result reports is a client-side estimate either way (headless docs, read 2026-10-24). On resume total_cost_usd is the session's whole total; the wrapper prints this run's cost from model_usage_since_last_result beside it (observed 2026-10-24).
  • --budget and --max-turns stop a run with a non-zero exit: the budget as error_max_budget_usd (observed 2026-10-24), and spend can pass the cap, so leave headroom (CLI reference). --max-turns is in the CLI reference though claude --help does not list it.
  • Usage limits show up as a failed run carrying the limit's message; every stream also carries a rate_limit_event with the five-hour and seven-day utilization (observed 2026-10-24).
  • A build round takes minutes to an hour. Run the wrapper as a background job of your own harness rather than inside a shell tool with a short timeout, and --log the events to watch progress. After its last turn a -p run waits up to ten idle minutes for background work it started (CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS, headless docs, read 2026-10-24).
  • Background sessions (claude --bg "<task>", then claude agents --json, claude logs <id>, claude attach <id>, claude stop <id>) are for a human watching sessions. --bg cannot be combined with -p, and prints a session id and returns at once instead of a result (CLI help and headless docs, read 2026-10-24); the wrapper runs in the foreground.

Binary lookup

$CLAUDE_BIN, then claude on PATH (on Windows the native claude.exe is preferred over an npm .cmd shim), then the native installer's locations (~/.local/bin, ~/.claude/local, and on macOS /opt/homebrew/bin, /usr/local/bin). The wrapper refuses a Claude Code older than 2.1.259, which lacks --permission-prompts.

Gotchas captured

  • Effort is visible only in the transcript. The JSON result names the model (modelUsage, and the init event's model) but not the effort; the transcript records it on every reply, and the wrapper reads it from there, best-effort, since that format is internal (observed 2026-10-24). CLAUDE_CODE_EFFORT_LEVEL in the environment overrides --effort (env-vars docs); the wrapper warns when it is set, and in review mode removes it, so a review runs at the effort it asks for.
  • An unknown model is not caught up front. The session opens, the first request fails with There's an issue with the selected model (API 404), the exit is 1, and the state keeps that session, so pass --model again or --new (observed 2026-10-24).
  • A failed run's result is the error text. The wrapper prints it on stderr, never as the answer; check is_error, not the exit code alone, when calling claude -p directly.
  • Nested under Claude Code it still works. The child inherits CLAUDECODE=1 and CLAUDE_CODE_CHILD_SESSION=1; -p sessions are still saved and resumable (observed 2026-10-24; env-vars docs agree).
  • The prompt goes on stdin, capped at 10 MB (headless docs); larger material goes in a file the brief names. Stdin is closed after it, or the run waits for more.

Not this skill

The general doctrine — briefs, what never delegates, parallel work, verifying what comes back — is delegation. The release-gate review loop is independent-review. Driving the Codex CLI the same way is codex-agents.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Claude Agents」では何ができますか?

'Ask Claude', 'have Claude build or review this': drive Claude Code headless (claude -p) from another agent as a peer, builder or fresh reviewer.

TypingMindでClaude Agentsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Claude Agentsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにClaude Agentsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/phuryn/product-engineering/tree/main/agent-teams/skills/claude-agentsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Claude Agentsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Claude Agentsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもClaude Agentsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Claude Agents」は無料ですか?

はい。phurynがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇