Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

zcode-subagent

БесплатноЗапускает вложенные скриптыНе проверен

Delegate a coding task to a ZCode (GLM) subagent and get the result back. Use when the current agent should hand off or parallelize coding work. Keywords…

itechmeatот itechmeat★ 24 звезды на GitHub

Об этом скилле

ZCode Subagent

Lets the current agent call the ZCode (z.ai, GLM engine) desktop app as a coding subagent: hand it a task, then detect completion and read the result, all from the shell. The calling agent dispatches a prompt into the app, detects when the turn finishes, and reads a small structured digest of the result. It never screenshots or scrapes the full transcript, so the caller spends a fixed, tiny token cost per task regardless of how long ZCode worked.

When to use

  • You (a parent agent) need to hand a coding task to ZCode and understand the outcome cheaply.
  • You want ZCode automation without a standalone z.ai API key (the app's logged-in "coding plan" is enough).
  • You need a follow-up prompt in the same ZCode conversation.

Why the desktop app, not the headless CLI

ZCode ships a headless CLI (ZCode.app/Contents/Resources/glm/zcode.cjs -p), and it loads and reaches the API. But the "coding plan" endpoint (.../zcode-plan/...) gates every model request behind an interactive Aliyun captcha that only the app's webview solves, so headless prompts fail with code 3007 captcha verify failed. Driving the app reuses the already-solved captcha and needs no API key. Non-model CLI commands (doctor, skills list --json, plugins list --json) do work headless. Full internals: references/architecture.md.

Do not pre-check or pre-install anything

Just run the script. It resolves its own dependencies and fails with a clear, actionable message naming exactly what is missing. Only when a run actually fails that way do you diagnose - and even then, confirm the thing is really absent before installing (never install on a first negative signal). Pre-emptively "checking prerequisites" wastes turns and, worse, tends to reinstall software that is already present.

Dependencies (for reference when a run does fail): ZCode.app signed in; agent-browser (drives the app over CDP); node; python3; curl (macOS also uses open + osascript).

  • agent-browser is the common false alarm: its PATH symlink is frequently broken, so command -v agent-browser prints nothing while the package is fully installed under npm root -g - and the script resolves the real binary there. So a bare command -v miss is NOT proof it is absent. Only if the script itself dies with "agent-browser not found" do you check ls "$(npm root -g)/agent-browser/bin/agent-browser.js", and only if that is also missing recommend npm i -g agent-browser && agent-browser install (do not install silently). See references/installation.md.
  • ZCode.app missing/not signed in: download from https://zcode.z.ai and log in once (that solves the captcha in-app).

Only macOS auto-launch is implemented. On other platforms, start ZCode manually with --remote-debugging-port=<port> and pass --port.

The recipe (three cheap layers)

  1. Dispatch a prompt into the app (new task or follow-up).
  2. Wait for free: block in the shell until the turn finishes; do not re-read the screen. Completion is a DB fact (message.finish is set) or the structured event turn.completed in the JSONL log.
  3. Digest: read one compact JSON record from the local session DB - model, finish reason, tokens, one row per tool call, and the final text. Cross-check file changes with git -C <workspace> diff --stat (ground truth).

Escalate to expensive detail (a failing tool's stderr, git diff <file>) ONLY when the digest flags a problem (error, destructive edit, unexpected diff).

Usage

One shot (dispatch + wait + digest):

python3 scripts/zcode_agent.py run "Refactor the parser and run the tests"

Follow-up in the same conversation:

python3 scripts/zcode_agent.py run --follow "Now add a test for empty input"

Split control (capture the session id, then wait/digest yourself):

SID=$(python3 scripts/zcode_agent.py send --new "Fix the flaky test")
python3 scripts/zcode_agent.py wait   --session "$SID" --timeout 900
python3 scripts/zcode_agent.py digest --session "$SID"

Sample digest (bounded regardless of run length):

{"session":"sess_3de8a03","model":"GLM-5.2","mode":"build","finish":"stop",
 "tokens":11048,"tools":[],"final":"PONG-PONG-PONG",
 "wait":{"status":"done","finish":"stop"}}

Point ZCode at the right directory

Every task is bound to the workspace folder open at dispatch (ZCode derives a project from that directory; a new task inherits it). Check and, when possible, switch it:

python3 scripts/zcode_agent.py workspace                 # print the open dir
python3 scripts/zcode_agent.py workspace --set /abs/path  # switch to a registered project

--set works only when that folder is an already-registered ZCode project (previously opened) - it switches via the command palette. Opening a brand-new folder is "Open workspace" (Cmd+O), which is a native OS picker the CDP layer cannot drive; if the target has never been opene

Полный SKILL.md на GitHub

Установить zcode-subagent в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/architecture.mdreferences/installation.mdscripts/zcode_agent.py

FAQ

Что делает скилл zcode-subagent?

Delegate a coding task to a ZCode (GLM) subagent and get the result back. Use when the current agent should hand off or parallelize coding work. Keywords: ZCode, GLM, subagent, delegate, offload.

Как установить скилл zcode-subagent?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл zcode-subagent запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить zcode-subagent с