Problem
When starting a new task via a custom skill (e.g. /my-start-task), you typically want a fresh context window — no leftover tokens from the previous conversation polluting the new session.
Currently, the only way to achieve this is to manually type /clear before invoking the skill. This is a minor but constant friction point in daily workflows, especially for skills designed to be session starters.
Proposed Solution
Allow skills to declare that they need a fresh context. Possible approaches:
Option A — Frontmatter flag
---
name: start-task
clear: true
---
When clear: true is set, Claude Code automatically clears the context window before executing the skill.
Option B — Allow hooks to trigger /clear
Let pre-tool hooks (or a new pre-skill hook type) invoke built-in commands like /clear, so users can wire up their own automation.
Option C — Compound commands
Support chaining built-in commands: /clear && /my-skill arg or /clear | /my-skill arg.
Why This Matters
- Skills like "start a new task" are natural session boundaries — they should start clean
- Having to remember
/clear before every /start adds friction and is easy to forget
- Forgetting leads to bloated context, hallucinations from stale conversation, and wasted tokens
Current Workaround
Two commands instead of one, every single time.
Problem
When starting a new task via a custom skill (e.g.
/my-start-task), you typically want a fresh context window — no leftover tokens from the previous conversation polluting the new session.Currently, the only way to achieve this is to manually type
/clearbefore invoking the skill. This is a minor but constant friction point in daily workflows, especially for skills designed to be session starters.Proposed Solution
Allow skills to declare that they need a fresh context. Possible approaches:
Option A — Frontmatter flag
When
clear: trueis set, Claude Code automatically clears the context window before executing the skill.Option B — Allow hooks to trigger
/clearLet
pre-toolhooks (or a newpre-skillhook type) invoke built-in commands like/clear, so users can wire up their own automation.Option C — Compound commands
Support chaining built-in commands:
/clear && /my-skill argor/clear | /my-skill arg.Why This Matters
/clearbefore every/startadds friction and is easy to forgetCurrent Workaround
Two commands instead of one, every single time.