Przejdź do głównej zawartości

Advanced Techniques: Tips 76-85

Ta treść nie jest jeszcze dostępna w Twoim języku.

These advanced techniques represent the cutting edge of Claude Code usage. From extended thinking modes that unlock Claude’s deepest reasoning capabilities to sophisticated MCP integrations and custom automation, these tips will help you achieve expert-level proficiency.

Tip 76: Use Extended Thinking for Complex Tasks

Section titled “Tip 76: Use Extended Thinking for Complex Tasks”

Claude Code supports various thinking modes for different complexity levels:

Terminal window
# Standard thinking (default)
"Implement user authentication"
# Extended thinking (~5,000 tokens)
"Think about this problem: How should we architect
a real-time collaborative editing system?"
# Deep thinking (~10,000 tokens)
"Think hard about this: Design a distributed caching
system with automatic invalidation and sharding"
# Ultra thinking (~128,000 tokens)
"Ultrathink: Analyze our entire codebase and propose
a microservices migration strategy"

Thinking Mode Guidelines

  • Standard: Routine coding tasks
  • “Think”: Architecture decisions, complex debugging
  • “Think hard/harder”: System design, performance optimization
  • “Ultrathink”: Major architectural changes, complex analysis

Real-world thinking examples:

Terminal window
"Think hard about how to design a multi-tenant
SaaS architecture that supports:
- Data isolation per tenant
- Shared infrastructure
- Custom domains
- Flexible pricing tiers
- Horizontal scaling"
# Claude spends ~10k tokens reasoning through:
# - Database strategies
# - Security implications
# - Performance tradeoffs
# - Implementation approaches

Model Context Protocol (MCP) servers extend Claude Code’s capabilities:

  1. Install MCP Servers

    Terminal window
    npm install -g @modelcontextprotocol/server-github
    npm install -g @modelcontextprotocol/server-postgres
    npm install -g @modelcontextprotocol/server-puppeteer
  2. Configure in .mcp.json

    {
    "servers": {
    "github": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-github"],
    "env": {
    "GITHUB_TOKEN": "${GITHUB_TOKEN}"
    }
    },
    "database": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-postgres"],
    "env": {
    "DATABASE_URL": "${DATABASE_URL}"
    }
    },
    "browser": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-puppeteer"]
    }
    }
    }
  3. Use MCP Tools

    Terminal window
    # GitHub operations
    "Create an issue for the authentication bug"
    "List all open PRs that need review"
    # Database queries
    "Show me the user table schema"
    "Find users who haven't logged in for 30 days"
    # Browser automation
    "Test the login flow in the browser"
    "Take screenshots of the dashboard"

Tip 78: Create Project-Specific Tool Chains

Section titled “Tip 78: Create Project-Specific Tool Chains”

Build custom MCP servers for your specific needs:

custom-mcp-server.ts
import { Server } from '@modelcontextprotocol/server';
const server = new Server({
name: 'project-tools',
version: '1.0.0'
});
// Custom tool for your project
server.addTool({
name: 'deploy-staging',
description: 'Deploy current branch to staging',
inputSchema: {
type: 'object',
properties: {
branch: { type: 'string' }
}
},
handler: async ({ branch }) => {
// Implementation
return { success: true, url: 'https://staging.example.com' };
}
});
server.start();

Custom MCP Use Cases

  • Deployment automation
  • Custom linting rules
  • Project-specific workflows
  • Integration with proprietary tools
  • Security-sensitive operations

Enable Vim mode for efficient text navigation:

Terminal window
# Enable Vim mode during a session
/vim
# Toggle Vim mode on/off
/vim

Vim mode features:

  • Standard Vim navigation (hjkl)
  • Text objects and motions
  • Visual mode selection
  • Macro recording
  • Custom key mappings
# Quick navigation
gg # Go to start
G # Go to end
5j # Down 5 lines
/pattern # Search forward
n # Next match

Set up automated PR reviews with custom focus:

  1. Install GitHub App

    Terminal window
    /install-github-app
    # Follow OAuth flow
  2. Configure Review Settings

    .github/claude-code-review.yml
    review:
    enabled: true
    trigger:
    - on_pr_opened
    - on_pr_updated
    direct_prompt: |
    Review this PR focusing on:
    1. Security vulnerabilities
    2. Performance issues
    3. Logic errors
    4. Missing error handling
    Be concise. Only report actual issues.
    ignore_patterns:
    - "*.test.js"
    - "*.md"
    - "package-lock.json"
  3. Custom Review Commands

    Terminal window
    # In PR comments
    @claude-code review security
    @claude-code suggest improvements
    @claude-code check performance

Real-world results from teams:

“Claude catches actual bugs while humans focus on style. It found a race condition our senior engineers missed.” - Security Team

Tip 81: Implement Multi-Instance Workflows

Section titled “Tip 81: Implement Multi-Instance Workflows”

Run multiple Claude Code instances for complex projects:

Terminal window
# Terminal 1: Backend Development
claude --add-dir ./backend
"Implement new authentication endpoints"
# Terminal 2: Frontend Development
claude --add-dir ./frontend
"Create login UI components"
# Terminal 3: Database Migrations
claude --add-dir ./database
"Design schema for authentication"
# Terminal 4: Integration Testing
claude --add-dir ./tests
"Write integration tests for auth flow"

Multi-Instance Benefits

  • True Parallelism: Each instance works independently
  • Context Isolation: No cross-contamination
  • Specialized Focus: Each instance becomes expert in its area
  • Team Simulation: Like having multiple developers

Coordination strategies:

Terminal window
# Shared workspace for coordination
mkdir .claude/shared
# Instance 1 generates interface
"Generate TypeScript interfaces for the API and save to .claude/shared/api.types.ts"
# Instance 2 uses interface
"Implement frontend using types from .claude/shared/api.types.ts"

Tip 82: Use Filesystem for Reference Materials

Section titled “Tip 82: Use Filesystem for Reference Materials”

Pull in reference implementations and documentation:

Terminal window
# Create reference directory
mkdir -p .claude/references
# Pull in examples
"Download the Express.js authentication example into .claude/references/"
"Copy the OAuth2 flow diagram from the RFC into our docs"
# Use as reference
"Implement OAuth2 similar to the reference in .claude/references/
but adapted for our architecture"

Teach Claude your coding style:

  1. Collect Style Examples

    Terminal window
    mkdir .claude/style-guide
    # Add your best code examples
  2. Analyze Your Style

    Terminal window
    "Analyze the code in .claude/style-guide/ and document
    my coding patterns, naming conventions, and architectural
    preferences"
  3. Update CLAUDE.md

    Terminal window
    "Update CLAUDE.md with the coding style analysis"
  4. Apply Consistently

    Terminal window
    "Refactor this module to match our style guide"

Style elements to capture:

  • Variable naming patterns
  • Function organization
  • Comment style
  • Error handling approach
  • Test structure
  • Documentation format

Tip 84: Implement Chain-of-Thought Prompting

Section titled “Tip 84: Implement Chain-of-Thought Prompting”

Guide Claude through complex reasoning:

Terminal window
# Instead of direct request
"Fix the performance issue"
# Use chain-of-thought
"Let's debug this performance issue step by step:
1. First, identify all database queries in the request path
2. Then analyze each query for N+1 problems
3. Check for missing indexes
4. Look for unnecessary data fetching
5. Propose optimizations for each issue found"

Chain-of-Thought Patterns

Effective patterns:
- "Let's think through this step by step"
- "First... Then... Finally..."
- "Consider the following aspects"
- "Analyze... then propose..."
- "Break this down into..."

Have Claude help optimize your Claude Code usage:

Terminal window
# Analyze your usage patterns
"Review my conversation history and identify:
1. Repetitive tasks I could automate
2. Inefficient prompting patterns
3. Opportunities for custom commands
4. Common mistakes to add to CLAUDE.md"
# Optimize your CLAUDE.md
"Analyze our CLAUDE.md file and suggest improvements
based on Claude Code best practices"
# Create custom workflows
"Based on my usage patterns, create custom slash
commands for my most common tasks"
# Improve prompting
"Review my prompts and suggest more effective ways
to communicate with Claude Code"

Meta-development insights:

  • Track repetitive patterns
  • Identify workflow bottlenecks
  • Optimize token usage
  • Improve prompt clarity
  • Enhance team coordination

Combining these advanced techniques creates powerful workflows:

Terminal window
# Morning: Architecture Design
claude --dangerously-skip-permissions
"Ultrathink: Design our new microservices architecture
considering our current monolith constraints"
# Parallel Implementation
# Terminal 1
claude --add-dir ./services/user
"Implement the user service based on the architecture"
# Terminal 2
claude --add-dir ./services/order
"Implement the order service based on the architecture"
# Integration Testing
"Use the browser MCP to test the full flow"
# Automated Review
"Create PR with comprehensive description"
# Claude reviews automatically via GitHub App
# Meta-optimization
"Review today's work and suggest workflow improvements"

These advanced techniques represent a new paradigm in software development:

  1. Thinking at Scale: Use extended reasoning for complex decisions
  2. Tool Integration: MCP servers connect Claude to your entire toolchain
  3. Parallel Development: Work like a team using multiple instances
  4. Continuous Improvement: Claude helps optimize its own usage
  5. Automated Quality: GitHub integration ensures consistent reviews

With advanced techniques mastered, learn how to scale these practices across your team. Continue to Team Collaboration for best practices in collaborative AI-assisted development.