Context usage shows the amount of context capacity that the current session has used. When the session content approaches the model's context limit, you can free up available space by compressing the context, reducing the likelihood of task interruptions caused by exceeding the context limit.
This topic describes how to view ArkClaw context usage, perform context compression, and handle situations such as a failed compression or an exceeded context limit after switching models.
Context refers to all the content that the AI can see and reference in the current session, including messages sent by the user, ArkClaw's responses, uploaded or referenced files and code snippets, the system prompt, tool call records, and sub-agent outputs. Together, this content forms the scope of information the AI can draw on when generating a response.
Each time a reasoning model processes information, it has a maximum capacity limit, measured in tokens. When the content of the current session exceeds the context window, the model can no longer process new messages. Therefore, you need to free up available space by viewing context usage, compressing the context, or creating a new session.
- Different reasoning models may have different context windows. As a result, the context usage percentage for the same session may change after switching models.
- Context compression cannot be reverted to the full original history. After compression, earlier content is retained in a summarized form.
- If a single input is too long, for example, pasting an extremely long document, multiple images, or a large number of tool results at once, a context limit exceeded prompt may still be triggered. We recommend splitting the content and sending it in batches.
- Switch to the target ArkClaw page. In "My tasks" on the left, select the target session task.
- In the ArkClaw input box, hover the mouse over the
icon to view the details of Context usage. The details show the current usage percentage, the number of used tokens, and the total token limit.
ArkClaw displays different statuses based on context usage to help you determine whether the current session needs handling. In the low-usage stage, no action is usually required. When usage approaches the limit, the interface uses icons and prompts to alert you to the status of the current session. After the threshold is reached, you can manually compress the context.
-
: Context usage is at a low level. You can continue the conversation as normal.
-
: Indicates that the current context usage is approaching the limit. You can hover the mouse over the
icon and click the "Compress context" button in the pop-up dialog box to perform manual compression. If the current session contains too much content, you can create a new session to continue processing the task and avoid interruptions caused by exceeding the context limit.
tip
When the remaining available capacity in the context window falls below 20K tokens, the system automatically triggers the context compression policy, streamlining the historical conversation content to ensure that subsequent multi-turn interactions can proceed normally.
After compression is complete, the session page displays a "Context compression completed" message, along with the token usage before and after this compression. Click the "Compression summary" button to expand and view the historical content that was summarized, including user requirements, key points of focus, the processing content already provided by the AI, and task-related revision suggestions.
Handle compression failures
If the compression is unsuccessful, a "Context compression failed" prompt appears in the pop-up dialog box. You can click the "Retry compression" button to compress again. If you still cannot proceed after retrying, we recommend clicking the "Create session" button to move subsequent tasks to a new session. For extremely long documents, multiple images, or a large number of tool results, we recommend splitting the input content before sending it.
Handle the context limit exceeded after switching models
When you switch models, ArkClaw re-evaluates whether the current session can still accommodate the existing content based on the target model's context capacity. - If the system determines that the content already used exceeds the total capacity of the target model, it displays a "Will exceed limit after switching" prompt to the right of the corresponding model name in the model list, helping you identify the risk before switching.
- If you continue to select this model, the system displays a "Context will exceed the limit after switching models" prompt. The pop-up dialog box asks you to handle the current context first. You can do either of the following:
- Click the "Cancel" button to abandon the model switch and continue using the current model.
- Click the "Compress and switch" button. The system compresses the context first, and then switches to the target model.
Will compression delete my conversation history?
Compression does not delete all of your history directly. The system organizes earlier conversations into a summary while retaining the most recent original messages. You can click the "Compression summary" button to expand and view the summary generated for this compression.
Why is the total token limit I see not a fixed value?
Different models may have different context windows, so the total token limit shown in "Context usage" changes depending on the current model.
When does "Compress context" appear?
When context usage reaches 90% or higher, the interface provides a "Compress context" entry point. You can manually click it to perform compression.
How do I confirm that compression took effect after it completes?
Check the number of tokens freed and the change in usage shown in the "Context compression completed" prompt. If usage drops from a high level, for example from 91% to 20%, this indicates that the compression successfully freed up available context space.
Why do I need to compress the context before switching models?
If the target model's context capacity is smaller than the content already used, switching directly may cause the current session to exceed the limit. After you select "Compress and switch", the system frees up context space first, and then completes the switch.