Logo de Claude Agents

Claude Agents

Comunidade
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.

Visão geral

Publicado porphuryn
Repositórioproduct-engineering
Nome da habilidadeclaude-agents
Estrelas
189
Forks
27
Arquivos incluídos
1
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 1

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por phuryn no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Claude Agents no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/phuryn/product-engineering/tree/main/agent-teams/skills/claude-agents
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Claude Agents em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Claude Agents automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Claude Agents não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Claude Agents faz?

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

Por que usar Claude Agents no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Claude Agents é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Claude Agents no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/phuryn/product-engineering/tree/main/agent-teams/skills/claude-agents. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Claude Agents?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Claude Agents?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Claude Agents com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Claude Agents é gratuita?

Sim. A habilidade é publicada no GitHub por phuryn sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇