You sit down to research something important, and three hours later you're watching a video about how medieval peasants bathed more than we think. That happens to me too often.
That's the spark behind MindCap—a browser extension I'm building to help me understand where my attention goes online. Not to judge myself, but to find patterns I can't see in the moment.
The Problem: We're All Frogs in Boiling Water
The internet is designed to capture your attention. Every platform, every algorithmically-curated feed—they're all competing for your eyeballs, and they're good at it.
I'm not anti-internet. I love discovering weird rabbit holes. But I wanted to understand the difference between:
- Intentional exploration — following genuine curiosity, going deep on a topic
- Distraction spirals — mindlessly clicking through recommended content, losing hours without realizing it
Screen time apps tell you "you spent 4 hours on YouTube." But what kind of 4 hours? Learning about machine learning for a project, or watching cooking disasters? There's a difference.
The MindCap hypothesis: If I can track not just where I browse but how I engage—scroll depth, time on page, click patterns, topic connections—I can build a picture of my attention that's actually useful.
Building with Claude Code
I've been building MindCap with Claude Code, and it's changed how I think about building software.
Claude isn't just generating code for me to copy-paste. We have conversations about architecture decisions, debug weird edge cases together, brainstorm ideas. (I'm the one at 2am. Claude is always available.)
"Wait, what if we track not just that someone scrolled, but how fast they scrolled? Someone speed-reading vs. someone slowly absorbing content—that's meaningful data!"
That was a real moment from one of our sessions. Claude suggested tracking scroll velocity as an engagement signal, and it completely changed how I thought about the data model. Now MindCap tracks over 50 different engagement signals per page visit.
What MindCap Actually Does
At its core, MindCap is a Chrome extension that runs quietly in the background, watching how you interact with web pages. But unlike creepy surveillance tools (the irony isn't lost on me), all the detailed data stays on your machine. Only sanitized, aggregated patterns go to the cloud for analysis.
The Data Layer
Every page visit captures things like:
- Time on page and active engagement time (was the tab actually focused?)
- Scroll depth and velocity (did you read it or skim it?)
- Click patterns (clicking links vs. clicking around aimlessly)
- Video watching behavior (watch time, max progress, replay patterns)
- Content analysis (reading level, word count, sentiment)
- Exit behavior (did you follow a link, hit back, or just close the tab?)
All of this gets synthesized into engagement scores that help identify your browsing "sessions"—coherent periods of related activity.
Session Detection
This is where it gets interesting. MindCap groups your browsing into sessions based on:
- Topic similarity — are you staying focused or jumping around?
- Time gaps — 30+ minutes of inactivity starts a new session
- Engagement patterns — switching from deep reading to quick scanning might signal a mode change
The result? Labels like "research session," "rabbit hole," or "deep dive" that actually mean something.
The Development Journey (aka The Chaotic Parts)
Building a browser extension that tracks everything without being a privacy nightmare is... tricky. Here are some of the fun challenges:
The Duplicate Visits Problem
Modern websites are often Single Page Applications (SPAs). Amazon, YouTube, Twitter—they don't do traditional page loads. So my extension was seeing the same "page" multiple times as the app updated.
Solution? A deduplication window. If the same URL fires within 5 seconds, we skip it:
// Simple but effective deduplication
const recentVisits = new Map<string, number>()
const DEDUP_WINDOW_MS = 5000
function shouldRecordVisit(url: string): boolean {
const now = Date.now()
const lastVisit = recentVisits.get(url)
if (lastVisit && (now - lastVisit) < DEDUP_WINDOW_MS) {
return false // Skip duplicate
}
recentVisits.set(url, now)
return true
}
The Extension Context Problem
Chrome extensions can reload while a user is browsing. When that happens, content scripts (the code running on web pages) suddenly can't talk to the background script anymore. They throw "Extension context invalidated" errors.
Fix: Check if the context is still valid before trying to communicate:
function isContextValid(): boolean {
try {
return !!chrome.runtime?.id
} catch {
return false
}
}
// Before any chrome.runtime call
if (!isContextValid()) {
return // Gracefully bail out
}
The Domain Classification Problem
To understand browsing patterns, I need to know what category each site belongs to. Is reddit.com social media or news? Is github.com work or personal?
Instead of maintaining a massive static database, MindCap uses Claude Haiku (Anthropic's fast, cheap model) to classify domains on-the-fly. Classifications get cached globally, so the cost is minimal—roughly $0.002/month for the average user.
Working with Claude
There's a lot of AI hype, so I want to be clear: working with Claude isn't magic. It doesn't read my mind or write perfect code. Here's what it's like:
What Works Well
- Brainstorming — Exploring ideas from angles I wouldn't think of
- Documentation — Reading through API docs and explaining the relevant parts
- Debugging — Rubber duck debugging, but the duck talks back with useful suggestions
- Architecture discussions — "Here are three ways to structure this, here are the tradeoffs"
- Remembering context — Mid-project, Claude can recall decisions we made sessions ago
The Limits
- Sometimes Claude confidently suggests code that doesn't work. You still need to understand what you're building
- Complex state management and async flows can trip it up. I've spent time debugging "fixes" that introduced new bugs
- It's not a replacement for understanding your tools—more like a very smart collaborator who knows everything in theory but needs guidance on your specific codebase
Claude amplifies what I can do. It doesn't replace the thinking—it gives me someone to think with.
What's Next?
MindCap is still in development, but the core is working. Here's what's coming:
- Pattern Detection — Identifying recurring behaviors like "always falls into YouTube after checking email"
- Weekly Digests — AI-generated summaries of your attention patterns and trends
- Dashboard — A web interface to explore your sessions, see patterns, and get insights
- Account Linking — Connect YouTube, Spotify, and other services for cross-platform insights
Privacy note: Full URLs never leave your device. Only domains and aggregated patterns sync to the cloud. Your embarrassing Wikipedia deep dives stay between you and your browser.
The Bigger Picture
We're all navigating an attention economy designed to exploit our psychology. I'm not trying to optimize my way out of being human—I still want to discover weird corners of the internet and follow random curiosities.
But I want to do it intentionally. I want to know when I'm choosing to explore vs. when I'm being pulled along by algorithmic manipulation. MindCap is my attempt to build that self-awareness.
Building it with Claude has been one of the more satisfying development experiences I've had. There's something useful about a collaborator who can jump between architecture discussions, TypeScript debugging, and Python backend design without missing a beat.