How to Build a Chrome Extension with AI (From Someone Who Built 11)
Learn how to build a Chrome extension with AI tools like Claude and Cursor. A step-by-step guide from a developer who shipped 11 extensions.
Saidul Islam
Author

I've shipped 11 Chrome extensions in the past few months. Not over years — months. Some took a weekend. One took an evening. And I'm not some Chrome extension veteran who's been doing this since 2012.
The difference? AI changed everything about how extensions get built.
I'm not talking about vague "AI can help you code" advice. I mean the specific workflow I use — which AI tools handle which parts, where they fail, and how to go from a blank folder to a published Chrome Web Store listing without losing your mind.
If you've been sitting on a Chrome extension idea but felt like the learning curve was too steep, this guide is for you. I'll walk you through exactly how I build extensions with AI, including the mistakes that cost me hours so you can skip them.
Why AI Changes Everything for Chrome Extension Development
Chrome extension development has always been kind of annoying. The manifest format is finicky. Content scripts and background workers have weird communication patterns. The Chrome APIs are powerful but poorly documented in places. And debugging? You're juggling the extension popup, background service worker, and content script contexts all at once.
AI doesn't eliminate these challenges, but it cuts the time in half. Here's what actually changed for me:
Scaffolding went from hours to minutes. Instead of copying boilerplate from old projects or wrestling with starter templates, I describe what I want and get a working manifest.json, folder structure, and initial files in one shot.
API lookup became conversational. Chrome's extension API docs are extensive but scattered. Instead of tab-hopping between docs pages, I ask Claude "how do I intercept network requests in a Manifest V3 service worker?" and get a working code snippet with context.
Debugging got a thinking partner. When my content script isn't injecting properly or my message passing is silently failing, I paste the error and relevant code into an AI chat. It usually spots the issue before I'd even find the right Stack Overflow thread. Last week it caught a missing activeTab permission that I'd been debugging as a content script injection failure for 20 minutes.
That said — AI won't build your extension for you. Not well, anyway. You still need to understand what you're building and why. The AI accelerates execution, but you drive the architecture.
The Tools I Actually Use (and What Each One's Good At)
After building 11 extensions, I've settled on a specific toolkit. Not because I tried every option — I tried enough to know what works.
Claude — The Architect
Claude is my go-to for planning and complex logic. When I'm starting a new extension, I'll spend 20-30 minutes in a Claude conversation mapping out the architecture: what permissions I need, how data flows between the popup and content script, what the storage schema should look like.
Claude is especially strong at understanding the relationships between extension components. When I built AI Chat Organizer, the trickiest part was designing how the sidebar component would communicate with the content script injected into ChatGPT's page. Claude helped me think through the message-passing architecture before I wrote a single line of code.
Cursor — The Builder
For actual coding, Cursor is where I spend most of my time. The AI autocomplete understands your project context, so when you're working in your background.js and reference a function from utils.js, it knows what's there. That contextual awareness is huge for extension development where you're constantly jumping between files.
I typically scaffold the project with Claude, then open it in Cursor and start building feature by feature. Cursor's inline editing (Cmd+K) is perfect for saying "add a listener for tab updates that filters for only YouTube URLs" and getting correct, contextual code.
ChatGPT — The Quick Reference
Honestly, ChatGPT is the weakest link in my extension workflow. I mostly keep it around because it's faster to open than digging through Chrome's API reference when I hit something weird, like why chrome.tabs.query returns different results in incognito. Claude is better at reasoning through the actual fix, but ChatGPT gets to a "good enough" explanation faster when I just need to understand the behavior, not solve the whole problem.
Step-by-Step: From Idea to Chrome Web Store
Let me walk you through the actual process I follow. Not theory — this is what I do every time.
Step 1: Validate the Idea (30 Minutes)
Before touching any code, I spend 30 minutes validating. I search the Chrome Web Store for existing solutions. I check Reddit threads for people complaining about the problem. I look at competitor extensions' reviews for what they're missing.
This is the step most people skip, and it's the most important one. Three of my 11 extensions started as different ideas that I pivoted after this research phase.
For more on identifying winning extension ideas, check out my piece on Chrome extension trends shaping the market.
Step 2: Architecture with AI (1-2 Hours)
I open Claude and describe the extension in detail. Not just "build me a tab manager" but the full picture:
- What problem does it solve?
- What does the user see (popup, sidebar, injected UI)?
- What Chrome APIs does it need?
- What data needs to persist?
- What are the edge cases?
From this conversation, I get:
- A manifest.json with the right permissions
- A folder structure
- A data flow diagram (even if it's just text)
- The key technical decisions documented
I copy all of this into a CLAUDE.md or ARCHITECTURE.md file in the project root. This becomes the context document that AI tools reference throughout development.
Step 3: Scaffold the Project (30 Minutes)
With the architecture documented, I ask Claude to generate the initial files. I always start with:
manifest.json(Manifest V3 — MV2 is dead)background.js(service worker with basic event listeners)popup.html+popup.js(minimal UI)content.js(if the extension interacts with web pages)styles.css(basic styling)
Here's a real manifest.json from one of my extensions, stripped down to the basics:
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0",
"description": "Does one thing well",
"permissions": ["storage", "activeTab"],
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon-16.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
}
},
"background": {
"service_worker": "background.js"
},
"content_scripts": [{
"matches": ["https://*.example.com/*"],
"js": ["content.js"]
}]
}
I paste these files into my project, open in Cursor, and immediately test by loading the unpacked extension in Chrome (chrome://extensions → Developer mode → Load unpacked). Getting that first "it loads without errors" moment early is critical. It's your foundation.
Step 4: Build Feature by Feature (2-8 Hours)
This is where Cursor shines. I build one feature at a time, testing each one before moving to the next. My typical order:
- Core functionality — the one thing the extension must do
- Data persistence — saving to
chrome.storage.localorchrome.storage.sync - UI polish — making the popup or sidebar look decent
- Edge cases — what happens with no data, too much data, network errors
- Settings/options — user preferences, toggle features
For each feature, I describe what I want in Cursor's AI chat, review the suggested code, modify what doesn't fit, and test. The key discipline: never let AI write more than one feature without testing. I learned this the hard way — letting AI generate three features at once created a debugging nightmare where errors cascaded across components.
Step 5: Testing and Debugging (1-2 Hours)
Testing Chrome extensions is awkward. There's no nice test runner that simulates the Chrome environment perfectly. Here's my actual approach:
- Manual testing in Chrome with the extension loaded unpacked
- Console logging extensively (then removing before submission)
- Edge case testing: What happens on about:blank? On Chrome's internal pages? With no internet?
- Permission testing: Does the extension request more permissions than it needs? Google will reject bloated permission requests.
When I hit bugs, I paste the error + relevant code into Claude or ChatGPT. For visual bugs, I take a screenshot and describe what's wrong. AI is remarkably good at spotting CSS issues in extension popups.
Step 6: Polish and Package (1-2 Hours)
Before submission, I go through a checklist:
- Icons: You need 16x16, 32x32, 48x48, and 128x128 PNG icons
- Screenshots: At least one 1280x800 screenshot for the store listing
- Description: Write a compelling store description (AI can help here, but edit heavily)
- Privacy policy: Required if you handle any user data — I host mine on NexaSphere
- Permissions justification: Google requires you to explain why you need each permission
I use AI to draft the store description and privacy policy, then edit them myself. Raw AI output gets rejected by savvy users who read store listings — it needs a human touch.
Step 7: Submit to Chrome Web Store (30 Minutes)
The actual submission is straightforward but has gotchas:
- You need a Chrome Web Store developer account ($5 one-time fee)
- Upload the ZIP of your extension folder
- Fill in the listing details, category, and language
- Submit for review
Review typically takes 1-3 business days. The most common rejection reasons I've hit:
- Excessive permissions: Only request what you actually use
- Missing privacy policy: Required for extensions using
storage,tabs, or any data-related API - Vague description: "This extension uses AI" isn't enough — be specific about functionality
For a deeper dive into the technical fundamentals, read my guide on building a Chrome extension from scratch.
Real Lessons from Shipping 11 Extensions
Three things bit me repeatedly across all 11 builds:
Manifest V3 Quirks Are Real
The service worker in MV3 is not a persistent background page. It terminates when idle. If your extension relies on maintaining state in memory, you'll get burned. Use chrome.storage for anything that needs to survive a service worker restart. Every single one of my extensions learned this lesson.
AI Hallucinates Chrome APIs
Claude and ChatGPT will occasionally reference Chrome API methods that don't exist, or use MV2 syntax in an MV3 context. Always verify API calls against the official Chrome Extensions documentation. I've wasted hours debugging code that called imaginary methods.
Start Smaller Than You Think
My most successful extension, AI Chat Organizer, started with exactly one feature: organizing ChatGPT conversations into folders. Not AI-powered summarization, not cross-platform sync, not team collaboration. Just folders. One feature, done well.
Same pattern with Screenshot Beautifier, CommunitySpark, ADHDFlow, TimeValue Calculator. Every extension I built that tried to do too much on v1 either took three times longer or shipped with bugs. AI makes it tempting to build everything because "it's so easy to generate code." Fight that urge hard.
Your Extension Idea Might Be a Business
Chrome extensions aren't just side projects. Some of my extensions have clear monetization paths. If you're curious about the business side, I wrote about how to make money with Chrome extensions and specific monetization strategies for extension developers.
Common Mistakes (and How to Avoid Them)
The biggest one: letting AI generate the entire extension at once. I did this with my second extension and spent more time debugging cascading errors than I would've spent building it feature-by-feature. Break it into steps. Scaffold first, then one feature at a time. Test between each one.
The manifest.json is another trap. It looks like a simple config file, but it's everything. Wrong permissions mean instant rejection from Google. Missing host_permissions means your content script silently won't inject, and you'll waste an hour wondering why your document.querySelector returns null. Get the manifest right first, before you write any real code.
Testing only on one site will burn you too. Your content script works on google.com? Great. Does it work on sites with strict Content Security Policy headers? On SPAs that dynamically load content? On pages with iframes? I had an extension that worked perfectly on every site I tested except the one site my first user tried. Test broadly.
And please, don't copy AI-generated code you can't explain. Chrome extensions run in users' browsers with elevated permissions. If you ship code you don't understand, you're shipping a potential security vulnerability. Read every line.
Last: don't skip the store listing. A great extension with a bad listing gets zero installs. Your title, description, and screenshots are doing the selling. Spend real time on them.
FAQ
Can a complete beginner build a Chrome extension with AI?
Yes, but set realistic expectations. If you've never written JavaScript, AI will help you get a working extension, but you'll struggle to debug issues when they come up. I'd recommend learning basic JavaScript and HTML first. Even a weekend crash course gives you enough to follow along. The AI handles the Chrome-specific complexity, but you need fundamentals.
Which AI tool is best for building Chrome extensions?
Cursor, and it's not close for the actual building phase. Claude is better for the initial planning conversation, but once you're in code, Cursor's project-context awareness saves you from constantly re-explaining your architecture. I only open ChatGPT when I'm too lazy to look something up in Chrome's docs.
How long does it take to build a Chrome extension with AI?
For a simple extension (popup with basic functionality), 4-8 hours from start to Chrome Web Store submission. For a complex one (content scripts, background processing, settings page), 2-4 days. My first extension without AI took me two weekends. Now I can ship something similar in a day. Call that whatever percentage you want.
Is Manifest V3 required now?
Yes. Google has been phasing out Manifest V2 since 2024, and new submissions must use MV3. If you find tutorials referencing MV2 concepts like persistent background pages, they're outdated. Make sure your AI tool generates MV3-compatible code — explicitly state "Manifest V3" in your prompts.
Do I need to know React or TypeScript for Chrome extensions?
No. Vanilla JavaScript, HTML, and CSS work perfectly fine. Several of my extensions use no framework at all. Frameworks add complexity that often isn't necessary for extensions. That said, if you're building a complex popup UI, React or Svelte can help — just be mindful of the bundle size.
Start Building This Weekend
Here's my challenge to you: pick one small problem you face in your browser every day. Maybe it's cluttered tabs, maybe it's repetitive data entry on a specific site, maybe it's a formatting task you do manually.
Open Claude, describe that problem and what a Chrome extension solution would look like. Get an architecture back. Open Cursor, scaffold the project. Load it in Chrome. Build one feature. Test it.
You'll have a working Chrome extension by Sunday evening. I know because I've done this process 11 times now, and it works every single time.
Shameless plug: I write about this stuff regularly on NexaSphere. It's my site. If this was useful, there's more where it came from.
My DMs are open if you get stuck on manifest permissions. That's the wall everyone hits first. I'll probably be building extension #12 this weekend anyway.
Related from NexaSphere: Building API integrations? API Dash is a REST and GraphQL client that lives inside Chrome DevTools. Free.
Get more insights like this
Join our newsletter for weekly deep dives on AI tools, Chrome extensions, and software engineering.