Cookbook/The Slot Machine Workflow for Complex Tasks
workflow
12 min

The Slot Machine Workflow for Complex Tasks

workflow
complex-tasks
strategy

The Slot Machine Workflow for Complex Tasks

What You'll Learn

A unique workflow strategy from Anthropic's Data Science & ML Engineering team that treats Claude Code sessions like a slot machine - save state, run for 30 minutes, then either accept results or start fresh.

Prerequisites

  • Claude Code CLI installed
  • A complex task that might require multiple attempts
  • Ability to save/restore project state (git, snapshots, etc.)

Steps

Step 1: Save Your Starting State

Before beginning any complex task, create a clean checkpoint:

# Create a git branch for experimentation
git checkout -b claude-attempt-1
git add .
git commit -m "Checkpoint before Claude Code session"

Step 2: Set a Timer for 30 Minutes

Use a timer to bound your Claude Code session:

# On macOS/Linux
timer 30m

# Or use your phone/watch timer

Step 3: Give Claude Code Full Context and Let It Run

Provide comprehensive instructions and let Claude work autonomously:

claude "Implement a real-time data pipeline that:
- Ingests data from Kafka
- Transforms using our business rules in transforms.py
- Stores in TimescaleDB
- Includes monitoring and error handling
- Has comprehensive tests"

Step 4: Evaluate Results at 30 Minutes

When the timer goes off, stop and evaluate:

  • Did Claude Code make good progress?
  • Is the approach sound?
  • Are there fundamental issues?

Step 5: Accept or Reset

If results are promising:

git add .
git commit -m "Claude Code implementation - keeping"
git checkout main
git merge claude-attempt-1

If results are problematic:

# Abandon this attempt
git checkout main
git branch -D claude-attempt-1

# Start fresh with lessons learned
git checkout -b claude-attempt-2

Example Usage

Here's how the Data Science team uses this for building dashboard apps:

# Attempt 1: Let Claude build the full dashboard
git checkout -b dashboard-v1
claude "Build a JavaScript/TypeScript dashboard for our ML metrics"
# Timer runs for 30 minutes...

# Not quite right - too complex. Reset and try simpler approach
git checkout main
git branch -D dashboard-v1

# Attempt 2: Break into smaller pieces
git checkout -b dashboard-v2
claude "Build just the data fetching layer for our ML metrics dashboard"
# This works! Keep it and continue

Tips & Variations

  • Interrupt for Simplicity: As the Data Science team notes: "Ask 'why are you doing this? Try something simpler'"
  • Document Lessons: Keep notes on what didn't work to inform future attempts
  • Adjust Time: 30 minutes is a guideline - adjust based on task complexity
  • Multiple Slots: Run several "slot machine" attempts in parallel on different approaches

Why This Works

This approach is particularly effective for:

  • Exploratory development where the best approach isn't clear
  • Complex refactoring tasks that might go wrong
  • Learning new technologies where Claude might make mistakes
  • Preventing sunk cost fallacy - it's easier to abandon 30 minutes than 3 hours

Master Claude Code with Expert Training

These recipes are from our comprehensive 2-day training course. Learn directly from experts and transform your development workflow.