Core concepts

Context window management

Learn how Bob's 270,000-token context window works, how each category contributes to token usage, and best practices for keeping tasks focused and cost-efficient.

Understanding the context window

Each task in the chat panel has a context window, which is the token budget for that conversation thread. The cap is 270,000 tokens. Everything Bob loads counts against it.

What fills the context window

Hover over the token usage indicator in the top-right of the chat panel to see a breakdown of what is consuming your context window:

Context window breakdown panel showing token usage by category
CategoryWhat it includes
System promptBob's core instructions for the session
Tool definitionsBuilt-in tool schemas and connected MCP tool definitions
MCP ToolsInstructions and descriptions for tools provided by connected MCP servers
RulesCustom instructions from project and mode rule files (for example, AGENTS.md or .bob/rules-*)
SkillsInstructions from skills Bob loaded for the conversation
MessagesYour prompts, Bob's replies, and tool activity in the conversation. This is the transcript counted as tokens.

@ mentions, command output, and tool results all count toward Messages. File contents do not appear as a separate line.

Under Estimated breakdown:

  • Reserved for model response: Tokens held back for Bob's next reply (typically 20.0k).
  • Available space: Remaining free tokens.

Baseline overhead

Fixed categories consume tokens before you begin working with Bob. On the Galaxium Travels sample project, even a prompt as short as "Quickly say hi back." totals approximately 8.5k tokens. Most of that is Tool definitions (5.1k), System prompt (1.5k), Rules (830), and Skills (454). Only 590 tokens are in Messages.

Bob re-sends the full overhead stack on every prompt. Adding more MCP servers or loaded skills increases MCP Tools, Tool definitions, and Skills before you type a single word.

For hands-on numbers and a reset walkthrough, see Create a new context window.

Monitoring token usage

The token usage indicator shows the percentage full and a used/total fraction against the 270,000-token cap. Click it to open the context window breakdown. Check which category is growing.

The following table shows what causes each category to grow:

CategoryWhat makes it grow
System promptLoaded when the task starts. Stays flat during normal work.
Tool definitionsBuilt-in tool schemas. Set when the task starts. Stays flat during normal work.
MCP ToolsConnected MCP servers and enabled tools. Grows when you add servers or tools, not when you send prompts.
RulesProject and mode rule files (for example, AGENTS.md). Set when the task opens.
SkillsSkills Bob loads for the task. Can increase if Bob activates a skill mid-thread.
MessagesYour prompts, Bob's replies, file reads, tool output, and @ mentions. Grows with every turn and with repository exploration.

In a short exchange, fixed categories often account for most of the total. When you ask Bob to read files or run tools, Messages typically becomes the largest category. Watch for this shift.

Available space shrinks as any category grows. Reserved for model response is set aside for Bob's next reply and is not part of the used total shown above it.

For measured examples on a real repository, see Create a new context window.

Token limits

The hard cap is 270,000 tokens per task. Bob starts compacting before you reach the limit. Compaction typically begins around 190,000 tokens of total usage.

Automatic context compaction

At the compaction threshold, Bob:

  1. Preserves the most recent and relevant context.
  2. Summarizes or removes older conversation segments.
  3. Maintains critical system instructions, tool definitions, rules, and skills.
  4. Continues with the compacted context.

Compaction is lossy. Details from early in Messages may not survive. Start a new task with + (New task) when you change topics or when Messages is large enough to affect quality.

Impact on Bobcoins

Bobcoins track token usage. Both input and output tokens count.

  • Each message sends the full active context again, including fixed overhead.
  • Bob re-processes everything that is already loaded on every send.
  • Long threads with heavy Messages cost more per later prompt.

Best practices

Note:

The context window is not storage. It is the active token budget available to Bob at each step. Control what goes in. Reset or compact when the thread fills with stale content. Check the result with tests, not just Bob's reply.

Scope the task and the conversation

Use one task per work goal and start with a narrow prompt. State the goal, expected outcome, and constraints before asking Bob to explore the repository. Name files and functions explicitly. Avoid vague requests such as "read the whole repo" or "check the backend." Click + (New task) when the topic changes, because unrelated content in Messages adds cost and can confuse Bob.

Keep standing context lean

Fixed categories consume tokens before you type anything. To keep overhead low:

  • Keep custom rules and AGENTS.md short. Include only setup, test, and style commands (for example, pnpm test, mvn verify).
  • Connect only the MCP servers, tools, and skills the current work needs. Disconnect what you are not using, and prefer project-scoped MCP configuration over global.
  • Reserve Messages for situational evidence specific to this task: the bug, logs, and relevant files. Do not repeat standing rules in every prompt.

Add context when you need it

Let Bob search and read targeted files rather than pasting large blocks of content into the thread. Use context mentions to reference a specific file or line range, and avoid broad directory mentions:

✓ @/src/utils/validation.ts:45-67 Fix the email validation logic
✗ @/src @/tests @/docs Review everything and suggest improvements

You can also highlight text in the editor and use Cmd + L (Mac) or Ctrl + L (Windows/Linux) to add it directly to the chat.

Work in stages: find likely files, inspect the relevant ones, plan, change, and validate. For broad repository reads, use subagents so the task receives compacted results rather than every read_file call landing in Messages. When sources conflict, trust running code and tests over stale comments or outdated README notes.

For more tactics on large repositories, see Working with large projects.

Reset or compact when Messages fills up

Over a long conversation, Messages accumulates repeated file contents, abandoned plans, and stale tool output. Start a new task with + (New task) when the work goal changes or when the thread is large enough to affect quality. Keep constraints, evidence, and open questions. Remove the rest.

Bob also compacts older segments automatically, but compaction is lossy and details from early in Messages may not survive. Prefer small, approved changes over one large autonomous run so diffs stay reviewable and Bob stays on track.

Learn more

See Create a new context window to open the breakdown on the Galaxium Travels sample project and practice a reset.

How is this topic?