Skip to content

Instantly share code, notes, and snippets.

@thgaskell
Last active January 20, 2026 00:26
Show Gist options
  • Select an option

  • Save thgaskell/1dd81608834aedddf655e19efd40550d to your computer and use it in GitHub Desktop.

Select an option

Save thgaskell/1dd81608834aedddf655e19efd40550d to your computer and use it in GitHub Desktop.
Purge your Claude Code context window

Purge your Claude Code context window

Claude Code v2.1.12

Removes all system tools from the context window. Not very useful on its own, but it's a good starting point when developing Subagents. This helps to reclaim up to ~17k tokens (~8.5%) from the context window.

Before

> /context
Context Usage
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀   claude-haiku-4-5-20251001 · 19k/200k tokens (10%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 2.8k tokens (1.4%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 16.7k tokens (8.3%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Compact buffer: 3.0k tokens (1.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 178k (88.8%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ ⛀

After

> /context
Context Usage
⛁ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   claude-haiku-4-5-20251001 · 2k/200k tokens (1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 2.1k tokens (1.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Compact buffer: 3.0k tokens (1.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 195k (97.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ ⛀

Tools available to Claude

Source: https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude

Claude Code has access to a set of powerful tools that help it understand and modify your codebase:

Tool Description Permission Required
AskUserQuestion Asks multiple-choice questions to gather requirements or clarify ambiguity No
Bash Executes shell commands in your environment Yes
Edit Makes targeted edits to specific files Yes
ExitPlanMode Prompts the user to exit plan mode and start coding Yes
Glob Finds files based on pattern matching No
Grep Searches for patterns in file contents No
KillShell Kills a running background bash shell by its ID No
MCPSearch Searches for and loads MCP tools when tool search is enabled No
NotebookEdit Modifies Jupyter notebook cells Yes
Read Reads the contents of files No
Skill Executes a skill or slash command within the main conversation Yes
Task Runs a sub-agent to handle complex, multi-step tasks No
TaskOutput Retrieves output from a background task (bash shell or subagent) No
TodoWrite Creates and manages structured task lists No
WebFetch Fetches content from a specified URL Yes
WebSearch Performs web searches with domain filtering Yes
Tools missing from official documentation (generated by Claude)
Tool Description Permission Required
EnterPlanMode Requests permission to enter plan mode for complex tasks requiring exploration and design No
{
"permissions": {
"allow": [],
"deny": [
"Read",
"Write",
"Edit",
"AskUserQuestion",
"Bash",
"TaskOutput",
"EnterPlanMode",
"ExitPlanMode",
"Glob",
"Grep",
"KillShell",
"MCPSearch",
"NotebookEdit",
"Skill",
"Task",
"TodoWrite",
"WebFetch",
"WebSearch"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment