Claude Code Advanced Workflow: Subagents, Commands & Multi-Session
Claude Code Advanced Workflow: Subagents, Commands Multi-Session Most Claude Code tutorials stop at "write a good CLAUDE.md and let Claude handle the rest." That advice is fine for getting started, but it leaves the most powerful features untouched: subagents that run in isolated contexts, custom slash commands that encode your team's workflows, multi-session patterns that multiply your throughput, and prompting techniques that consistently produce better results. At Effloow , we run a fully AI-powered content company with 14 agents orchestrated through Paperclip. Every agent runs Claude Code. We have been iterating on advanced workflow patterns for months, and the difference between basic usage and optimized usage is not incremental — it changes what is possible. This guide covers the adv
Claude Code Advanced Workflow: Subagents, Commands & Multi-Session
Most Claude Code tutorials stop at "write a good CLAUDE.md and let Claude handle the rest." That advice is fine for getting started, but it leaves the most powerful features untouched: subagents that run in isolated contexts, custom slash commands that encode your team's workflows, multi-session patterns that multiply your throughput, and prompting techniques that consistently produce better results.
At Effloow, we run a fully AI-powered content company with 14 agents orchestrated through Paperclip. Every agent runs Claude Code. We have been iterating on advanced workflow patterns for months, and the difference between basic usage and optimized usage is not incremental — it changes what is possible.
This guide covers the advanced patterns we use daily. If you have not set up your CLAUDE.md yet, start with our CLAUDE.md setup guide first, then come back here.
Why Context Management Is Everything
Before diving into specific features, you need to understand the single constraint that drives every advanced pattern: Claude's context window fills up fast, and performance degrades as it fills.
Every file Claude reads, every command output, every conversation turn consumes tokens from a fixed budget. When that budget runs low, Claude starts compacting — summarizing earlier parts of the conversation to free space. Important details get lost. Instructions from your CLAUDE.md compete with accumulated conversation for attention.
This is why every advanced technique in this guide exists: to keep your context clean, focused, and efficient. Subagents isolate exploration so your main context stays pristine. Custom commands encode workflows so Claude does not need lengthy explanations. Multi-session patterns let you split work across fresh contexts instead of cramming everything into one.
Subagents: Isolated Execution for Complex Tasks
Subagents are the single most underused feature in Claude Code. They run in their own context window with their own set of allowed tools, and they report back a summary — keeping your main conversation clean.
When to Use Subagents
Use subagents whenever a task requires reading many files or exploring a codebase. Without subagents, investigation tasks fill your context with file contents you will never reference again.
Use subagents to investigate how our authentication system handles token refresh, and whether we have any existing OAuth utilities I should reuse.Use subagents to investigate how our authentication system handles token refresh, and whether we have any existing OAuth utilities I should reuse.Enter fullscreen mode
Exit fullscreen mode
The subagent explores the codebase, reads files, and reports findings — all without cluttering your main conversation with hundreds of lines of code.
You can also use subagents for verification after implementation:
Use a subagent to review the rate limiter I just wrote for edge cases and race conditions.Use a subagent to review the rate limiter I just wrote for edge cases and race conditions.Enter fullscreen mode
Exit fullscreen mode
This gives you a fresh perspective from a context that is not biased toward the code it just wrote.
Defining Custom Subagents
Beyond the built-in subagent types, you can define specialized agents in .claude/agents/. Each agent gets its own system prompt and tool restrictions:
# .claude/agents/security-reviewer.md ---# .claude/agents/security-reviewer.md ---name: security-reviewer description: "Reviews code for security vulnerabilities" tools: Read, Grep, Glob, Bash model: opus
You are a senior security engineer. Review code for:
- Injection vulnerabilities (SQL, XSS, command injection)
- Authentication and authorization flaws
- Secrets or credentials in code
- Insecure data handling
Provide specific line references and suggested fixes.`
Enter fullscreen mode
Exit fullscreen mode
Once defined, tell Claude to use it: "Use the security-reviewer subagent to audit the new API endpoints."
Real Patterns from Effloow
At Effloow, we use custom subagents for several recurring patterns:
Content QA Agent: Before publishing any article, a subagent reviews the Markdown for broken links, missing frontmatter fields, SEO issues, and factual consistency. This runs in isolation so the publishing agent's context stays focused on the actual deployment.
Dependency Auditor: When updating packages, a subagent checks each dependency for breaking changes, security advisories, and compatibility issues. The main session only sees the summary: "3 packages updated safely, 1 requires manual migration."
Code Exploration: When onboarding a new agent to a part of the codebase, we use the Explore subagent type rather than having the main agent read dozens of files. The exploration report becomes a compact briefing that fits cleanly into context.
Custom Slash Commands with Skills
Skills are reusable workflows stored in .claude/skills/ that Claude loads on demand. Unlike CLAUDE.md instructions that load every session, skills only activate when relevant — keeping your baseline context lean.
Creating a Skill
Create a directory with a SKILL.md file:
# .claude/skills/fix-issue/SKILL.md ---# .claude/skills/fix-issue/SKILL.md ---name: fix-issue description: Fix a GitHub issue end-to-end disable-model-invocation: true
Analyze and fix the GitHub issue: $ARGUMENTS.
- Use
gh issue viewto get the issue details - Understand the problem described in the issue
- Search the codebase for relevant files
- Implement the necessary changes to fix the issue
- Write and run tests to verify the fix
- Ensure code passes linting and type checking
- Create a descriptive commit message
- Push and create a PR`
Enter fullscreen mode
Exit fullscreen mode
Run it with /fix-issue 1234. The disable-model-invocation: true flag ensures this workflow only runs when you explicitly invoke it, not when Claude decides to use it autonomously.
Skills vs. CLAUDE.md
The distinction matters for context efficiency:
Put in CLAUDE.md Put in a Skill
Build commands (pnpm test, npm run lint)
Multi-step workflows (deploy, fix-issue)
Code style rules that apply everywhere Domain knowledge for specific task types
Repo conventions (branch naming, PR format) Integration-specific procedures
Things Claude needs every session Things Claude needs sometimes
Practical Skill Examples
Deploy skill for consistent deployment:
# .claude/skills/deploy/SKILL.md ---# .claude/skills/deploy/SKILL.md ---name: deploy description: Deploy the current branch to staging or production disable-model-invocation: true
Deploy to $ARGUMENTS (default: staging).
- Run the test suite and abort if any test fails
- Build the project with
pnpm build - If deploying to production, create a git tag with today's date
- Push to the appropriate remote branch
- Monitor deployment status and report results`
Enter fullscreen mode
Exit fullscreen mode
Review skill for consistent code reviews:
# .claude/skills/review/SKILL.md ---# .claude/skills/review/SKILL.md ---name: review description: Review a pull request disable-model-invocation: true
Review PR $ARGUMENTS.
- Use
gh pr view $ARGUMENTSto get PR details - Use
gh pr diff $ARGUMENTSto read the changes - Check for: correctness, edge cases, test coverage, style consistency
- Post a review comment with findings`
Enter fullscreen mode
Exit fullscreen mode
Multi-Session Workflows
Running multiple Claude sessions in parallel is where productivity gains become dramatic. Instead of one session juggling implementation, testing, and review, you split concerns across fresh contexts.
The Writer/Reviewer Pattern
This is the most immediately useful multi-session pattern:
Session A (Writer) Session B (Reviewer)
"Implement rate limiting for API endpoints" —
—
"Review the rate limiter in src/middleware/rateLimiter.ts. Check for edge cases, race conditions, and consistency with existing middleware."
"Address this review feedback: [paste Session B output]" —
Session B has clean context — it is not biased toward the implementation because it did not write it. This catches issues that single-session workflows miss.
The Test-First Pattern
Have one session write tests, then another write code to pass them:
-
Session A: "Write comprehensive tests for a user registration endpoint. Cover validation, duplicate emails, password requirements, and error responses."
-
Session B: "Make all tests in tests/registration.test.ts pass. Do not modify the test file."
This produces better test coverage because the test writer is not influenced by implementation shortcuts.
Non-Interactive Mode for Automation
claude -p "prompt" runs Claude without a session, which is how you integrate it into scripts, CI pipelines, and batch operations:
# Analyze a file claude -p "Explain what this project does"# Analyze a file claude -p "Explain what this project does"Structured output for scripts
claude -p "List all API endpoints" --output-format json
Batch migration across files
for file in $(cat files-to-migrate.txt); do
claude -p "Migrate $file from React class components to hooks. Return OK or FAIL."
--allowedTools "Edit,Bash(git commit )"
done`
Enter fullscreen mode
Exit fullscreen mode
The --allowedTools flag restricts what Claude can do during unattended runs — essential for batch operations.
Fan-Out Pattern for Large Migrations
For tasks that touch hundreds of files, the fan-out pattern is transformative:
-
Have Claude generate a task list: "List all Python files that need migrating from unittest to pytest"
-
Write a script that loops through the list, calling claude -p for each file
-
Test on 2-3 files, refine your prompt based on results
-
Run at scale
This turns a multi-day manual migration into an overnight batch job.
AGENTS.md for Team Setups
When multiple agents or team members work on the same codebase, AGENTS.md provides agent-specific instructions that layer on top of CLAUDE.md. Each agent gets context tailored to its role without bloating the shared configuration.
How AGENTS.md Works
AGENTS.md files live alongside your CLAUDE.md and provide role-specific instructions. While CLAUDE.md contains universal project rules, AGENTS.md carries instructions specific to one agent's responsibilities.
At Effloow, each of our 14 agents has its own instruction file that defines:
-
Its role and responsibilities
-
Which parts of the codebase it should focus on
-
How it should communicate with other agents
-
Specific workflows and checklists it must follow
Structuring Agent Instructions
A well-structured agent instruction file covers:
# Role Definition You are the Publisher agent. You handle the final publishing pipeline.# Role Definition You are the Publisher agent. You handle the final publishing pipeline.Responsibilities
- Validate article frontmatter and content quality
- Commit and push to the content repository
- Cross-post to external platforms
Checklists
Pre-Publish Checklist
- Verify frontmatter is complete
- Confirm no [PLACEHOLDER] tags remain
- Check all internal cross-links
- Validate Markdown formatting
Communication Protocol
- Report publishing results to Editor-in-Chief
- If blocked, escalate with specific blocker details`
Enter fullscreen mode
Exit fullscreen mode
The key principle: each agent's instructions should be self-contained enough that it can operate independently, but aware enough of the team structure to collaborate effectively.
Advanced Prompting Techniques
Beyond workflow patterns, how you phrase prompts significantly impacts output quality.
The Explore-Plan-Implement Pattern
This three-phase approach, recommended in the official best practices, prevents Claude from jumping to implementation before understanding the problem:
-
Explore (Plan Mode): "Read /src/auth and understand how we handle sessions and login. Also look at how we manage environment variables for secrets."
-
Plan (Plan Mode): "I want to add Google OAuth. What files need to change? What is the session flow? Create a plan."
-
Implement (Normal Mode): "Implement the OAuth flow from your plan. Write tests for the callback handler, run the test suite and fix any failures."
Plan Mode (Ctrl+G to toggle) lets Claude explore and plan without making changes. This separation prevents wasted implementation effort on the wrong approach.
The Interview Pattern
For larger features where requirements are ambiguous, have Claude interview you instead of trying to specify everything upfront:
I want to build a notification system. Interview me in detail using the AskUserQuestion tool.I want to build a notification system. Interview me in detail using the AskUserQuestion tool.Ask about technical implementation, UI/UX, edge cases, concerns, and tradeoffs. Don't ask obvious questions — dig into the hard parts I might not have considered.
Keep interviewing until we've covered everything, then write a complete spec to SPEC.md.`
Enter fullscreen mode
Exit fullscreen mode
Once the spec is complete, start a fresh session to implement it. The new session has clean context focused entirely on execution.
Scoped Investigation
Open-ended prompts like "investigate this" cause Claude to read hundreds of files, filling context. Always scope your investigations:
# Bad — unbounded exploration Investigate the authentication system.# Bad — unbounded exploration Investigate the authentication system.Good — scoped investigation
Check how token refresh works in src/auth/refresh.ts and whether it handles expired refresh tokens gracefully.`
Enter fullscreen mode
Exit fullscreen mode
When you genuinely need broad investigation, delegate it to a subagent so the exploration does not consume your main context.
Course Correction Techniques
Claude is not always right on the first try. The key is correcting efficiently:
-
Esc: Stop Claude mid-action. Context is preserved so you can redirect.
-
Esc + Esc or /rewind: Restore to a previous checkpoint — conversation, code, or both.
-
/clear: Reset context between unrelated tasks. This is the most underused command.
If you have corrected Claude more than twice on the same issue, the context is polluted with failed approaches. Run /clear and start fresh with a better prompt that incorporates what you learned. A clean session with a better prompt almost always outperforms a long session with accumulated corrections.
Hooks: Guaranteed Actions
Unlike CLAUDE.md instructions which are advisory, hooks are deterministic scripts that run at specific points in Claude's workflow.
Write a hook that runs eslint after every file edit.
Enter fullscreen mode
Exit fullscreen mode
Claude can write hooks for you and configure them in .claude/settings.json. Use hooks when an action must happen every time with zero exceptions — linting after edits, running tests before commits, blocking writes to protected directories.
The distinction between CLAUDE.md instructions and hooks is important: instructions can be forgotten as context fills up, but hooks execute regardless.
Putting It All Together
Here is how these techniques combine in a real workflow at Effloow:
-
Skills define our repeatable workflows: /publish, /review, /deploy
-
Custom subagents handle specialized tasks: content QA, security review, dependency auditing
-
Multi-session patterns separate writing from reviewing — our Writer agent produces articles in one context, while our Publisher agent validates and deploys in another
-
AGENTS.md gives each of our 14 agents role-specific instructions without bloating the shared CLAUDE.md
-
Hooks enforce non-negotiable rules: every article must pass frontmatter validation before publishing
The result is a system where each agent operates with a clean, focused context and clear responsibilities, using advanced Claude Code features to stay efficient rather than fighting context limits.
What to Try First
If you are coming from basic Claude Code usage, here is a progression:
-
Start with subagents: Next time you need to investigate code, say "use subagents to investigate X" instead of asking Claude directly. Notice how much cleaner your context stays.
-
Create one skill: Pick your most common multi-step workflow and encode it as a skill. You will use it more than you expect.
-
Try the Writer/Reviewer pattern: Run two sessions for your next feature. The review quality from a fresh context is noticeably better.
-
Add a hook: Pick one rule that Claude occasionally forgets and make it a hook instead.
Each of these is a small change that compounds over time. The teams that get the most from Claude Code are not using more advanced prompts — they are using these structural features to work with Claude's architecture instead of against it.
Related Resources
-
The Perfect CLAUDE.md: How to Set Up Your Project for Agentic Coding — Start here if you have not configured your CLAUDE.md yet
-
How to Build a Custom MCP Server for Claude Code — Extend Claude with external tool integrations
-
What Is Vibe Coding? The Developer Trend Redefining How We Build Software — The broader trend behind these advanced workflows
-
OpenAI Codex vs Claude Code — How Claude Code compares to its closest competitor in real-world workflows
-
Official Claude Code Best Practices — Anthropic's own guide to effective usage
DEV Community
https://dev.to/jangwook_kim_e31e7291ad98/claude-code-advanced-workflow-subagents-commands-multi-session-50hlSign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
claudemodelupdate
Production RAG: From Anti-Patterns to Platform Engineering
RAG is a distributed system . It becomes clear when moving beyond demos into production. It consists of independent services such as ingestion, retrieval, inference, orchestration, and observability. Each component introduces its own latency, scaling characteristics, and failure modes, making coordination, observability, and fault tolerance essential. RAG flowchart In regulated environments such as banking, these systems must also satisfy strict governance, auditability, and change-control requirements aligned with standards like SOX and PCI DSS. This article builds on existing frameworks like 12 Factor Agents (Dex Horthy)¹ and Google’s 16 Factor App² by exploring key anti-patterns and introducing the pillars required to take a typical RAG pipeline to production. I’ve included code snippet

Word2Vec Explained: The Moment Words Became Relations
How models first learned meaning from context — and why that changed everything In the first post, we built the base layer: Text → Tokens → Numbers → (lots of math) → Tokens → Text In the second post, we stayed with the deeper question: Once words become numbers, how does meaning not disappear? We saw that the answer is not “because numbers are magical.” The answer is this: the numbers are learned in a space that preserves relationships. That was the real story of embeddings. Now we are ready for the next step. Because once you accept that words can become numbers without losing meaning, the next question becomes unavoidable: How are those numbers actually learned? This is where Word2Vec enters the story. And Word2Vec matters for more than historical reasons. It was not just a clever neura
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

Production RAG: From Anti-Patterns to Platform Engineering
RAG is a distributed system . It becomes clear when moving beyond demos into production. It consists of independent services such as ingestion, retrieval, inference, orchestration, and observability. Each component introduces its own latency, scaling characteristics, and failure modes, making coordination, observability, and fault tolerance essential. RAG flowchart In regulated environments such as banking, these systems must also satisfy strict governance, auditability, and change-control requirements aligned with standards like SOX and PCI DSS. This article builds on existing frameworks like 12 Factor Agents (Dex Horthy)¹ and Google’s 16 Factor App² by exploring key anti-patterns and introducing the pillars required to take a typical RAG pipeline to production. I’ve included code snippet

YouTube blokkeert Nvidia s DLSS 5-video na auteursclaim Italiaanse tv-zender
De Italiaanse tv-zender La7 claimt auteursrechten op beeldmateriaal met Nvidia s DLSS 5-technologie en laat die blokkeren. Googles videoplatform YouTube blokkeert nu videomateriaal met DLSS 5-beeld, wat ook de officiële aankondigingsvideo van Nvidia raakt.

BIRA: A Spherical Bistatic Radar Reflectivity Measurement System
arXiv:2407.13749v5 Announce Type: replace Abstract: The upcoming 6G mobile communication standard will offer a revolutionary new feature: Integrated sensing and communication (ISAC) reuses mobile communication signals to realize multi-static radar for various applications including localization. Consequently, applied ISAC propagation research necessitates to evolve from classical monostatic radar cross section (RCS) measurement of static targets on to bistatic radar reflectivity characterization of dynamic objects. Here, we introduce our Bistatic Radar (BIRA) measurement facility for independent spherical positioning of two probes with sub-millimeter accuracy on a diameter of up to 7 m and with almost continuous frequency coverage from 0.7 up to 260 GHz. Currently, BIRA is the only bistati


Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!