Context windows and tokens: what an agent can see and what it costs
Understand tokens, context window limits and why long tasks can cost more. Learn what to attach, what compaction loses and how to read a task receipt.
🎯 For People using AI agents in editors who want to choose useful context, understand limits and check task costs.
- Understand tokens and context windows
- Follow a concrete token-splitting example
- Recognize overflow and compaction limits
- Choose relevant editor context safely
- Compare task usage with accepted results
A token is a piece of text a model processes, such as a word fragment. A context window limits how much information it can use for a response (context guide, as of 30 Oct 2026). When that capacity runs out, the system may reject the request, stop generating, or shorten the conversation.
What it can do
Understanding context helps you decide what to give an AI agent. For a failing invoice export, start with the error, the export function and the expected output. Ask it to identify any missing dependency before suggesting a change. This gives you a concrete way to check whether the answer rests on the right evidence.
In VS Code, an index locates relevant code without placing the whole workspace into every request. File contents and tool results can enter later prompts (VS Code context concepts, as of 30 Oct 2026).
Keep a short task brief: the goal, constraints, relevant paths and evidence required for acceptance. For related guidance, see rules files and the AI agents explained category.
How tokens are counted, with an example
Tokenization splits text according to a particular vocabulary. Hugging Face illustrates annoyingly as either annoying | ly or annoy | ing | ly: two pieces in the first example and three in the second. The same word therefore need not have the same count across tokenizers (official tokenizer explanation, as of 30 Oct 2026). These are vocabulary examples, not measurements of a Tvijo request.
Count the complete request with the counter appropriate to the selected model, then inspect the returned usage. Counting just the visible question misses other input. Google's documentation distinguishes a count before generation from usage reported afterwards, including input, output and other token categories (token counting guide, as of 30 Oct 2026).
For a practical comparison, keep the question unchanged and remove an irrelevant attachment. Compare the reported input counts. Record what changed rather than converting file size or a word count into an exact token total.
Why long context costs more
With metered API billing, more input at the same rate means a larger input charge. Retained history and tool content can add usage across requests. Input, output and separately billed tools may have different rates; prompt caching can change repeated-input charges (API pricing and tool accounting, as of 30 Oct 2026).
A larger context window does not itself establish a higher per-token rate. Some tariffs depend on prompt length. Check the actual tariff before estimating a task, including any length thresholds.
When investigating a large receipt, ask which attachments were needed, whether history was repeatedly retained, and whether tool output contained unnecessary detail. Compare equivalent tasks and accepted results. The costs and budgets guide explains the difference between a task cap and actual spend.
How to connect it safely
A context window needs no connector. These steps apply when you give an editor assistant access to project context.
- Define the task before attaching files. Write the desired result and the permitted scope. Begin with an explanation or proposed patch that you can review.
- Check the client and account. Confirm which installed extension owns the chat panel and which account it uses. For DSHREM in VS Code, follow the extension installation guide and its explicit sign-in approval flow, as of 30 Oct 2026.
- Attach a narrow, reviewed selection. Remove credentials and unrelated customer data. With Copilot in VS Code, use the context picker or a file reference to identify relevant material (adding context, as of 30 Oct 2026). Other extensions have their own attachment controls.
- Ask for evidence. Request the relevant file location, observed error and proposed verification. Check that the cited material supports the conclusion before applying a change.
- Watch the conversation grow. In supported VS Code agent sessions, inspect the context indicator; compaction can be invoked with
/compact. Save a handoff containing decisions, unresolved questions and source paths before continuing (session management, as of 30 Oct 2026). Check the current documentation for another client. - Review usage and outcome together. Inspect the task receipt, then verify the proposed result independently. More tokens do not constitute acceptance. Read permissions and data flow before widening access.
When this does not work
The request exceeds capacity. Anthropic documents rejection when input alone exceeds the window, and generation stopping at the context boundary in supported cases. Other products can handle overflow differently. Shorten the request or split the work; repeatedly submitting the same oversized material does not address its size (overflow behavior, as of 30 Oct 2026).
A summary loses a condition. VS Code compaction replaces older conversation detail with a summary, which can omit information. Reattach the authoritative requirement when it matters. Keep acceptance criteria outside the chat and compare the next answer against them (compaction explanation, as of 30 Oct 2026).
The answer looks complete but lacks evidence. A large window does not guarantee reliable recall or correct conclusions. Ask for supporting material and verify it. The companion guide on why agents make things up gives a practical review approach.
Where Tvijo fits
As of 30 Oct 2026, Tvijo shows tokens and cost per task on the receipt. Use that record to compare what a task consumed with the result you accepted. A token allowance, a context limit and a spending cap answer different questions; do not substitute one for another.
The DSHREM VS Code extension is an editor entry point for selected context and capped tasks. TvijoCode is a separate editor test build with the extension embedded. Neither label establishes which project content reached a particular request: inspect what you submit.
Tvijo MCP makes Tvijo callable from a compatible MCP client. The published path provides consultation; supplied-diff review is prepared, while publication awaits approval and editor integration and safe delegation remain planned, with separate gates in the dated MCP status. Do not treat connecting it as general editor execution or access to every other MCP service. These are compatibility boundaries, not partnership claims.
The workspace offers, as of 31 Oct 2026, show Try at $0: up to 50 tasks, 100,000 tokens or $0.05 of sponsored usage, whichever is reached first, from a shared $1 daily pool funded by TVIJO. Service credit is shown as $10 and lets you request prepaid credit for metered provider usage plus an 8% service markup. Payment collection is not activated; an order is not a charge.
FAQ
Is a token the same as a word?
No. A tokenizer can keep a word intact or split it into smaller pieces. Use the tokenizer example above to understand why counting words is insufficient.
Does a new chat erase the project?
In VS Code, fresh conversation history does not clear saved files, applicable custom instructions or persistent memory. Review those separately (session documentation, as of 30 Oct 2026).
Does a bigger context window guarantee a better answer?
No. Select relevant evidence, retain the requirements and verify the output. Available capacity is a limit on what can fit, not proof that a task succeeded.
Sources
Source links and observation dates are recorded below. Review status is stated for each material.
- Tokenization algorithms — Hugging Face Transformers
- Understand and count tokens — Google AI for Developers
- Context windows — Claude Platform Docs
- Pricing — Claude Platform Docs
- Understand context in AI agents — Visual Studio Code
- Add context to chat — Visual Studio Code
- Manage agent sessions in VS Code — Visual Studio Code
- Long context — Google AI for Developers
🔗 Article connections
Open the full knowledge graph ↗Published article links. Select a node to open its article at the heading.
Article links · keyboard / text view
Same topic
- An AI incident playbook for a small team: what to do when an agent gets it wrong
- Why AI agents make things up, and how to check an answer before you use it
- AGENTS.md and rules files: set a coding agent’s scope
- AI agents for a small business: five first tasks to automate safely
- Build your own MCP server: a minimal read-only Python tool
- Remote vs local MCP servers: hosting, authorization and which one to pick
Next steps
Related reading
An AI incident playbook for a small team: what to do when an agent gets it wrong
Contain the problem, preserve evidence, notify the right people, verify the fix and decide when an AI agent can safely return to work.
AI agents and MCP explainedWhy AI agents make things up, and how to check an answer before you use it
AI hallucinations can sound convincing. Learn what research rates mean, how to check sources and tool results, and where receipts help without proving correctness.
AI agents and MCP explainedAGENTS.md and rules files: set a coding agent’s scope
Use AGENTS.md, CLAUDE.md and Cursor rules to define coding tasks, understand precedence, and pair written instructions with real access controls.
AI agents and MCP explainedAI agents for a small business: five first tasks to automate safely
Start with inquiry labels, support drafts, meeting actions, catalog checks and weekly summaries. Set permissions, review outputs and measure a bounded Tvijo preview before paying.
💬 Comments