The primary purpose of agents is to save token space in your main context by offloading work and only retaining the relevant output in the context rather than the entire conversation history. They also allow for parallelization and choosing specific models for specific tasks, but the biggest thing is the context encapsulation. The key things to know about agents: - Agents only receive the prompt that the outer context chooses to give them. They do NOT receive the full conversation prior to the agent being called. This means their responsibility needs to be well-defined and the main context should have a clear understanding of what to give them. This is especially relevant for agents that you want to write code for you, as code often requires a lot of context to write correctly. I personally only have agents write very simple code or make sure that they can get all the context they need by passing in pre-prepared plans in markdown files. - The main context only sees the last message of the agent in its context stream. This is usually the final summary report from its task, but sometimes it can do things like update a TodoWrite as a final step and this messes up what the outer context sees. My recommendations, based on my experience working with them: - Agents are _great_ for data gathering and consolidation (i.e. read-only tasks). I have a standard agent I use any time I want to gather context for a complicated task and this has helped a lot with removing all the codebase exploration from the working context of the main Claude. - Agents are also great for wrapping tool calls that generate a lot of output, like building and unit tests. I have a standard build-test-engineer I use whose only job is run build/test, then consolidate the output to just what's relevant to the main Claude. I've found this has substantially improved performance during extended debugging of its own changes, as it keeps the actual work closer in context so that it doesn't get stuck trying to hack around bugs without a good memory of why it's trying to do that in the first place. - To get the best results, use slash commands to automate requesting it to explicitly use specific agents. It's not always great on deciding to use agents on its own. - I also include some explicit instructions for agent use cases in the `CLAUDE.md`. So far I've gotten Claude to reliably use `build-test-engineer` and I also have it using `batch-editor` reasonably often (this is my agent for applying simple edits across a bunch of files, like for refactoring/cleanup tasks.) Answer from Jarlyk on reddit.com
🌐
GitHub
github.com › hesreallyhim › a-list-of-claude-code-agents
GitHub - hesreallyhim/a-list-of-claude-code-agents: A list of Claude Code Sub-Agents submitted by the community.
EquilateralAgents Open Core by HappyHippo.ai 22 self-learning AI agents with memory and community standards contribution. Features agent memory (tracks last 100 executions), pattern recognition, and workflow optimization for security, quality, deployment, and compliance. Claude Code Subagents Collection by Seth Hobson.
Starred by 1.1K users
Forked by 106 users
🌐
Reddit
reddit.com › r/claudeai › we prepared a collection of claude code subagents for production-ready workflows.
r/ClaudeAI on Reddit: We prepared a collection of Claude code subagents for production-ready workflows.
August 5, 2025 -

We've prepared a comprehensive collection of production-ready Claude Code subagents: https://github.com/VoltAgent/awesome-claude-code-subagents

It contains 100+ specialized agents covering the most requested development tasks - frontend, backend, DevOps, AI/ML, code review, debugging, and more. All subagents follow best practices and are maintained by the open-source framework community.

Just copy to .claude/agents/ in your project to start using them.

Discussions

Claude code /agents mode - could someone explain how it works and what are your experiences?
The primary purpose of agents is to save token space in your main context by offloading work and only retaining the relevant output in the context rather than the entire conversation history. They also allow for parallelization and choosing specific models for specific tasks, but the biggest thing is the context encapsulation. The key things to know about agents: - Agents only receive the prompt that the outer context chooses to give them. They do NOT receive the full conversation prior to the agent being called. This means their responsibility needs to be well-defined and the main context should have a clear understanding of what to give them. This is especially relevant for agents that you want to write code for you, as code often requires a lot of context to write correctly. I personally only have agents write very simple code or make sure that they can get all the context they need by passing in pre-prepared plans in markdown files. - The main context only sees the last message of the agent in its context stream. This is usually the final summary report from its task, but sometimes it can do things like update a TodoWrite as a final step and this messes up what the outer context sees. My recommendations, based on my experience working with them: - Agents are _great_ for data gathering and consolidation (i.e. read-only tasks). I have a standard agent I use any time I want to gather context for a complicated task and this has helped a lot with removing all the codebase exploration from the working context of the main Claude. - Agents are also great for wrapping tool calls that generate a lot of output, like building and unit tests. I have a standard build-test-engineer I use whose only job is run build/test, then consolidate the output to just what's relevant to the main Claude. I've found this has substantially improved performance during extended debugging of its own changes, as it keeps the actual work closer in context so that it doesn't get stuck trying to hack around bugs without a good memory of why it's trying to do that in the first place. - To get the best results, use slash commands to automate requesting it to explicitly use specific agents. It's not always great on deciding to use agents on its own. - I also include some explicit instructions for agent use cases in the `CLAUDE.md`. So far I've gotten Claude to reliably use `build-test-engineer` and I also have it using `batch-editor` reasonably often (this is my agent for applying simple edits across a bunch of files, like for refactoring/cleanup tasks.) More on reddit.com
🌐 r/ClaudeCode
8
8
August 19, 2025
Full manual for writing your first Claude Code Agents
Building agents is powerful. It shifts how work gets done. This approach applies to GTM too. Automating GTM with agentic AI changes everything. See how our GTM agents work: https://www.fn7.io?utm_source=fn7scout-reddit&utm_term=6621476251_1ma4epq More on reddit.com
🌐 r/Anthropic
4
18
July 26, 2025
Claude Code now supports Custom Agents
Setting up a team of 5 at the moment: │ bug-detective-tdd │ code-review-architect │ sprint-architect-planner │ system-architect-tdd │ tdd-advocate The wizard is nice, allows you to specify a description which then auto generates a system prompt and description, or you can manually set these. Choose which tools you want to make available for the agent and the colour of the agent. The only thing I think this is missing is the ability to override the model. For example, with a model selection you could've had Opus as an architect agent and Sonnet for implementation related agents. More on reddit.com
🌐 r/ClaudeAI
204
471
July 24, 2025
Claude Code now supports Custom Agents : ClaudeAI
🌐 r/ClaudeAI
🌐
Medium
medium.com › @joe.njenga › 17-claude-code-subagents-examples-with-templates-you-can-use-immediately-c70ef5567308
17 Claude Code SubAgents Examples (With Templates You Can Use Immediately) | by Joe Njenga | Medium
August 1, 2025 - I have been working on improving ... add more practical, usable sub-agents that you can quickly use or modify to make them fit your specific use case. ... I have curated Claude Code subagents you can start using with code instruction examples....
🌐
GitHub
github.com › wshobson › agents
GitHub - wshobson/agents: Intelligent automation and multi-agent orchestration for Claude Code
2 weeks ago - Coordinates 7+ agents: backend-architect → database-architect → frontend-developer → test-automator → security-auditor → deployment-engineer → observability-engineer ...
Starred by 23.4K users
Forked by 2.6K users
Languages   Python 69.0% | Shell 31.0%
🌐
Anthropic
anthropic.com › engineering › claude-code-best-practices
Claude Code: Best practices for agentic coding
Our comprehensive documentation at claude.ai/code covers all the features mentioned in this post and provides additional examples, implementation details, and advanced techniques. Claude Code is an agentic coding assistant that automatically pulls context into prompts.
🌐
Claude
docs.claude.com › en › docs › claude-code › sdk › sdk-overview
Agent SDK overview
Code review agents that enforce style and best practices Business agents: Legal assistants that review contracts and compliance · Finance advisors that analyze reports and forecasts · Customer support agents that resolve technical issues ...
🌐
Reddit
reddit.com › r/claudecode › claude code /agents mode - could someone explain how it works and what are your experiences?
r/ClaudeCode on Reddit: Claude code /agents mode - could someone explain how it works and what are your experiences?
August 19, 2025 -

Hi,
could someone explain how the /agents mode in Claude Code actually works? I’m wondering if it’s more of a coding sandbox step-by-step, or closer to autonomous agents handling tasks. What are your experiences with using this mode?

Top answer
1 of 2
6
The primary purpose of agents is to save token space in your main context by offloading work and only retaining the relevant output in the context rather than the entire conversation history. They also allow for parallelization and choosing specific models for specific tasks, but the biggest thing is the context encapsulation. The key things to know about agents: - Agents only receive the prompt that the outer context chooses to give them. They do NOT receive the full conversation prior to the agent being called. This means their responsibility needs to be well-defined and the main context should have a clear understanding of what to give them. This is especially relevant for agents that you want to write code for you, as code often requires a lot of context to write correctly. I personally only have agents write very simple code or make sure that they can get all the context they need by passing in pre-prepared plans in markdown files. - The main context only sees the last message of the agent in its context stream. This is usually the final summary report from its task, but sometimes it can do things like update a TodoWrite as a final step and this messes up what the outer context sees. My recommendations, based on my experience working with them: - Agents are _great_ for data gathering and consolidation (i.e. read-only tasks). I have a standard agent I use any time I want to gather context for a complicated task and this has helped a lot with removing all the codebase exploration from the working context of the main Claude. - Agents are also great for wrapping tool calls that generate a lot of output, like building and unit tests. I have a standard build-test-engineer I use whose only job is run build/test, then consolidate the output to just what's relevant to the main Claude. I've found this has substantially improved performance during extended debugging of its own changes, as it keeps the actual work closer in context so that it doesn't get stuck trying to hack around bugs without a good memory of why it's trying to do that in the first place. - To get the best results, use slash commands to automate requesting it to explicitly use specific agents. It's not always great on deciding to use agents on its own. - I also include some explicit instructions for agent use cases in the `CLAUDE.md`. So far I've gotten Claude to reliably use `build-test-engineer` and I also have it using `batch-editor` reasonably often (this is my agent for applying simple edits across a bunch of files, like for refactoring/cleanup tasks.)
2 of 2
1
Use /agents Use claude recommended method to create an agent Then @agent and give it a task It basically spins up a new instance in background and works through the task, fresh context, orchestrated by claude
Find elsewhere
🌐
Reddit
reddit.com › r/anthropic › full manual for writing your first claude code agents
r/Anthropic on Reddit: Full manual for writing your first Claude Code Agents
July 26, 2025 -

Manual for Writing Your First Claude Code Agents

The short manual:

Step 1: Just ask "I want to build 10 different agents for my code. Study the code and come up with ideas"

Step 2: Claude analyzes your project and suggests agents

Step 3: Ask for 5 more ideas to get even MORE options

Step 4: Pick the best ones and implement

The longer manual:

Instead of trying to think of agents yourself, just let Claude study your entire codebase and come up with ideas. It's like having a senior dev with ADHD hyperfocus on your project for 30 minutes straight.

The Magic Prompt That Started It All

I want to build 10 different agents for my code. Study the code and come up with ideas

That's it. That's the whole thing. No need to overcomplicate it with 47 paragraphs explaining your use case. Claude will:

  • Actually read through your code (unlike your coworkers lol)

  • Understand your architecture

  • Suggest agents that make sense for YOUR specific project

  • Give you practical implementation advice

  • Come up with some terrible ideas. Avoid these.

Step-by-Step Walkthrough

1. Upload Your Code to Claude's Project Knowledge (web)

First, you gotta feed Claude your codebase. Upload your files to a Claude project so it can actually analyze what you're working with.

Pro tip: Don't just upload random files. Upload the core stuff:

  • Main application files

  • Key modules/classes

  • Config files

  • Any existing agent/service patterns

I prefer to do this in Terminal after starting Claude.

2. Drop The Magic Prompt

Just straight up ask:

Claude will go full detective mode on your codebase and come back with thoughtful suggestions.

3. Ask for MORE Ideas (This Is Key!)

After Claude gives you the first 10, immediately ask:

Why? Because the first batch is usually the "obvious" ones. The second batch often has the creative, outside-the-box ideas that end up being game-changers.

4. Name Your Agents Like a Boss

Each agent needs a memorable name. Here's how to do it right:

Bad: DataProcessingAgent Good: DataWranglerAgent or NumberCruncherAgent

Bad: MonitoringAgent Good: WatchdogAgent or SentinelAgent

The name should instantly tell you what it does AND be memorable enough that you don't forget about it in 2 weeks.

Real Example: AI Detection System Agents

Here's what happened when I used this method on an AI detection system. Claude analyzed the code and suggested these absolute bangers:

The Original 10 Agents Claude Suggested:

1. SentinelAgent (Performance Monitoring)

  • What it does: Watches your system like a hawk

  • Why it's fire: Catches bottlenecks before they ruin your day

  • Implementation: Hooks into existing logging, creates dashboards

2. FeedbackWizardAgent (Feedback Analysis)

  • What it does: Makes sense of user feedback patterns

  • Why it's fire: Turns angry user comments into actionable improvements

  • Implementation: Enhances existing training analyzer

3. ImageWranglerAgent (Preprocessing)

  • What it does: Gets images ready for analysis

  • Why it's fire: Clean input = better output, always

  • Implementation: Insert before analyzer pipeline

4. DriftDetectorAgent (Model Drift Detection)

  • What it does: Spots when AI generation techniques evolve

  • Why it's fire: Keeps you ahead of the curve

  • Implementation: Works with code adapter for auto-updates

5. BatchMasterAgent (Batch Processing)

  • What it does: Handles multiple images like a champ

  • Why it's fire: Scales your system without breaking it

  • Implementation: Background job processing

6. ExplainerAgent (Explainability)

  • What it does: Tells users WHY something was detected as AI

  • Why it's fire: Trust = more users = more money

  • Implementation: Enhances LLM analyzer

7. GuardianAgent (Security & Validation)

  • What it does: Keeps malicious content out

  • Why it's fire: Security breaches are expensive

  • Implementation: Security layer before upload processing

8. LearnerAgent (Adaptive Learning)

  • What it does: Learns new patterns automatically

  • Why it's fire: Self-improving system = less manual work

  • Implementation: Unsupervised learning on training system

9. ConnectorAgent (API Integration)

  • What it does: Talks to external services

  • Why it's fire: More data sources = better accuracy

  • Implementation: External data in analysis pipeline

10. ReporterAgent (Analytics & Reporting)

  • What it does: Makes pretty charts and insights

  • Why it's fire: Management loves dashboards

  • Implementation: Business intelligence on training database

Bonus Round: 5 More Ideas When I Asked

11. CacheManagerAgent

  • What it does: Smart caching for repeated analyses

  • Why it's sick: Speed boost + cost savings

12. A/B TestingAgent

  • What it does: Tests different detection strategies

  • Why it's sick: Data-driven improvements

13. NotificationAgent

  • What it does: Alerts when important stuff happens

  • Why it's sick: Stay informed without constant checking

14. BackupAgent

  • What it does: Handles data backup and recovery

  • Why it's sick: Sleep better at night

15. LoadBalancerAgent

  • What it does: Distributes work across resources

  • Why it's sick: Handle traffic spikes like a pro

Pro Tips That Will Save Your Sanity

Naming Convention Tips

  • Use action words: Wrangler, Guardian, Sentinel, Master

  • Make it memorable: If you can't remember the name, pick a better one

  • Keep it short: 2-3 words max

  • Avoid generic terms: "Handler" and "Manager" are boring

Implementation Priority Framework

Ask the 15 or so agent ideas to be classified by Claude. I use this formula

Make 3 tiers based on the 15 ideas like:

Tier 1 (Do First): Agents that solve immediate pain points
Tier 2 (Do Soon): Agents that add significant value
Tier 3 (Do Later): Nice-to-have features

Also I asked Claude Code to get these by just typing #tier1 #tier2 #tier3

Architecture Best Practices

  • Follow your existing patterns (don't reinvent the wheel)

  • Make agents modular (easy to add/remove)

  • Use dependency injection (easier testing)

  • Add monitoring from day 1

Common Pitfalls to Avoid

  • Don't build everything at once - Start with 1-2 agents, the massive number of agents is better for almost finished code (well, you thought it was)

  • Don't ignore existing code patterns - Claude suggests based on what you have

  • Don't skip the naming step - Good names = better adoption

  • Don't forget error handling - Agents fail, plan for it

Claude Reads Your ACTUAL Code

Unlike generic "build an agent" tutorials, Claude looks at:

  • Your specific architecture patterns

  • Existing services and modules

  • Configuration and setup

  • Pain points in your current system

Suggestions Are Contextual

The agents Claude suggests actually make sense for YOUR project, not some theoretical perfect codebase.

Implementation Guidance Included

Claude doesn't just say "build a monitoring agent" - it tells you exactly how to integrate it with your existing systems.

FAQ Section

Q: What if my codebase is trash? A: Claude will still give you agents that work with what you have. It's surprisingly good at working within constraints.

Q: How many agents should I actually build? A: Start with 2-3 that solve real problems. Don't go crazy on day 1.

Q: Can I use this for any programming language? A: Yeah, Claude reads most languages. Python, JavaScript, Go, whatever.

Q: What if I don't like Claude's suggestions? A: Ask for different ones! "Give me more creative ideas" where you define what you find creative. Often it helps to tell it what you find boring in the code. or "Focus on performance agents" works great.

Q: How do I know which agents to build first? A: Pick the ones that solve problems you're having RIGHT NOW. Future problems can wait. Use the tier 1 2 3 method.

Look, building agents is fun but don't get carried away. Start small, prove value, then expand.

Also, Claude's suggestions can be really good but they're not gospel. If something doesn't make sense for your use case, skip it. You know your code better than anyone.

Top answer
1 of 2
1
Building agents is powerful. It shifts how work gets done. This approach applies to GTM too. Automating GTM with agentic AI changes everything. See how our GTM agents work: https://www.fn7.io?utm_source=fn7scout-reddit&utm_term=6621476251_1ma4epq
2 of 2
1
(f.e. the one that makes monolith code meaner and leaner) { "name": "code-refactoring-specialist", "description": "MUST BE USED for refactoring large files, extracting components, and modularizing codebases. Identifies logical boundaries and splits code intelligently. Use PROACTIVELY when files exceed 500 lines.", "when_to_use": "When files exceed 500 lines, when extracting components, when breaking up monolithic code, when improving code organization", "tools": ["Read", "Edit", "Bash", "Grep"], "system_prompt": "Role: refactoring specialist who breaks monoliths into clean modules. When slaying monoliths:\n\n1. Analyze :\n - Map all functions and their dependencies\n - Identify logical groupings and boundaries\n - Find duplicate/similar code patterns\n - Spot mixed responsibilities\n\n2. Plan the attack:\n - Design new module structure\n - Identify shared utilities\n - Plan interface boundaries\n - Consider backward compatibility\n\n3. Execute the split:\n - Extract related functions into modules\n - Create clean interfaces between modules\n - Move tests alongside their code\n - Update all imports\n\n4. Clean up the carnage:\n - Remove dead code\n - Consolidate duplicate logic\n - Add module documentation\n - Ensure each file has single responsibility\n\nAlways maintain functionality while improving structure. No behavior changes!" }
🌐
Claude
code.claude.com › docs › en › sub-agents
Subagents - Claude Code Docs
When resumed, the agent continues with full context from its previous conversation Example workflow: Initial invocation: ... > Use the code-analyzer agent to start reviewing the authentication module [Agent completes initial analysis and returns agentId: "abc123"]
🌐
Medium
jewelhuq.medium.com › practical-guide-to-mastering-claude-codes-main-agent-and-sub-agents-fd52952dcf00
Practical guide to mastering Claude Code’s main agent and Sub‑agents | by Md Mazaharul Huq | Medium
November 8, 2025 - A complete, practical guide to mastering Claude Code’s main agent and Sub‑agents — including why they matter, how to set them up the right way, and an end‑to‑end Laravel example you can run today.
🌐
Sshh
blog.sshh.io › p › how-i-use-every-claude-code-feature
How I Use Every Claude Code Feature - by Shrivu Shankar
November 2, 2025 - Keeping your CLAUDE.md as short as possible is a fantastic forcing function for simplifying your codebase and internal tooling. ... # Monorepo ## Python - Always ... - Test with <command> ... 10 more ... ## <Internal CLI Tool> ... 10 bullets, focused on the 80% of use cases ... - <usage example> - Always ... - Never <x>, prefer <Y> For <complex usage> or <error> see path/to/<tool>_docs.md ... Finally, we keep this file synced with an AGENTS.md file to maintain compatibility with other AI IDEs that our engineers might be using.
🌐
Anthropic
anthropic.com › engineering › building-agents-with-the-claude-agent-sdk
Building agents with the Claude Agent SDK
September 29, 2025 - We believe giving Claude a computer unlocks the ability to build agents that are more effective than before. For example, with our SDK, developers can build: Finance agents: Build agents that can understand your portfolio and goals, as well as help you evaluate investments by accessing external ...
🌐
Substack
aimaker.substack.com › p › how-i-turned-claude-code-into-personal-ai-agent-operating-system-for-writing-research-complete-guide
How I Turned Claude Code Into My Personal AI Agent Operating System for Writing and Research
September 25, 2025 - Plan mode - Instead of Claude Code just executing your requests immediately, it first shows you a step-by-step plan of what it's going to do. You can review, modify, or approve before anything happens to your files. This prevents those "wait, that's not what I meant" moments. Sub-agent - Claude Code can spawn smaller, focused agents to handle specific parts of your project while you work on something else.
🌐
Minusx
minusx.ai › blog › decoding-claude-code
Minusx | What makes Claude Code so damn good (and how to recreate that magic in your agent)!?
August 21, 2025 - Example markdown headings include: ... Go read the entire tools prompt - it is a whopping 9400 tokens long! One significant way in which CC deviates from other popular coding agents is in its rejection of RAG. Claude Code searches your code base just as you would, with really complex ripgrep, jq and find commands.
🌐
Superprompt
superprompt.com › blog › best-claude-code-agents-and-use-cases
Best Claude Code Agents and Their Use Cases: Complete Guide for Developers - Superprompt.com
July 29, 2025 - Claude Code subagents use a simple Markdown format with YAML frontmatter: --- name: specialized-agent-name description: When this subagent should be invoked tools: [optional-tool-restrictions] --- System prompt defining the agent's role, capabilities, and behavior. Include specific instructions, constraints, and examples...
🌐
Medium
medium.com › @joe.njenga › how-im-using-claude-code-parallel-agents-to-blow-up-my-workflows-460676bf38e8
How I’m Using Claude Code Parallel Agents to Blow Up My Workflows | by Joe Njenga | Medium
August 22, 2025 - If you are new to agents in Claude Code, we covered the subagent tutorial here, and later shared practical examples that you can use as starter templates here — Claude Code subagent examples with templates.
🌐
Jannesklaas
jannesklaas.github.io › ai › 2025 › 07 › 20 › claude-code-agent-design.html
Agent design lessons from Claude Code | Jannes’ Blog
July 20, 2025 - There is no explicit way to stop the conversation such as a conversation_stop tool or a termination regex. If the agent is finished, it will usually just output a text explaining what it has done and not call tools. To plan its work and stick to the plan, Claude Code uses TODO lists, an example ...