claude-sneakpeek
repository·main·Indexed 22 days ago
https://github.com/mikekelly/claude-sneakpeekA tool for creating parallel, isolated builds of Claude Code to unlock experimental, feature-flagged capabilities such as swarm mode, delegate mode, and multi-agent orchestration. It allows developers to customize their AI coding experience using various providers (including Z.ai, MiniMax, OpenRouter, and local LLMs), custom authentication modes, and system prompt enhancements via Prompt Packs.
What's inside claude-sneakpeek
- claude-sneakpeek is a tool used to create multiple isolated Claude Code variants with custom providers. It allows developers to customize their AI coding experience through different models, authentication modes, and system prompt enhancements (Prompt Packs).
Understand the features unlocked by claude-sneakpeek
mainclaude-sneakpeek provides access to feature-flagged capabilities within Claude Code that are not yet publicly released, including:
- Swarm mode: Native multi-agent orchestration using
TeammateTool. - Delegate mode: Allows the task tool to spawn background agents.
- Team coordination: Enables teammate messaging and task ownership.
- Swarm mode: Native multi-agent orchestration using
Implement Vertical Slice and Spike-First Breakdown patterns
mainTwo alternative decomposition patterns for complex requirements:
- Vertical Slice Breakdown: Instead of layers, slice by user value. Use an EXPLORE agent to map touchpoints (UI, API, DB), then FAN-OUT to define slices (e.g., Minimal Viable Feature vs. Complete Feature), and finally PIPELINE to estimate and sequence.
- Spike-First Breakdown: Use this when facing high uncertainty. Use an EXPLORE agent to identify risks, then FAN-OUT to run parallel technical or UX spikes. Use the findings in a REDUCE phase to refine the actual task breakdown.
Codebase Exploration Patterns
mainUse these patterns to navigate and understand unfamiliar codebases:
- Breadth-First Discovery: A three-phase approach. 1. FAN-OUT: Parallel scan of project structure, entry points, build files, and READMEs. 2. REDUCE: Synthesize an overview. 3. FAN-OUT: Deep dive into specific areas of interest.
- Feature Tracing: Follows a specific logic flow. 1. EXPLORE: Find relevant files via grep. 2. PIPELINE: Trace the flow from entry point through middleware/validation to the database layer. 3. REDUCE: Document the complete flow.
- Impact Analysis: Assesses the risk of changes. 1. EXPLORE: Find the definition/interface. 2. FAN-OUT: Find all imports, usages, and dependent tests. 3. REDUCE: Generate an impact report with risk assessment.
User Request: "How does user authentication work?" Phase 1: EXPLORE └─ Explore agent: Find auth-related files (grep patterns) Phase 2: PIPELINE (Follow the flow) ├─ Explore agent: Entry point (login route/component) ├─ Explore agent: Middleware/validation layer ├─ Explore agent: Session/token handling ├─ Explore agent: Database/storage layer Phase 3: REDUCE └─ General-purpose agent: Document complete auth flowSelect the appropriate model for agent tasks
mainChoose the model based on the complexity and required reasoning of the task. Always pass the
modelparameter explicitly when creating aTask.Model Role Best Use Cases haikuThe Errand Runner Fast, cheap, mechanical tasks. Fetching files, grepping, simple lookups, gathering raw info. Run 5-10 in parallel. sonnetThe Capable Worker Junior-mid dev level. Well-structured implementation, research, following patterns, test generation, documentation. opusThe Critical Thinker High-level reasoning. Ambiguous problems, architectural decisions, complex debugging, security reviews, creative problem-solving. Strategy: Use
haikufor gathering,sonnetfor well-defined work, andopuswhen you need real thinking.# Gather info - spawn haiku wildly Task(subagent_type="Explore", description="Find auth files", prompt="...", model="haiku", run_in_background=True) Task(subagent_type="Explore", description="Find user routes", prompt="...", model="haiku", run_in_background=True) Task(subagent_type="Explore", description="Find middleware", prompt="...", model="haiku", run_in_background=True) # Clear implementation task - sonnet Task( subagent_type="general-purpose", description="Implement login route", prompt="Create POST /login following the pattern in src/routes/users.ts...", model="sonnet", run_in_background=True ) # Needs judgment and critical thinking - opus Task( subagent_type="general-purpose", description="Design auth architecture", prompt="Analyze the codebase and recommend the best auth approach...", model="opus", run_in_background=True )Implement features using the Plan-Parallel-Integrate pattern
mainWhen implementing new features, use the Plan-Parallel-Integrate (PIP) pattern to manage complexity and speed up development through parallelization.
- PIPELINE (Research → Plan): Use an
Explore agentto find existing patterns and aPlan agentto design the architecture. - FAN-OUT (Parallel Implementation): Deploy multiple agents (e.g., Agent A, B, C) to work on independent components simultaneously (e.g., database schema, middleware, routes, UI).
- PIPELINE (Integration): Use a
General-purpose agentto wire components together, add tests, and verify the end-to-end flow.
Alternatively, for full-stack features, use the Vertical Slice pattern: implement one complete flow (DB → API → UI) first before expanding via FAN-OUT.
User Request: "Add user authentication" Phase 1: PIPELINE (Research → Plan) ├─ Explore agent: Find existing auth patterns, user models, middleware └─ Plan agent: Design auth architecture using findings Phase 2: FAN-OUT (Parallel Implementation) ├─ Agent A: Implement user model + database schema ├─ Agent B: Implement JWT/session middleware ├─ Agent C: Implement login/logout routes └─ Agent D: Implement frontend auth components Phase 3: PIPELINE (Integration) └─ General-purpose agent: Wire components, add tests, verify flow- PIPELINE (Research → Plan): Use an
Implement Multi-Dimensional Analysis for Pull Request Reviews
mainTo perform a thorough Pull Request (PR) review, use a Multi-Dimensional Analysis pattern. This involves a two-phase orchestration:
- FAN-OUT (Parallel analysis): Use an
Exploreagent to gather context, then spawn multiplegeneral-purposeagents in parallel to analyze specific dimensions (Code Quality, Logic, Security, and Performance). - REDUCE (Synthesize): Use a final
general-purposeagent to aggregate all findings, prioritize them, and format the final review.
For critical thinking tasks like code reviews, it is recommended to use the
opusmodel for the analysis agents to ensure depth.# All in single message for parallelism (opus for reviews - critical thinking) Task(subagent_type="Explore", prompt="Fetch PR #123 details, understand context and related issues", model="haiku", run_in_background=True) Task(subagent_type="general-purpose", prompt="Review code quality: patterns, readability, maintainability", model="opus", run_in_background=True) Task(subagent_type="general-purpose", prompt="Review logic: correctness, edge cases, error handling", model="opus", run_in_background=True) Task(subagent_type="general-purpose", prompt="Review security: injection, auth, data exposure", model="opus", run_in_background=True) Task(subagent_type="general-purpose", prompt="Review performance: complexity, queries, memory", model="opus", run_in_background=True)- FAN-OUT (Parallel analysis): Use an
Test Maintenance Orchestration Patterns
mainMaintain test suites using these patterns:
- Broken Test Triage: Run tests to capture failures, then
FAN-OUTto diagnose failure groups in parallel, followed by anotherFAN-OUTto apply fixes in parallel. - Test Refactoring: Use
EXPLOREto find duplication,PLANto design shared fixtures, andFAN-OUTto extract fixtures and refactor files. - Mock Maintenance: Use
EXPLOREto find outdated mocks, thenFAN-OUTto update mock groups, fixtures, and factories.
- Broken Test Triage: Run tests to capture failures, then
Distinguish between Orchestrator and Worker tool ownership
mainIn the orchestration model, responsibilities and tool access are strictly divided to prevent agents from mismanaging the task graph.
Orchestrator Responsibilities
Orchestrators manage the high-level flow and task lifecycle. They use:
Read(for synthesis of references, guides, and agent outputs)TaskCreate,TaskUpdate,TaskGet,TaskList(to manage the task graph)AskUserQuestion(to clarify scope)Task(to spawn workers)
Worker Responsibilities
Workers are specialized agents spawned to execute specific units of work. They use:
Read,Write,Edit,Bash(for implementation and exploration)Glob,Grep,WebFetch,WebSearch,LSP(for discovery)- Note: While Workers can see
Task*tools, they must not use them to manage the task graph.
┌─────────────────────────────────────────────────────────────┐ │ ORCHESTRATOR uses directly: │ │ │ │ • Read (references, guides, agent outputs for synthesis) │ │ • TaskCreate, TaskUpdate, TaskGet, TaskList │ │ • AskUserQuestion │ │ • Task (to spawn workers) │ │ │ │ WORKERS use directly: │ │ │ │ • Read (for exploring/implementing), Write, Edit, Bash │ │ • Glob, Grep, WebFetch, WebSearch, LSP │ │ • They CAN see Task* tools but shouldn't manage the graph │ └─────────────────────────────────────────────────────────────┘Architecture Documentation Patterns
mainUse structured patterns to document system design and evolution.
C4 Model Documentation
- FAN-OUT: Generate documentation for different levels in parallel:
- Context diagram: System and external actors.
- Container diagram: Applications and data stores.
- Component diagram: Internal components.
- Code diagram: Critical classes/modules.
- REDUCE: Compile into a single architecture document with diagrams.
Decision Record (ADR) Generation
- EXPLORE: Find architectural patterns in the code.
- FAN-OUT: Document individual decisions (e.g., database choice, framework choice). Each record should include: Context, Decision, Consequences, and Alternatives considered.
Data Flow Documentation
- EXPLORE: Trace data through the system.
- PIPELINE: Document ingress points, transformations, storage, and egress points.
- REDUCE: Create a data flow diagram.
- FAN-OUT: Generate documentation for different levels in parallel:
Dependency Analysis Patterns
mainUse these patterns to map and manage system dependencies:
- Dependency Graph: 1. EXPLORE: Find module entry points. 2. FAN-OUT: Trace internal, external, and database/service dependencies in parallel. 3. REDUCE: Visualize the graph.
- Upgrade Impact: 1. FAN-OUT: Find usages, check changelogs via
WebSearch, and find covering tests. 2. REDUCE: Create an impact assessment and migration guide. - Dead Code Detection: 1. EXPLORE: Build export/import graph. 2. FAN-OUT: Find unreferenced exports, unused functions, and commented code. 3. REDUCE: Generate a report with a safe removal list.
How Team Mode Task Storage Works
mainTasks are stored in isolated JSON files per variant. Each variant uses its own
CLAUDE_CONFIG_DIRto ensure isolation.Storage Path Structure:
~/.claude-sneakpeek/<variant>/config/tasks/<team_name>/<task_id>.jsonDynamic Team Naming
Team names are automatically scoped by the current project folder at runtime to prevent task pollution between different projects.
Command Team Name mcmc-<project-folder>TEAM=A mcmc-<project-folder>-ATEAM=backend mcmc-<project-folder>-backendRunning Multiple Teams in One Project
You can run separate teams within the same directory by using the
TEAMenvironment variable. This creates completely isolated task storage for each team.# Terminal 1 - API team TEAM=api mc # Terminal 2 - Frontend team TEAM=frontend mcTEAM=api mc