Overview
The/context slash command shows exactly what is occupying the agent’s context window in the current session. It applies the same pre-API transforms — compact boundary, context collapse, and microcompact — so the token count matches what the model actually sees, not the raw conversation history.
Use /context when:
- A session feels sluggish or starts losing earlier details
- You want to verify how much of the window is consumed by tools, skills, memory, or agents
- You need to decide whether to compact, fork, or start a new session
- You are debugging why a long attachment or MCP server is not loaded
Basic usage
In an interactive session, type:What the report shows
The output is split into several sections.Header
- Model — the active main-loop model
- Tokens — estimated tokens currently in context versus the model’s effective window
- Percentage — share of the window consumed
Context strategy
When context collapse is enabled, a one-liner describes the current strategy:<collapsed> placeholders, and that another span is queued for summarization.
Estimated usage by category
Categories include conversation history, system prompt, built-in and MCP tool definitions, custom agents, memory files, skills, and any autocompact or manual compact buffer.
MCP tools
Lists attached Model Context Protocol servers and the token cost of their exposed tools:
Tools that exceed the available budget are marked as deferred and are not sent to the model.
Custom agents
Source can be Project, User, Local, Flag, Policy, Plugin, or Built-in.
Memory files
Skills
Message breakdown
A detailed breakdown of where conversation tokens come from:
Plus top tools and attachments by token cost.
Understanding the colored grid
The interactive visualization divides the context window into squares. Each square is color-coded by category, and partially filled squares indicate categories that do not align cleanly with a single grid cell. Hovering is not required — the legend beneath the grid maps colors to categories and token counts. Colors are stable within a session, so you can run/context multiple times and watch a single category grow or shrink after compactions.
When numbers change
The token estimate updates immediately after:- A message is sent or received
- A tool definition is loaded or deferred
- A skill, agent, or memory file is added or removed
- Context collapse summarizes a span
- Autocompact or manual compact rewrites history
/context uses the same code path as the API request, its total should match the billed input tokens closely. Small differences are expected due to provider-specific tokenization and caching metadata.
Non-interactive output
When running throughgizzi exec, /context returns the same data as markdown instead of Ink graphics:
- Logging context state in CI pipelines
- Comparing token usage across sessions
- Generating reports from headless runs
Related docs
- Headless Execution — run slash commands and prompts without the TUI
- Configuration — set default models, context limits, and autocompact behavior
- Permission Profiles — control tool approval rules that affect context composition