← Back to articles

Claude Code with Agents

Path: Computer Tech/AI/ML/Claude Code with Agents.mdUpdated: 2/3/2026

Claude Code with Agents

Claude Code is a terminal-based interface for Anthropic's Claude AI that includes a powerful feature called agents - separate Claude instances with fresh context windows that can work independently on delegated tasks.

Why Agents Matter

Traditional AI chat sessions suffer from context bloat: As conversations grow, the AI's context window fills up, making it harder to maintain focus and leading to degraded performance.

Agents solve this problem by letting you delegate specific tasks to fresh Claude instances, each with:

  • A clean 200K token context window
  • Specialized instructions/personas
  • Independent work without affecting your main conversation

Installing Claude Code

bash
npm install -g @anthropic-ai/claude-code
# or with pseudo if needed
sudo npm install -g @anthropic-ai/claude-code

Launch:

bash
claude

Login:

  • Requires Claude Pro subscription ($20/month)
  • Or use API keys (pay-per-use)
  • Same subscription works for browser + terminal

Creating Agents

Quick creation:

bash
# Inside Claude session
/agents

Then:

  1. Choose "Create new agent"
  2. Select scope:
    • Project-specific (tied to current directory)
    • Personal (available everywhere)
  3. Use Claude to generate agent instructions
  4. Set permissions (tools access)
  5. Choose model (Sonnet 4.5 recommended)

Example agent prompt:

You are a home lab research expert. Research topics thoroughly 
using web search and compile findings into markdown documents. 
Focus on practical implementation and cost considerations.

Using Agents

Deploy an agent:

markdown
Use the @home-lab-guru agent to research the best 
NAS systems under $500 and create a comparison table 
in nas-recommendations.md

Multiple agents in parallel:

markdown
1. Use @home-lab-guru to research Proxmox servers
2. Use @brutal-critic to review my script outline
3. Use @general-research to find the best pizza in Dallas

Claude will deploy all three agents simultaneously, each working independently.

Agent Features

Fresh Context Windows

Each agent gets 200K tokens of context. Your main conversation's bloated context doesn't affect agent performance.

Example:

  • Main conversation: 85K tokens used (42%)
  • Deploy agent: Fresh 200K tokens (0% used)
  • Agent completes task: Uses 40K tokens
  • Main conversation: Still only 88K tokens (context protected!)

Specialized Personas

Agents can have distinct personalities and expertise:

Brutal Critic:

You are a harsh script reviewer with impossibly high standards.
Use the framework in critic-framework.md to evaluate scripts.
Rate on a 1-10 scale and provide detailed criticism.
Include three different perspectives: pacing, clarity, engagement.

Session Closer:

You close out work sessions by:
1. Summarizing work done
2. Updating context files (claude.md, gemini.md, agents.md)
3. Committing changes to git with descriptive messages
4. Creating a session summary for next time

File Access

Agents can read/write files in your project directory:

markdown
@research-agent compile findings into research-notes.md

The agent:

  • Reads relevant files in the directory
  • Writes output to the specified file
  • No copy/paste needed

Output Styles

Output styles control Claude's system prompt and persona globally.

View/change:

bash
# Inside Claude session
/output-style

Create custom style:

bash
/output-style new

Example styles:

  • code (default) - Developer-focused responses
  • script-writing - Optimized for video scripts
  • home-lab-expert - Technical infrastructure focus

Switch mid-conversation:

bash
/output-style
# Select from list

Advanced Features

Planning Mode

Press Shift-Tab to cycle modes:

  • Normal - Direct execution
  • Planning - Creates detailed plan first, waits for approval

Use planning mode when:

  • Task is complex and multi-step
  • You want to review approach before execution
  • Debugging previous failed attempts

Dangerous Mode

Skip permission prompts:

bash
claude --dangerously-skip-permissions

⚠️ Use carefully - AI will execute all actions without asking.

Good for:

  • Running multiple web searches
  • Batch file operations
  • Automated workflows

Context Management

View context usage:

bash
/context

Shows:

  • Total tokens used
  • Percentage of 200K limit
  • Which files/messages consume most tokens
  • Agent context windows (separate tracking)

Multi-AI Workflows

Claude Code works alongside other terminal AIs:

Same directory approach:

bash
# Terminal 1
claude

# Terminal 2
gemini

# Terminal 3
codex

All three AIs:

  • Read/write same project files
  • Share context via .md files (claude.md, gemini.md, agents.md)
  • Can reference each other's work

Example workflow:

markdown
# Terminal 1 (Claude)
Write a hook for this video (authority angle) β†’ authority-hook.md

# Terminal 2 (Gemini)
Write a hook for this video (discovery angle) β†’ discovery-hook.md

# Terminal 3 (Codex)
Review both hooks and recommend which to use

Context Files Workflow

Create project context with /init:

bash
/init

This creates claude.md:

  • Analyzes current directory
  • Describes project purpose
  • Tracks decisions and progress
  • Auto-loaded on future sessions

Update context:

markdown
Update claude.md to reflect that we finished the script 
and are ready to record

Multi-tool sync: Keep claude.md, gemini.md, agents.md in sync:

markdown
Use @session-closer to sync all context files 
and commit changes to git

Agent Examples

Research Agent

markdown
You are a research expert. Use web search to gather information
from reputable sources. Compile findings into structured markdown
with citations. Focus on practical, actionable insights.

Use case: Background research without bloating main conversation

Brutal Critic Agent

markdown
You are impossibly hard to please. Review work against the framework
in critic-framework.md. Provide harsh but constructive feedback.
Rate 1-10 and explain why it's not a 10. Include three perspectives.

Use case: Unbiased review with fresh eyes

Session Closer Agent

markdown
You end work sessions by:
1. Comprehensively summarizing all work done
2. Updating claude.md, gemini.md, agents.md
3. Noting key decisions and next steps
4. Committing to git with descriptive message

Read session-summary.md for past session notes.

Use case: Documentation automation when brain-dead at end of day

Gemini Delegator Agent

markdown
You delegate research tasks to Gemini in headless mode:
gemini -p "search query here"

Use Gemini for broad research, then synthesize findings.

Use case: Leveraging free Gemini tier for research tasks

Keyboard Shortcuts

ShortcutAction
Ctrl-OView agent's current work
Shift-TabCycle modes (normal/planning)
TabToggle thinking mode
Ctrl-C (2x)Interrupt agent/task
/contextView context usage
/agentsAgent management menu
/output-styleChange global persona

Tips

Protect your context:

  • Deploy agents for one-off tasks
  • Keep main conversation focused on current work
  • Use /context to monitor bloat

Specialize agents:

  • Create agents with distinct expertise
  • Reference framework documents for consistency
  • Use personal agents across projects

Automation:

  • Create session-closer agent for end-of-day
  • Use planning mode for complex tasks
  • Run dangerous mode for batch operations

Multi-tool workflows:

  • Keep context files synced
  • Use Claude for execution, Gemini for research, ChatGPT for high-level review
  • All work stored in local files (vendor-independent)

Links

NetworkChuck Video: You've Been Using AI the Hard Way