context-hygiene

Detect topic switches and suggest `/compact` for long-running assistant sessions.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/wongdean/knowledge-base --skill context-hygiene
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-hygiene
Source: https://github.com/wongdean/knowledge-base/tree/main/backups/openclaw-config/20260315_232439/user-skills/context-hygiene
Command: npx skills add https://github.com/wongdean/knowledge-base --skill context-hygiene

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps manage long-running AI assistant conversations by detecting when a user has switched to a new, unrelated task, and suggesting the use of /compact to optimize token usage.

Core Features & Use Cases

  • Topic Switch Detection: Identifies clear boundaries between distinct user goals or projects.
  • Context Management Suggestion: Recommends using /compact to prune irrelevant history when a new, independent task begins.
  • Use Case: In a lengthy debugging session, after the issue is resolved, the user starts planning a new feature. This Skill would suggest /compact to clear the debugging context before proceeding with the new task.

Quick Start

Use the context-hygiene skill to determine if a /compact suggestion is appropriate for the current conversation.

Frequently Asked Questions about context-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage AI conversation context when switching between different projects?

To manage AI conversation context during task switching, this Skill detects clear boundaries between distinct projects and suggests using the `/compact` command to prune irrelevant history and optimize token usage.

When should I use the /compact command in a long-running AI assistant session?

You should use the `/compact` command when a new, independent task begins after a previous objective is resolved, ensuring the next request does not depend on prior conversational state.

What is the best way to optimize token usage for mixed-topic AI assistant conversations?

The best way to optimize token usage for mixed-topic conversations is to trigger context management suggestions only at clear task boundaries, avoiding premature compaction when prior state is still needed.

Does context compaction trigger automatically on every topic switch?

Context compaction does not trigger on every topic switch; it prioritizes high precision by suggesting `/compact` only on clear task boundaries and avoiding suggestions when the next request depends on prior state.

Why does the AI assistant retain debugging history when I start planning a new feature?

The AI assistant retains debugging history because context management is not automatically applied; this Skill specifically suggests pruning that irrelevant history via `/compact` once a clear boundary to a new feature planning task is detected.