I Built an AI Agent to Book My Haircut
AIAutomationTechnology

I Built an AI Agent to Book My Haircut

How I used Claude Code + Playwright to check my calendar, navigate a booking site, and schedule an appointment—turning life admin into a one-command workflow.

JM

Jason Macht

Founder @ White Space

January 12, 2026
9 min read

I was three weeks overdue for a haircut. It's a 15-minute task—pull up my calendar, check the barber's website, find an open slot, book it. But it kept getting deprioritized. There's always something more urgent.

So I asked myself: why am I doing this manually at all?

I built a Claude Code agent that checks my Google Calendar, navigates my barber's booking website with Playwright, and schedules the appointment for me. End-to-end. One command.

It sounds like overkill for a haircut. But here's the thing—life admin is the perfect proving ground for AI agents. It's repetitive, rules-based, and way too annoying relative to its actual importance. And once you've built the pattern for one task, you can apply it everywhere.

Let's go ahead and jump into it.

The Setup: What I Gave the Agent

Before the agent could do anything, I needed to give it context and constraints. I put together a short brief:

Where I go: The specific barbershop and their booking portal URL

Stylist preference: Who I normally see (or "anyone available" as a fallback)

Time constraints:

  • Prefer weekday mornings before 10am
  • Avoid Mondays entirely
  • At least 2 days' notice required

Access I provided:

  • Google Calendar read access (to check my availability)
  • Booking site credentials (stored in environment variables, not pasted in prompts)
  • My payment card was already saved on the site, so no new payment details needed

Approval boundary: The agent could complete the booking, but for anything that created a commitment or cost, I wanted final confirmation before it proceeded.

This took maybe 5 minutes to set up. The constraints are the key—the clearer you are about preferences, the less back-and-forth with the agent later.

The Tools

Three things made this work:

Claude Code as the orchestrator. It plans the approach, writes code, handles errors, and iterates. This is the "brain" that coordinates everything.

Google Calendar integration so the agent knows when I'm actually free. No point booking an 8am haircut when I have a client call.

Playwright for browser automation. The agent navigates the booking website like a real user—clicks, fills forms, selects options. Most booking systems don't have APIs, so this is how you get things done.

The key insight: this isn't a chatbot answering questions. It's an agent executing a workflow across multiple systems. That's a fundamentally different capability.

How It Worked: Step by Step

Step 1: Calendar Check

I started with a simple prompt:

"Book me a haircut at [shop name] sometime this week. Here's their booking site: [URL]. Check my calendar first and find times that work. I prefer morning slots before 10am, no Mondays."

The agent connected to my Google Calendar and pulled my upcoming events. It identified several open morning slots—Tuesday, Wednesday, and Thursday all had availability before 10am.

Step 2: Navigate the Booking Site

Using Playwright, the agent opened the barbershop's booking page. It handled:

  • Cookie consent banners (auto-dismiss)
  • Login flow (using credentials from environment variables)
  • Service selection ("Men's Haircut")
  • Stylist selection (my preferred person, or next available)

This is where things get interesting. The agent doesn't just follow a script—it reads the page, understands the UI elements, and adapts. When the stylist selection was a dropdown versus clickable cards, it figured it out.

Step 3: Match Availability

The agent cross-referenced:

  • My calendar availability (from Step 1)
  • The barbershop's open slots (from the booking page)
  • My stated preferences (mornings, no Mondays)

It found three matching options: Tuesday 9am, Wednesday 8:30am, Thursday 9:30am.

Step 4: Book and Confirm

The agent selected Tuesday 9am and proceeded through the booking flow. Before finalizing, it showed me:

"Ready to book: Haircut with [stylist] on Tuesday, January 14th at 9:00am. Total: $32. Confirm?"

I typed "yes" and it completed the booking. The confirmation email arrived 30 seconds later.

Step 5: Calendar Update

As a final step, the agent added the appointment to my Google Calendar with the shop address and a 15-minute travel buffer before the slot.

Total time from prompt to confirmed booking: about 3 minutes.

Handling the Tricky Parts

Not everything went smoothly on the first run. Here's what I learned:

CAPTCHAs and Bot Detection

Some booking sites have anti-automation measures. My barber's site didn't, but I've hit CAPTCHAs on other services.

The right approach here is human-in-the-loop: when the agent hits a CAPTCHA, it pauses and asks me to solve it, then continues. It's not about bypassing security—it's about handling the exception gracefully.

Session Timeouts

The first time I ran this, the booking page timed out while the agent was checking my calendar. Playwright can handle retries, but you need to build that into the workflow. Now the agent saves state after each step and can resume from where it left off.

Ambiguous Availability

Early runs had the agent asking clarifying questions: "Your calendar shows 'tentative' for Tuesday 9am—should I treat that as available or blocked?" These are good questions. I updated my constraints to handle them: tentative = available unless it's a client-facing meeting.

What Surprised Me

The hard part isn't the clicking—it's encoding preferences clearly.

Once the agent has:

  • Access to my calendar
  • My constraints documented
  • The ability to operate a browser

...it can do a lot of tasks we treat as "too annoying to automate."

The booking site could have been anything. A restaurant reservation. A doctor's appointment. A DMV slot. The pattern is identical: check my availability, navigate a website, find a match, book it.

The Executive Agent Pattern

This isn't a one-off script. It's a reusable archetype:

1. Intent capture: Preferences and constraints, documented once 2. Context access: Calendar (and optionally email, contacts, etc.) 3. Tool execution: Web navigation, form filling, confirmations 4. Feedback loop: "Here's what I'm about to do—approve?" or "I hit a blocker—what now?"

Once you've built this pattern, extending it is straightforward. Same structure, different target.

Guardrails: Making This Safe

A few things I set up to prevent chaos:

Minimum permissions. The agent has read-only calendar access by default. Write access is granted explicitly for adding events.

Credential hygiene. Secrets live in environment variables, never in prompts. The agent references them without ever seeing the actual values.

Approval checkpoints. Anything that creates a commitment (booking, payment, cancellation) requires my explicit "yes."

Logging and screenshots. Playwright captures a screenshot at each step. If something goes wrong, I can see exactly what the agent saw.

Retry strategy. Websites are flaky. The agent expects timeouts and knows how to retry gracefully.

Where This Goes Next

If an agent can book a haircut today, it can coordinate:

  • Recurring appointments — "Keep my dental cleanings on a 6-month cycle"
  • Travel logistics — "Book a hotel for my SF trip, close to the conference venue, under $250/night"
  • Expense workflows — "Submit my receipts and match them to the right expense categories"
  • Client scheduling — "Find a 30-minute slot that works for me and this client, then send the invite"

The limiting factor is increasingly workflow design and imagination, not raw capability.

Gartner predicts that by 2026, 40% of enterprise applications will include task-specific AI agents. We're already there for personal productivity—the tools exist, they work, and they save real time.

What Didn't Work Perfectly

Being honest:

Websites change. My barber's site updated their UI two weeks after I built this. A button moved, and the automation broke. I spent 10 minutes updating the selector. This is the ongoing maintenance cost.

Some flows require human verification. 2FA, CAPTCHA, identity verification—these are friction points by design. The agent handles them by pausing for my input, but they add time.

Preference encoding takes iteration. My first run booked a 7:30am slot because I said "morning" without specifying a floor. Learned that one the hard way.

The Real Takeaway

Tools and models are now good enough to act, not just advise.

An AI assistant that tells me "here are available slots" is helpful. An AI agent that actually books the slot is transformational. That's the difference between a calculator and an employee.

The average professional spends 4.8 hours per week just scheduling meetings—over six full work weeks per year. Businesses using AI scheduling see 30-40% reductions in administrative overhead. These numbers compound.

If you're not experimenting with agents in your personal and professional workflows, you're leaving time on the table. Start small. Automate one annoying task. Then apply the pattern everywhere else.

FAQ

Q: Isn't this overkill for booking a haircut?

For one haircut? Maybe. But once the pattern exists, I use it for everything. The marginal cost of adding a new booking workflow is near zero.

Q: What if the website changes?

It will. You update the selectors. This is why I recommend Playwright over screen-coordinate clicking—it's more robust to layout changes. Most updates take 5-10 minutes.

Q: Does this work for sites that require login?

Yes. The agent handles login flows. Credentials are stored securely and referenced at runtime.

Q: What about sites with dynamic content or JavaScript-heavy UIs?

Playwright handles modern SPAs well. It waits for elements to load and can interact with dynamically rendered content. Some very complex UIs might need more specific handling.

Q: Can I run this on a schedule?

Absolutely. You could have it check every Monday morning for haircut availability and book when you're due. Cron job + Claude Code + Playwright = automated life admin.

Q: How much does this cost to run?

Claude Code is $20/month for Pro. Playwright is free. The actual API usage per booking is pennies. Way less than the value of my time.

Ready to Automate Your Life Admin?

The best part about building these agents: once you've done it once, you see the pattern everywhere.

Start with something small and annoying. A booking you keep putting off. A form you fill out repeatedly. A check you run manually every week.

Build the agent. Watch it work. Then ask yourself: what else could this do?

If you want help building custom agents for your business workflows—scheduling, coordination, data entry, whatever keeps falling through the cracks—that's exactly what we do.

Check out our automation services or read about how we built a data pipeline with AI agents for another example of what's possible.

That's all I got for now. Until next time.

Want to get more out of your business with automation and AI?

Let's talk about how we can streamline your operations and save you time.