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
The command has two forms:

Basic usage

In an interactive session, type:
The TUI renders a grid where each block represents a slice of the context window, color-coded by category. In non-interactive mode, the same command prints a markdown report:

What the report shows

The output is split into several sections.
  • 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:
This tells you that earlier conversation spans were summarized and replaced with <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
Because /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 through gizzi exec, /context returns the same data as markdown instead of Ink graphics:
This is useful for:
  • Logging context state in CI pipelines
  • Comparing token usage across sessions
  • Generating reports from headless runs