hamzailyas/stillwright/sw-context-diet
Claude Code and agent skill by hamzailyas/stillwright
- community
Checking that the SKILL.md file is still in the repository.
Keeps the agent's context window lean so long work stays sharp and cheap. Moves bulky reading into subagents, saves state to files before compaction, trims loaded skills/tools/memory, and summarizes instead of pasting. Use when a session gets long or slow, before a big multi-file task, when the agent starts forgetting earlier decisions, when tool output is huge, or when the user mentions tokens, cost, context, or "it's getting confused".
Install
npx vskill@latest install hamzailyas/stillwright/sw-context-dietSKILL.md
The same SKILL.md was published earlier as hamzailyas/stillwright/sw-context-diet.
Context diet
sw below is the Stillwright binary. If sw is not on PATH, follow the install note in the stillwright skill (ask the user first; never install unattended).
Quality drops and cost rises as context fills: early decisions get lost and huge outputs crowd out the task. Treat context as the scarcest resource in the run.
Anthropic's own measurements (platform.claude.com, "optimizing for cost"): trimming inputs saves 21–26%, pruning tool results over 2K characters saves 39% on long runs, compacting at 90K instead of 150K tokens cuts cost per request by 70%.
While working
- Delegate reading. Wide searches, long files and logs go to a subagent that returns
only the answer (paths, line numbers, the one relevant excerpt).
- Read narrow. Search first, then read only the lines needed. Don't reread files you
just wrote.
- Cap tool output. Pipe through
head,tail,grep, or--quietflags. Summarize
results in one line instead of carrying them forward.
- Decide once. Write decisions into the run's
plan.mdor log so they survive compaction.
Before context runs out (around 80% full)
- Save state:
sw run log latest event=checkpoint note="<where we are, next step>"and updateplan.md. - Compact or start a fresh session; resume with
sw run status.
Trim what's loaded
Every installed skill, tool and MCP server adds its description to every session. Review what's loaded: keep the ones used weekly, uninstall or disable the rest (they stay findable through sw-scout). Keep memory indexes to one line per entry, details in separate files.
Report
When asked, say in one line where context is going (largest consumers) and what was trimmed.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sw-context-diet/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hamzailyas/stillwright/sw-context-diet)