Show HN: Playwright Skill for Claude Code – Less context than playwright-MCP (github.com)
I got tired of playwright-mcp eating through Claude's 200K token limit, so I built this using the new Claude Skills system. Built it with Claude Code itself.
Instead of sending accessibility tree snapshots on every action, Claude just writes Playwright code and runs it. You get back screenshots and console output. That's it.
314 lines of instructions vs a persistent MCP server. Full API docs only load if Claude needs them.
Same browser automation, way less overhead. Works as a Claude Code plugin or manual install.
Token limit issue: https://github.com/microsoft/playwright-mcp/issues/889
Claude Skills docs: https://docs.claude.com/en/docs/claude-code/skills
19 comments
[ 3.0 ms ] story [ 39.7 ms ] threadEdit: oops that’s what you did too. Yes most MCP shouldn’t be used.
Now I just need to make a skill for using Jira and I can go back to the MCP-free life.
This might be sufficient for an independent contractor or student. It shouldn't be used in a production agent.
1)The examples always seem very generic: "Test Login Functionality, check if search works, etc". Do these actually work well at all once you step outside of the basic smoketest use cases?
2) How to you prevent proprietary data from being read when you are just foisting snapshots over to the AI provider? There's no way I'd be able to use this in any kind of real application where data privacy is a constraint.
Using Claude Code I'll often prompt something like this:
"Start a python -m http.server on port 8003 and then use Playwright Python to exercise this UI, there's a console error when you click the button, click it and then read that error and then fix it and demonstrate the fix"
This works really well even without adding an extra skill.
I think one of the hardest parts of skill development is figuring out what to put in the skill that produces better results than the model acting alone.
Have you tried iteratively testing the skill - building it up part by part and testing along the way to see if the different sections genuinely help improve the model's performance?
Related anecdote: some months ago I tried to coax the Playwright MCP to do a full page screenshot and it couldn't do it. Then I just told Claude Code to write a Playwright JS script to do that and it worked at the first try.
Taking into account all the tools crap that the Playwright MCP puts in your context window and the final result I think this is the way to go.
Recently, I have found myself getting more interested in shell commands than MCPs. There is no need to set it up. Debugging is far easier. And I would be free to use whichever model I like ot use for a specific function. For example, for Playwright, I use GPT-5 just because I have free credits. I could save my Claude Code Quota for more important tasks.
If you're willing to have Claude write code to test a thing you could do a teeny bit more work and make that Playwright script a permanent part of your codebase. Then, the script can run in your CI on every build, and you can keep enhancing it as your product changes so it keeps proving that area of your product works as desired.
Have it run inside a harness that spins up its own server & stack (DB etc.) and boom - you now have an end-to-end test suite!
The issue is for many things playwright is really verbose, by better tailoring outputs and making them more fine grained you’ll get less context bloat and allow the llm to better work with the context. I’m making it open source.