Agents
Subagents with their own context window, tool access, and model — built in, or defined as a markdown file.
Overview
The Agent tool (aliased as Task for compatibility) lets the main model delegate a piece of work to a subagent instead of doing it inline. By default a subagent runs in an isolated context window — it only sees the prompt it was given, does its own tool calls, and returns a single report. The parent never sees the intermediate search results, browsing, or file reads that got the subagent there, which keeps the main session's context clean.
Subagents come in two flavors: a small set of built-in agents that ship with Claudin, and custom agents you define yourself as a markdown file with YAML frontmatter — the same shape Claude Code uses for its subagents, adapted to Claudin's directory layout and provider-agnostic model handling.
Built-in agents
These are always available as subagent_type values, no configuration required. A project or personal agent with the same name overrides a built-in of the same type — see Writing a custom agent.
| Agent type | Model | Tools | Purpose |
|---|---|---|---|
Code |
inherit |
all | General-purpose agent for researching complex questions, searching code, and executing multi-step tasks. |
Explore |
haiku |
read-only | Fast codebase-search specialist. Supports "quick" / "medium" / "very thorough" thoroughness levels. |
Plan |
inherit |
read-only | Software-architect agent that designs step-by-step implementation plans without editing anything. |
WebResearcher |
haiku |
WebSearch, WebFetch |
Multi-page web research in isolation, returns a cited synthesis. See the dedicated page. |
WebResearcherManager |
sonnet |
Agent(WebResearcher), WebSearch, WebFetch |
Orchestrates several WebResearcher workers in parallel and fact-checks the claims before reporting back. |
claudin-guide |
haiku |
Read, Glob, Grep |
Answers questions about Claudin itself, the Claude Agent SDK, and the Claude API. |
The read-only agents (Explore, Plan) drop Agent, Edit, Write, NotebookEdit, and apply_patch from their tool set — they can search and read, not modify.
Writing a custom agent
A custom agent is a single markdown file: YAML frontmatter for its configuration, then the system prompt as the body.
| Location | Path | Scope |
|---|---|---|
| Project | .claudin/agents/*.md | Committed with the repo, shared with the team. |
| Personal | ~/.claudin/agents/*.md | This machine only. Override the location with the CLAUDIN_CONFIG_DIR env var. |
The filename is free-form — what matters is the name field in the frontmatter, which becomes the subagent_type the Agent tool is called with. Drop a file whose name matches a built-in (for example .claudin/agents/WebResearcher.md) and it overrides that built-in for the project. Merge order, each source winning over the previous one: built-in → plugin → user settings → project settings.
| Field | Required | Notes |
|---|---|---|
name | yes | Lowercase, hyphenated. Becomes the subagent_type. |
description | yes | Shown to the parent model so it knows when to delegate to this agent. |
tools | no | Comma-separated allowlist. Omitted, or *, means it inherits every tool available to the session. |
disallowedTools | no | Comma-separated denylist, applied after tools. |
model | no | sonnet / opus / haiku / any model string / inherit (default). See Model selection. |
permissionMode | no | default / acceptEdits / bypassPermissions / dontAsk / plan. Capped by the parent session's mode — an agent can never self-escalate. |
maxTurns | no | Caps how many agentic turns the run gets. |
effort | no | low / medium / high / xhigh / max, for models that support a reasoning-effort knob. |
isolation | no | worktree — runs the agent against a throwaway git worktree copy of the repo. |
background | no | true forces this agent to always launch asynchronously. |
memory | no | user / project / local — gives the agent persistent memory across separate runs. |
skills, mcpServers, hooks, initialPrompt | no | Preload skills, attach MCP servers, register hooks, or seed the agent's first turn. |
See Permissions for how these modes work session-wide.
---
name: reviewer-perf
description: Reviews a diff for performance regressions only.
model: haiku
tools: Read, Grep, Glob, Bash
---
Review the change for performance regressions only. Be concrete — cite
file:line, and skip anything that isn't a measurable regression.
How agents are invoked
| Mode | How | Context |
|---|---|---|
| Named subagent | Agent({ subagent_type: "Explore", description, prompt }) |
Isolated — only sees its own prompt and system prompt, returns one report. |
| Fork | Omit subagent_type |
Inherits the parent's full conversation, sharing the prompt cache — for offloading work whose results you'll still need without paying for a cold context. Forking again from inside a fork is blocked. |
| Background | run_in_background: true |
Runs asynchronously; the caller keeps working and is notified when it completes. |
| Worktree isolation | isolation: "worktree" |
Spins up a temporary git worktree so the agent edits an isolated copy of the repo instead of your working tree. |
Model selection
An agent's default model is inherit — it reuses whatever model the parent session is running. Precedence, highest first: an explicit model passed on the Agent call, then the agent definition's own model frontmatter, then inherit.
On providers that aren't Claude-native — anything routed through the OpenAI-compatible shim, such as OpenRouter, Gemini, DeepSeek, Mistral, or LM Studio — a bare alias like haiku or opus falls back to inheriting the parent's model, since an equivalent tier may not exist on that provider. Fix it without editing the agent file, in ~/.claudin/settings.json:
{
"agentModelOverrides": {
"built-in:WebResearcher": "deepseek-chat"
}
}
See Model configuration for the full provider/model setup story.
Tool permissions
- No
toolsfield: the agent inherits everything available to the session, minus a small set of interactive-only tools it can't use in isolation (AskUserQuestion,EnterPlanMode/ExitPlanMode, and similar). tools:is an allowlist;disallowedTools:is a denylist applied on top of it.Agent(TypeA, TypeB)inside atools:list restricts whichsubagent_types that agent may itself spawn. By default, custom agents can't spawn further sub-agents at all — only a few built-in orchestrators (likeWebResearcherManager) can fan out to a declared list, which keeps recursion bounded.- MCP tools (
mcp__*) always pass through regardless of the allow/deny list.
Managing agents
/agentsinside the REPL — browse built-in, project, and personal agents; create or edit one with a guided wizard.claudin agents— CLI subcommand that lists every agent visible from the current directory. Takes--setting-sourcesto scope which ofuser,project,localto include.- The
/createskill can also author a new agent (alongside skills and rules) straight into the.claudin/structure from a plain-language description.
Differences from Claude Code
The file format and most of the model — frontmatter fields, delegation by description, tool allow/deny lists — match Claude Code's subagents on purpose. A few things are Claudin-specific:
| Claude Code | Claudin | |
|---|---|---|
| Config directory | .claude/agents/, ~/.claude/agents/ | .claudin/agents/, ~/.claudin/agents/ |
| Full-context delegation | not available — every subagent starts fresh | omit subagent_type to fork with the full conversation and a shared prompt cache |
| Background execution | not a subagent-level option | run_in_background is a first-class field on the Agent call |
| Repo isolation | not built in | isolation: "worktree" per agent |
| Model per agent | Claude-family aliases | any model string on any configured provider, mixed freely across agents; agentModelOverrides lets you swap a built-in's model without touching its file |
Try it
Drop a project agent and invoke it directly:
mkdir -p .claudin/agents
cat > .claudin/agents/reviewer-perf.md <<'EOF'
---
name: reviewer-perf
description: Reviews a diff for performance regressions only.
model: haiku
---
Review the change for performance regressions only. Be concrete.
EOF
Then, inside the Claudin REPL, ask for it by name — "review this diff with reviewer-perf" — or let the main model pick it up on its own once the description matches the task at hand.