360 Secure SkillHub
360 安全技能中心

openclaw context usage

核心功能是查询当前会话的上下文窗口使用情况,调用session_status获取数据后,整理为包含模型名称、token已用/总量及占比、缓存命中率、使用状态(分四档)的结构化结果。典型场景为用户询问上下文窗口、token用量、剩余空间等问题时,输出标准化格式摘要,高占比时推荐/compact命令优化。

goog
goog
热度 47.76
最近更新 2026-05-11 17:36:45
分类:效率依赖:MCP 服务应用场景:摘要总结 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add context-usage
Metadata
name
ctx-usage
description
Check current session's context window usage. Shows model name, estimated token usage, and context window utilization percentage. Use when user asks about context window, token usage, context usage rate, context remaining, "how full is the context", or any question about how much of the model's context is being used.

Context Window Usage

How to Check

  1. Call session_status to get current session info
  2. Extract the 📚 Context: line for usage data
  3. Present a clean summary to the user

Output Format

📊 Context Window
Model: <model_name>
Used: <used> / <total> (<percent>%)
Cache: <cache_hit>% hit · <cached_tokens> cached
Status: 🟢 Comfortable | 🟡 Getting Full | 🔴 Near Limit

Thresholds

Usage Status Action
<50% 🟢 Comfortable No action needed
50-70% 🟡 Getting Full Monitor
70-85% 🟠 Consider compact Suggest /compact
>85% 🔴 Near limit Recommend /compact

Notes

  • session_status provides exact context data via the 📚 Context: field
  • Token counts and cache hit rates are also available
  • If usage is high, suggest running op-helper skill for /compact