improve_agent
Refines an existing Claude Code agent by collecting specialist reviews of gaps, skills and cuts, then drafting and saving an improved definition while preserving identity.
Instructions
Refine an existing Claude Code agent in one call, preserving its identity and useful instructions. By default the target reviews itself candidly; add specialists with with or inherit participants/discussion via from_session (the id of a live collaboration or meeting, or of any ended session in the archive). They suggest gaps, replacements, skills and cuts; an architect drafts the definition, participants review independently, and the architect revises if needed. The target is an agent name or a .md path inside the agents directory, /.claude/agents, ~/.claude/agents or a directory listed in ROUNDTABLE_AGENT_PATHS. write: false previews without writes. Frontmatter is read the way Claude Code reads it, including one quoting and leading-tab recovery pass. Exactly the keys Claude Code sees are preserved; improve refuses files Claude Code cannot parse or whose frontmatter contains '---' inside a value, with an error asking you to fix the file first. Identity collision checks use the same metadata view. Model output only supplies name/description/model/tools/skills. Only one improve run per target is allowed; a second fails fast: improve_agent is already running for ; wait for it to finish. Default write: true saves .bak-, then atomically replaces via a temp file and rename, keeping the original mode. If the target changed, was renamed or was deleted during the run it is not overwritten: changes go to .proposed-, which is not an agent file and keeps the original mode; next explains recovery. Creation includes the destination project's .claude/skills in lookup even when the configured skills directory differs. Skill lookup follows Claude Code precedence: personal ~/.claude/skills, then .claude/skills beside the agent file when it is in .claude/agents, then ROUNDTABLE_SKILLS_DIR. Any skill found is reused, never overwritten or shadowed. New skills go beside a target in .claude/agents to its project's .claude/skills only if neither .claude nor .claude/skills is a symlink and the skills realpath stays inside the project. Otherwise they fall back to ROUNDTABLE_SKILLS_DIR with a warning. Results report file realpaths, warnings and next instructions. Tools fail closed: a list with no allowlisted matches or a value of the wrong type is rejected and the architect retries once. Omitting tools keeps the target's own tools line; a target without one keeps inheriting every tool, and the result warns: tools omitted: the target has no tools line, so it still inherits every tool; list tools to restrict it. Public workshops post contributions, reviews and a redacted summary of the final definition (name, description, model, tools, skill names and status, contribution credits, changes and open questions), without its system prompt, skill instructions or descriptions derived from instructions; copied private passages in summary fields are withheld. They never post context, personas, fleet listings or source-session transcripts. Public improve runs never include the target's recent activity in any prompt; contributors, reviewers and the architect point to passages rather than reproduce them. Private improve contributor prompts include recent topics and outcomes from the local activity log.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent": "<agent>"
},
"name": "improve_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| with | No | Additional specialists; combined with target (when include_self) and from_session participants. | |
| agent | Yes | Existing agent name, or a .md file path inside an allowed agents directory (ROUNDTABLE_AGENTS_DIR, <workspace>/.claude/agents, ~/.claude/agents or ROUNDTABLE_AGENT_PATHS). Written targets are backed up first. | |
| focus | No | Optional aspect to improve, such as escalation rules, output quality or missing skills. | |
| model | No | Model id. Defaults: claude-sonnet-5-5 (anthropic), gpt-5.6-luna (openai), zai-org/GLM-5.3 (together), qwen/qwen3-235b-a22b-instruct-2507 (replicate), qwen3:14b (ollama), default (openai_compatible). Model aliases: "opus" (claude-opus-5-5), "sonnet" (claude-sonnet-5-5), "haiku" (claude-haiku-5-5). Replicate accepts owner/name, owner/name:version, or a https://replicate.com/owner/name URL. | |
| write | No | Default true: back up and update the target. False: preview files and write nothing. | |
| public | No | Default false. Only set true when the human explicitly asks for a public session. When true, the whole session is posted live to the configured public channel and is world-readable: the topic/agenda, every agent reply, every message you send with say/nudge, and the summary. The context argument is never posted, but agents may paraphrase it in their replies, so keep context generic. Never include personal information, credentials, or private code anywhere in a public session. The result includes public.url so the human can watch live. | |
| rounds | No | Contribution rounds, default 1, clamped to 1..3. | |
| context | No | Optional background for refinement; never posted publicly. | |
| base_url | No | Only with provider "openai_compatible": base URL of an OpenAI-compatible /v1 endpoint (e.g. http://localhost:1234/v1). Overrides OPENAI_COMPATIBLE_BASE_URL. OPENAI_COMPATIBLE_API_KEY, if set, is sent only to the OPENAI_COMPATIBLE_BASE_URL origin or one listed in ROUNDTABLE_OPENAI_COMPATIBLE_TRUSTED_ORIGINS; any other base URL gets no Authorization header and must be https (http only to loopback, or to private addresses with ROUNDTABLE_ALLOW_PRIVATE_BASE_URLS=1), never a cloud metadata or (without that setting) private address. | |
| provider | No | LLM provider. Default: anthropic. Options: anthropic, openai, together, replicate, ollama (local, when reachable), openai_compatible (set OPENAI_COMPATIBLE_BASE_URL or pass base_url). | |
| from_session | No | Id of a live collaboration or meeting (collab-…, meeting-…) or of any ended session in the archive, supplying participants and discussion. | |
| include_self | No | Default true: the target contributes to its own refinement. If false, supply at least one participant via with or from_session. |