session_context_usage
Monitor how much of the model context window an active opencode chat session uses. Get context_used and context_percent values to trigger conditional instructions.
Instructions
reports how much of the model context window the current opencode chat session is using reads the last message token usage from the opencode database when session_id is omitted the most recently updated active session in the target project is used context_limit overrides the context limit resolved from the models.dev cache use the returned context_used and context_percent values in conditional instructions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | ||
| context_limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||