Short answer: Open an empty folder, start Claude Code, and give it a clear brief: what the extension does, which permissions it may use, and what not to add. Load the result in Chrome with Developer mode and "Load unpacked", test it on a few sites, and fix one problem at a time.
Most web pages are noisy. Ads, pop-ups, sidebars, autoplay videos. You came to read one article and you are fighting the page instead.
In this guide you will build a small Chrome extension called Focus Mode. One click on its icon turns a cluttered page into a clean reading view: a narrow column, calm typography, no distractions. You will build it with Claude Code, step by step, even if you have never written an extension before.
The goal is not only a working tool. It is a repeatable way to work with an AI coding assistant: describe the result, let it build, test, and improve one thing at a time.
focus-mode.You don't need to know JavaScript. You do need to read what Claude produces, test it, and describe clearly what is wrong. That is the real skill.
Knowing these pieces helps you give Claude better instructions and understand what it built. Chrome's own Focus Mode tutorial uses the same idea if you want to compare.
Open the empty folder in your terminal, start Claude Code, and paste this brief.
Build a Chrome extension called "Focus Mode" using Manifest V3 in this folder.
What it does: when I click the toolbar icon on any article page, it switches the current tab
into a clean reading view. Clicking again restores the original page.
Requirements:
- Use only the "activeTab" and "scripting" permissions. No host permissions, no access to all sites.
- A background service worker listens for the toolbar click and injects the content script
and stylesheet into the current tab only.
- The content script finds the main article content (prefer the <article> element, then <main>,
then the largest block of paragraph text), hides everything else, and wraps the content
in a centered column.
- Reading styles: max width about 720px, comfortable font size, line height around 1.7,
soft background, high-contrast text, images scaled to the column width.
- Clicking again removes Focus Mode without reloading the page.
- Include simple placeholder icons in 16, 48 and 128 pixels.
- Add a short README with installation steps.
Before writing code, list the files you will create and explain in one line what each does.
Then build it. Do not add features I did not ask for.
chrome://extensions in Chrome.If something fails, the extensions page shows an Errors button for your extension. Copy the error text as it is.
Test on at least five different sites: a news site, a blog, a documentation page, a long-form magazine and a site with heavy ads. Write down what happens on each.
I tested Focus Mode. Here is what happened:
[SITE] | [WHAT YOU EXPECTED] | [WHAT ACTUALLY HAPPENED]
Error from the extensions page, if any: [PASTE ERROR]
Find the cause, explain it in two sentences, and fix only this problem.
Don't change anything that already works. Tell me exactly how to retest.
Common problems and their usual causes:
| Problem | Likely cause |
|---|---|
| Nothing happens on click | The service worker isn't listening, or the action is missing in the manifest |
| The wrong part of the page stays | The article detection picks a sidebar or comments block |
| Text is too wide or tiny | The site's own CSS overrides the reading styles |
| Images overflow | Images need a max-width rule inside the column |
| Doesn't work on some pages | Chrome blocks extensions on its own internal pages and the Web Store, which is expected |
Once the basic version works, improve it in small steps. Pick one:
chrome.storage.Add one feature to Focus Mode: [FEATURE].
Keep the current permissions unless this feature truly needs a new one.
If it does, tell me which permission and why before you add it. Update the README.
Before you share the extension with anyone, ask Claude to review it.
Review this extension before I share it. Check:
- permissions (are any broader than needed?)
- any code that sends page content anywhere
- use of innerHTML with page data
- behavior on pages without an article
- whether toggling off fully restores the page
Return a short list of issues ranked by importance, then fix the top three.
A good rule: an extension should never send what you read to any server unless that is its stated purpose and the user agreed.
To publish on the Chrome Web Store you need a developer account, a short description, screenshots and a privacy statement explaining what data the extension handles. Focus Mode handles none, which makes the review simpler. Check the current Chrome Web Store policies and fees before you submit.
The same method works for almost any small tool: describe the result, set the limits, ask for a plan, test, fix one thing, then add the next.
No, but you need to read what was built, test it carefully and describe problems precisely. Claude Code writes the code; you direct and verify.
activeTab gives temporary access only to the tab where you click the icon. It is safer and makes the extension easier to trust.
Chrome blocks extensions from changing its own internal pages and the Web Store. That is expected behavior.
Yes. Replace the brief with the result you want, keep the permissions minimal, and follow the same test-and-fix loop.
More AI tools and ready prompts at masterphub.io