Back to Journal
Engineering2025-12-2215 min readBy QuantFlow Team

Our Claude Code Setup: Agents, MCP, and Automation

A technical deep-dive into how we configure Claude Code for maximum productivity. Learn about our custom agents, MCP integrations, hooks system, and automation patterns.

Claude CodeMCPAgentsAutomationConfigurationDevOps

Introduction

We've spent months refining our Claude Code setup. What started as default configuration has evolved into a comprehensive system of custom agents, MCP integrations, hooks, and automation patterns that multiply our productivity. For context on how we use these tools day-to-day, see how we build software with Claude Code.

This article documents our setup in detail. Whether you're just getting started with Claude Code or looking to level up an existing configuration, you'll find actionable patterns you can adopt.

Project Structure

Our Claude Code configuration lives in several locations:

project/
├── .claude/
│   ├── agents/              # Project-specific agents
│   │   ├── full-stack-engineer.md
│   │   ├── seo-specialist.md
│   │   └── qa-engineer.md
│   └── settings.json        # Project settings & hooks
├── CLAUDE.md                # Project context (always loaded)
└── .agent/                  # Navigator documentation system
    ├── DEVELOPMENT-README.md
    ├── tasks/
    ├── system/
    └── sops/

The .claude/ directory contains Claude Code-specific configuration. The .agent/ directory holds our Navigator documentation system—a structured approach to managing project knowledge that Claude loads on demand.

The CLAUDE.md File

CLAUDE.md is automatically loaded at the start of every Claude Code session. It's our single source of truth for project context:

# Project: QuantFlow Landing - Claude Code Studio

## Context
High-performance landing page for Claude Code Studio.
Tech: Next.js 15 + React 19 + TypeScript + TailwindCSS v4.

## SSR-First Principles (CRITICAL)
1. DEFAULT TO SERVER COMPONENTS
2. Page components MUST be server
3. 'use client' ONLY for interactivity

## Forbidden Actions
- ❌ NEVER 'use client' on page components
- ❌ No package.json modifications without approval
- ❌ No inline styles (use TailwindCSS)

## Development Workflow
1. Read .agent/DEVELOPMENT-README.md first
2. Check Linear for assigned tickets
3. Use TodoWrite for complex tasks
...

Key principles for effective CLAUDE.md files:

  • Keep it focused. Token budget matters. Include only what Claude needs for every session.
  • Be explicit about rules. "Never" and "Always" statements prevent common mistakes.
  • Reference other docs. Point to detailed documentation rather than duplicating it.
  • Version it. Track changes to your project context alongside your code.

Custom Agents

Agents are specialized AI assistants with their own context windows and instructions. Here's our Full-Stack Engineer agent:

---
name: full-stack-engineer
description: >
  Implementation agent for Next.js 15 features.
  Auto-invoke for coding tasks, refactoring, testing.
model: sonnet
tools: Read, Write, Edit, Bash, Grep, Glob
---

You are a senior full-stack engineer specializing in
Next.js 15, React 19, TypeScript, and TailwindCSS v4.

## Core Principles
- SSR-first: Server Components by default
- No inline styles: TailwindCSS only
- TypeScript strict mode: No 'any' without justification

## When Implementing Features
1. Check existing patterns in codebase
2. Follow SSR decision tree
3. Extract client components to separate files
4. Add proper TypeScript types
5. Update tests if applicable

## Forbidden
- Never add 'use client' to page.tsx files
- Never modify package.json without asking
- Never use inline styles

We have agents for different roles: SEO Specialist handles metadata and schema markup, QA Engineer runs comprehensive testing, Linear PM manages ticket workflows. Each agent has focused instructions that encode our team's standards.

MCP Integrations

The Model Context Protocol (MCP) is what makes Claude Code truly powerful. It's the "USB-C for AI"—a universal way to connect Claude to external tools and services.

Our active MCP servers:

Linear MCP — Ticket management directly from Claude Code:

// Read assigned issues
list_issues({ assignee: "me" })

// Get ticket details
get_issue({ id: "QF-123" })

// Update progress
update_issue({ id: "QF-123", state: "In Progress" })

// Add comments
create_comment({ issueId: "QF-123", body: "Implementation complete" })

Slack MCP — Team communication without leaving the terminal:

// Post updates to engineering channel
conversations_add_message({
  channel_id: "#quantflow-engineering",
  payload: "QF-123 deployed to staging"
})

Chrome DevTools MCP — Browser automation for testing:

// Navigate and screenshot
navigate_page({ url: "http://localhost:3000" })
take_screenshot({ fullPage: true })

// Performance tracing
performance_start_trace({ reload: true, autoStop: true })

Adding a new MCP server is simple:

claude mcp add linear-server --scope user
claude mcp add slack --scope user
claude mcp list  # Verify installation

Hooks System

Hooks are shell commands that execute at specific lifecycle points. They provide deterministic control over Claude's behavior—essential for enforcing team standards.

Example: Auto-format on file edit

// .claude/settings.json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "prettier --write $CLAUDE_FILE_PATH"
      }
    ]
  }
}

Available hook events:

  • PreToolUse — Before tool calls (can block them)
  • PostToolUse — After tool calls complete
  • UserPromptSubmit — When user submits prompt
  • PermissionRequest — When permission dialogs appear
  • Stop — When Claude finishes a task
  • SessionStart/End — Session lifecycle

We use hooks for automatic formatting, lint fixes, commit message validation, and file protection (preventing edits to production configs).

Context Optimization

With a 200K token context window, Claude can hold a lot—but not everything. We've developed strategies to maximize context efficiency:

Navigator Documentation System. Instead of loading all documentation at session start, we use a lightweight index (DEVELOPMENT-README.md) that tells Claude what docs exist and when to load them. Typical savings: 90%+ reduction in documentation tokens.

Agent-based research. For codebase exploration, we spawn Explore subagents rather than loading files directly. The subagent does the searching, summarizes findings, and returns only relevant context.

Strategic /compact. After completing isolated tasks, we run /compact to clear conversation history while preserving key context. This resets the token budget for the next task.

Context markers. Before compacting, we save state to .agent/.context-markers/. This lets us resume work exactly where we left off in future sessions.

Automation Patterns

Beyond interactive use, Claude Code integrates into our broader automation:

Headless mode for batch operations:

# Analyze multiple files
find src -name "*.tsx" | xargs -I {} claude -p "Review for SSR violations: {}"

# Generate documentation
claude -p "Generate JSDoc for all exported functions" --output json

Git workflow automation:

# Claude handles the entire commit workflow
# - Analyzes staged changes
# - Writes conventional commit message
# - Creates commit with proper format
# - Updates Linear ticket status

Parallel execution with worktrees:

# Create isolated worktree for parallel development
git worktree add ../project-feature-x feature-x

# Run Claude Code in each worktree
# Changes stay isolated until merge

Getting Started

If you want to replicate our setup, start here:

1. Install Claude Code

npm install -g @anthropic-ai/claude-code
claude auth login

2. Create your CLAUDE.md

Start with project basics: tech stack, coding standards, forbidden actions. Iterate as you learn what context Claude needs.

3. Add your first MCP server

claude mcp add github --scope user

4. Create a custom agent

Start with the /agents command to manage agents interactively. Create focused agents for your most common workflows.

5. Set up hooks

Add a .claude/settings.json with your first hook—auto-formatting is a good start.

Conclusion

Our Claude Code setup isn't magic—it's the result of iterative refinement. We've tried approaches that didn't work, simplified configurations that were too complex, and gradually built a system that amplifies our productivity.

The key insight: Claude Code is most powerful when you invest in configuration. Default settings work, but custom agents, MCP integrations, and thoughtful context management transform it from a useful tool into a force multiplier.

If you're building with Claude Code and want to compare notes, we're always learning—and we'd love to hear about your setup.

Get Free Project Estimate

Tell us about your ideas and we find the best way to make it real. Fill the form and send us, we usually respond within 24 hours.

By sending this request, you agree that your data will be stored and processed by the website. For more information, please read our Privacy Policy