Claude Code agents: subagents, agent teams and agents that stay
Claude Code agents come in three kinds: subagents, experimental agent teams and headless runs. How each works, where they stop, and how to make them persistent.

On this page
Part of How Fluf runs Claude Code with your own login (2026 rules)
"Claude Code agents" means three different things in 2026. Subagents are Markdown files that give Claude a specialist to delegate to inside one session. Agent teams are an experimental mode where a lead session coordinates teammates that talk to each other. And headless runs (claude -p, GitHub Actions, cloud scheduled tasks) let Claude Code work with nobody at the keyboard. This guide explains each one with the exact files and flags, shows where each stops, and covers the piece Claude Code leaves to you: agents that keep a name, a memory and a schedule for months.
The three kinds of Claude Code agents
| Subagents | Agent teams | Headless and cloud runs | |
|---|---|---|---|
| What it is | A specialist Claude delegates to | A lead session plus teammates | Claude Code with no one watching |
| Defined in | .claude/agents/*.md | CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 | claude -p, Actions, cloud tasks |
| Own context window | Yes | Yes, per teammate | Yes, per run |
| Status | Stable | Experimental, off by default | Cloud scheduled tasks in research preview |
| Lives beyond the session | No | No | Per run |
All three are good tools. None of them is an employee. Keep that distinction in mind; we come back to it.
How to create a Claude Code subagent
A subagent is a file. Put it in .claude/agents/ to share it with your repo (commit it), or in ~/.claude/agents/ to have it in every project. YAML frontmatter goes at the top, the system prompt below it. Per Anthropic's subagent docs, "Only name and description are required."
---
name: migration-reviewer
description: Reviews database migrations for locking, data loss and rollback safety. Use for any change under db/migrations.
tools: Read, Grep, Glob, Bash
model: opus
---
You review Postgres migrations. For each file, check:
1. Will it take a long lock on a large table?
2. Can it lose data? Is there a backfill?
3. Is there a working down migration?
Reply with a verdict per file and the exact line to change.
What the fields do:
descriptionis the routing rule. Claude reads it to decide when to delegate, so write it like a trigger, not a job title.toolsnarrows access. Leave it out and the subagent inherits every tool available to subagents.modeltakessonnet,opus,haiku,fable, a full model ID such asclaude-opus-5-5, orinherit. Put cheap work onhaiku.
Each subagent "runs in its own context window with a custom system prompt, specific tool access, and independent permissions." That is the real benefit: a 4,000-line log search happens in the subagent's context and only the answer comes back to yours. Claude Code ships built-ins too, including Explore (fast, read-only codebase search) and Plan (gathers context in plan mode).
Subagents can also run in the background while you keep working.
Figures from Anthropic's subagent and scheduled tasks docs, checked 27 November 2026.
Agent teams: when one lead is not enough
Agent teams go further. One session coordinates the work, assigns tasks and pulls the results together. "Teammates work independently, each in its own context window, and communicate directly with each other." Turn them on with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your environment or settings.json.
Know the limits before you build on them:
- Experimental and disabled by default.
- Token heavy. Anthropic says teams "use significantly more tokens than a single session."
- Interactive only. With
-p, including Agent SDK sessions, "Claude doesn't spawn teammates." - Flat. No nested teams, one team per session, and
/resumedoes not restore in-process teammates.
Use a team for work that splits cleanly: three modules reviewed in parallel, competing hypotheses for one bug. Do not use one for a sequence of steps that each depend on the last.
Running Claude Code agents without you
Three ways to get work done with nobody at the terminal:
Headless mode. claude -p "Find and fix the flaky test in checkout.spec.ts" runs once and exits. Add --output-format json for a result with the session ID, --resume <id> to continue it later, and --permission-prompts none for scheduled jobs where nobody can answer a prompt (headless docs).
GitHub Actions. anthropics/claude-code-action@v1 runs Claude Code inside your workflows, triggered by an @claude mention or on a schedule.
Cloud sessions and scheduled tasks. Cloud sessions run on Anthropic-managed machines and keep going after you close your laptop. Cloud scheduled tasks, formerly called routines, package a prompt, repositories and connectors to run on a schedule, an API call or a GitHub event. They are in research preview. Desktop scheduled tasks and /loop run on your own machine instead, which must stay on.
- 1SubagentOne specialist, one session
- 2Agent teamA lead plus teammates, experimental
- 3Headless runOne task, no one watching
- 4Persistent agentA name, a memory, a schedule
Where Claude Code agents stop
Claude Code is an excellent coding agent. Its agents still stop at the edge of a session or a task, by design:
- Memory is files.
CLAUDE.mdholds what you write; auto memory holds notes Claude writes itself, loaded at the start of each session (the first 200 lines or 25 KB ofMEMORY.md). Useful, but there is no screen to review one fact, see which agent learned it, and retract it (memory docs). - No standing identity. A subagent is a role, not a colleague. It has no inbox, no history of last week's work and no relationship with the rest of your business.
- Schedules come with conditions. Cloud tasks run hourly at most and are in preview; recurring tasks expire after 30 days; local ones need an open machine.
- Approvals live where the session lives. In a terminal, a permission prompt waits for whoever is watching.
- One plan, shared limits. Pro and Max plans have "a five-hour session limit and a weekly limit," shared across Claude and Claude Code (Claude support). Ultra drops the five-hour limit but keeps a weekly one.
None of that is a flaw in Claude Code. It is a coding tool. An AI employee needs more around it.
Turn Claude Code into persistent agents with Fluf
Fluf is a desktop app for Mac, Windows and Linux where you hire AI agents that keep their name, memory and schedule. Point an agent at Claude Code and it thinks with the Claude Code you already installed, signed in with your own Claude Pro, Max or Ultra plan.
What you get on top of Claude Code:
- A named agent with its own chat. Mara is Mara next month. Her conversation, results and decisions stay with her.
- Memory you can read. Facts and decisions are scoped to one agent, a team, a business or you. Keep, edit or forget each one in the Library. See Memory.
- Your Claude skills come with you. Import a Claude skill from the computer that runs your agents, or upload a
SKILL.md, and Fluf turns it on for agents on any model (Skills). - Routines on your machine or server. Cron, webhooks, heartbeats every 10 minutes to 4 hours. Put them on an always-on server and they run with your laptop closed. See how to run AI agents 24/7.
- Approvals anywhere. Risky steps arrive as a card in the agent's chat, on your phone, or in Telegram.
- Limits handled. App settings › AI accounts shows each Claude Code login's usage windows and reset times. Add a second login on Pro, or let agents Continue on an API key when a window runs out, then switch back.
- Effort and speed. Low to Max, plus Deep work and Ultrathink on newer models, and Fast on Opus models. See Models, effort and speed.

What Anthropic's terms allow
This matters more than any feature. Anthropic's legal and compliance page says third-party developers may not "offer Claude.ai login into their own applications, or to route requests through Free, Pro, Max, or Ultra plan credentials on behalf of their users," nor "collect, store, or intermediate Claude.ai credentials or session tokens." It also says this does not "prevent an end user from signing in to the unmodified Claude Code binary with their own Claude subscription, including where a platform hosts Claude Code."
Fluf stays on that line. It runs the unmodified Claude Code you installed. You sign in through Anthropic's own flow. Fluf never sees, stores or forwards your Claude credentials, and refuses a pasted Claude sign-in token. Usage is billed by Anthropic to you, and the plan's terms and limits apply. Fluf is not affiliated with Anthropic.
Which one to use
Use subagents for specialists inside your coding sessions: a migration reviewer, a test writer, a log searcher. Use agent teams when a task splits into parallel parts and the token bill is worth it. Use headless runs for one-shot jobs in CI. And when you want an agent that does the same job every morning, remembers what you corrected last week and asks you on your phone before it acts, run Claude Code inside Fluf. Comparing Anthropic's tool with OpenAI's? Read Claude Code vs Codex.
Download Fluf, connect the Claude Code you already have, and give your first agent a name and a morning routine.
Questions people ask
- How do I create an agent in Claude Code?
- Add a Markdown file to .claude/agents/ in your project, or ~/.claude/agents/ for every project. YAML frontmatter at the top needs a name and a description; tools and model are optional. The body is the subagent's system prompt, and Claude delegates to it when a task matches the description.
- Can Claude Code run multiple agents at once?
- Yes. Subagents can run in the background in parallel, and by default a session can hold 20 running subagents. Agent teams, where a lead session coordinates teammates that message each other, are experimental and turned on with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
- Do Claude Code agents remember things between sessions?
- Through files. CLAUDE.md holds instructions you write, and auto memory holds notes Claude writes itself, loaded at the start of each session. There is no per-agent memory you can review and edit fact by fact; Fluf adds that on top of Claude Code.
- Can I use my Claude subscription for Claude Code agents in another app?
- Anthropic's terms allow an end user to sign in to the unmodified Claude Code binary with their own subscription, including where a platform hosts it. They do not allow third-party apps to offer Claude.ai login or route requests through your plan credentials. Fluf runs your installed Claude Code and you sign in through Anthropic's own flow.
- Are Claude Code agent teams worth the cost?
- For work that splits cleanly, such as parallel research or reviewing separate modules, often yes. Anthropic notes teams use significantly more tokens than a single session, and they do not run in headless mode, so keep single sessions or subagents for sequential work.
Sources
- Claude Code: Create custom subagents, checked 27 November 2026
- Claude Code: Agent teams, checked 27 November 2026
- Claude Code: Run Claude Code programmatically, checked 27 November 2026
- Claude Code: Scheduled tasks, checked 27 November 2026
- Claude Code: Memory, checked 27 November 2026
- Claude Code legal and compliance, checked 27 November 2026
- Use Claude Code with your Pro, Max, or Ultra plan, checked 27 November 2026



