ai for designers

/clear Command

The `/clear` command in Claude Code is your hard reset button for the current conversational context. Think of it as opening a brand-new, pristine scratchpad. When you type `/clear`, Claude Code immediately discards the entire active conversation history from its working memory. This means all your previous messages, Claude's responses, intermediate thoughts, and the transient data associated with that specific chat session are gone from the active context. It does not delete the conversation permanently; that history remains archived and accessible via the `/resume` command, acting as a safety net. What `/clear` *does* do is empty the context window, giving you a fresh slate. Crucially, it reloads persistent context elements like your project's `CLAUDE.md` file and any active memory entries from disk. If you use `/clear <name>`, you can even label this new, fresh session for easier recall later. This command is about intentionality: you are telling Claude, "Forget everything we just talked about; we're starting something completely new." It is the fastest, cleanest way to ensure your next task isn't polluted by the remnants of the last.

`/clear` is emphatically *not* `/compact`. Where `/compact` attempts to summarize and condense your existing conversation, preserving a distilled version of its essence, `/clear` simply throws out the active chat history. It does not attempt to intelligently prune, abstract, or retain any part of the previous dialogue. It is not a "smart cleanup" tool; it is a "total wipe" for the current session's chat. Furthermore, `/clear` does not delete your work. Your code files remain untouched. Your project's `CLAUDE.md` and memory files are reloaded, not erased. The previous conversation itself is not destroyed; it is merely moved out of the active context and into an archive, ready to be retrieved with `/resume`. So, it is not a destructive operation in the sense of data loss, but it is a destructive operation for the *active state* of your conversation. It is also not a way to selectively remove parts of the context. If you want to remove a specific file or a particular set of skill definitions, `/clear` is too blunt an instrument. It resets the *entire* chat history, not just specific components within the context window.

Imagine you are a senior product designer at "Quantum Innovations," working on a new feature for their flagship AI assistant, "Aura." For the past three hours, you have been deep in Claude Code, debugging a complex interaction flow for Aura's voice command parsing, specifically around handling ambiguous user input for calendar appointments. You have invoked several skills, read numerous log files, and engaged in a detailed back-and-forth with Claude about regex patterns and error handling. Your context window is now a dense jungle of technical details, API responses, and debugging strategies. The task is complete; the bug is squashed. Now, your next assignment is to brainstorm and prototype new UI elements for Aura's upcoming "Zen Mode," a completely different design challenge focused on minimalist aesthetics and user tranquility. If you were to continue without clearing, Claude would still be steeped in the debugging mindset, potentially trying to apply technical fixes to design problems, or worse, hallucinating solutions based on the previous, irrelevant context. Instead, you type `/clear` into the Claude Code terminal. Immediately, the active conversation history vanishes. The terminal is clean. Your `CLAUDE.md` file, which contains your general design principles for Aura, reloads. Your memory entries about user personas for "Zen Mode" also reload. You then type, "Okay Claude, let's start fresh. We're designing the new Zen Mode UI for Aura. Focus on simplicity, calm, and minimal interaction. What are your initial thoughts on a color palette?" This clear separation of concerns, enabled by `/clear`, ensures Claude's focus is entirely on the new design task, unburdened by the previous debugging session. This is how "Brainy Papers" designers manage their context, ensuring peak performance for each distinct task.

You should default to `/clear` almost always. The Claude Code team, notably @trq212, has repeatedly emphasized this, framing it as a core difference between how internal developers and many community members operate. Think of it as closing one project file before opening another in your IDE. When you finish a distinct task, whether it is debugging a `Python` script, drafting a `TypeScript` component, or brainstorming a marketing tagline for "Brainy Papers," `/clear` is your go-to. It prevents "context rot," where irrelevant information from previous tasks clogs your window, leading to slower responses, higher token costs, and a higher likelihood of Claude hallucinating or misinterpreting your intent. Mubashar, a prominent AI author, echoes this: "default to clear, reach for compact when continuity matters." Use `/clear` when you are switching between unrelated projects, moving from a coding task to a documentation task, or simply want to ensure a completely fresh perspective. It is also the command to use when you have made a mess and want to start over without losing your actual code.

Conversely, you should *not* use `/clear` when you are in the middle of a single, long-running task where the entire conversation history is crucial for continuity. For instance, if you are iteratively refactoring a large `Java` codebase, and each step builds directly on the previous discussion, `/compact` would be the appropriate choice to condense the history while retaining the thread. If you are collaborating with Claude on a multi-day design sprint for "InnovateTech's" new mobile app, and the nuances of yesterday's decisions are vital for today's work, then `/compact` with specific instructions like `/compact keep the UI component library decisions` would be more suitable. Using `/clear` in such a scenario would force you to re-explain or re-establish the entire context, wasting time and tokens. The key distinction is task completion versus task continuity. If the task is done, clear it. If the task is ongoing and requires its history, consider `/compact`.

`/clear` is the ultimate reset button for your AI session, ensuring every new task begins with a clean slate and unpolluted focus.

Related terms

Keep exploring