{"slug": "i-started-using-clear-after-testing-with-playwright-mcp", "title": "I Started Using /clear After Testing with Playwright MCP", "summary": "A developer found that accumulated context from Playwright MCP browser-testing sessions was a major driver of Claude Code usage, with /usage showing 79% of consumption at over 150k context and 36% tied to the playwright MCP server. The engineer adopted a simple rule: run /clear after finishing a Playwright MCP test when the browser context is not needed for the next task, since stale context continues to be processed even after it stops being useful.", "body_md": "`/clear`.\nRecently, I hit the usage credits limit in Claude Code, which I use at work.\n\nWhat confused me was that my plan usage still had plenty of room, while the additional usage credits I had configured had already reached their limit.\n\nAfter looking into it, I realized that Fable usage was what had caused me to go beyond the included usage and consume additional credits.\n\nThat explained why the credits had run out.\n\nBut it also made me ask a different question:\n\nWhy was I consuming so much usage in the first place?\n\nUntil then, I had been using Claude Code every day without paying much attention to what was actually driving my usage.\n\nSo I started looking more closely at `/usage` and reviewing how I had been working.\n\nOne thing that stood out was Playwright MCP.\n\nThat did not mean Playwright MCP itself was the reason I had exceeded my usage limit.\n\nRather, it made me notice how much context could accumulate during browser testing, and how that context could continue to affect subsequent work if I kept using the same session.\n\nThe habit I eventually changed was very simple:\n\n**After finishing a test with Playwright MCP, if I do not need that context for the next task, I use `/clear`.**\n\nThis article is a short learning log about how I got there.\n\nI used to think about Claude Code usage in a fairly simple way:\n\nThe more questions I ask, the more expensive it gets.\n\nThat is not entirely wrong.\n\nBut the size of the context Claude is working with also matters.\n\nClaude Code is not looking only at the latest sentence I type.\n\nIt works with the context needed for the current task, including previous conversation history, files it has read, and tool results.\n\nSo, if I simplify my understanding quite a bit:\n\n**The larger the context is, the heavier it can become to keep processing within that context.**\n\n`/usage` Made Me Look at Playwright MCP\nWhen I checked `/usage`, I saw results like these:\n\n```\n79% of your usage was at >150k context\n\n61% of your usage came from subagent-heavy sessions\n\n36% of your usage came from the MCP server \"playwright\"\n```\n\nAt first, I thought these were three separate problems:\n\nBut after looking at how I had been working, they seemed more connected than I initially thought.\n\nWhen using Playwright MCP for E2E checks, I repeatedly do things like:\n\nFor Claude to understand the browser state, relatively large tool results can be added to the context during these interactions.\n\nEach individual operation may feel like a simple browser check.\n\nBut after repeating them several times, browser-related context can accumulate quickly.\n\nThat part can be considered a necessary cost of testing.\n\nThe more interesting problem for me was what happened afterward.\n\nFrom my perspective, once I reach:\n\nTest complete. Time to move on to the next task.\n\nmuch of the information generated during the Playwright session has already served its purpose.\n\nBut if I continue using the same session, I also continue working with that context.\n\nFor example:\n\nI used to move directly to step 4 without resetting the session.\n\nBut when working on the next feature, I may no longer need all the browser information generated during the previous E2E test.\n\nThere is a gap between:\n\n**“This context is no longer useful to me”**\n\nand:\n\n**“Claude Code is no longer carrying this context.”**\n\nLooking into my usage made me much more aware of that difference.\n\nSo I now follow one simple rule:\n\n**After finishing a Playwright MCP test, if I do not need that context for the next task, I use `/clear`.**\n\nI do not clear the session mechanically after every test.\n\nMy rule is simply:\n\n**Will I need this context for the next task?**\n\nIf not, I clear it.\n\nWhen I first started using Claude Code, I tended to think of context as something that was simply better to have more of.\n\nAnd of course, having the right context is important.\n\nBut after looking into my usage, I started thinking about the cost of keeping context that is no longer useful.\n\nThis feels especially relevant with tools like Playwright MCP, where repeated browser interactions can add a lot of information to the session in a relatively short period of time.\n\nAnd once the test is finished, that information may no longer be useful for the next task.\n\nThis experience made me start thinking of Claude Code context as having a kind of lifecycle:\n\nCollect it when needed.\n\nKeep it while it is useful.\n\nLet it go when its job is done.\n\nFor now, that is the rule I am following.", "url": "https://wpnews.pro/news/i-started-using-clear-after-testing-with-playwright-mcp", "canonical_source": "https://dev.to/tohru_yaginuma_4f041533c6/i-started-using-clear-after-testing-with-playwright-mcp-5ggk", "published_at": "2026-09-11 23:07:45+00:00", "updated_at": "2026-09-11 23:52:33.320963+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "mlops"], "entities": ["Claude Code", "Playwright MCP", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/i-started-using-clear-after-testing-with-playwright-mcp", "markdown": "https://wpnews.pro/news/i-started-using-clear-after-testing-with-playwright-mcp.md", "text": "https://wpnews.pro/news/i-started-using-clear-after-testing-with-playwright-mcp.txt", "jsonld": "https://wpnews.pro/news/i-started-using-clear-after-testing-with-playwright-mcp.jsonld"}}