← 返回
安全合规 中文

context-engineer

Context window optimizer — analyze, audit, and optimize your agent's context utilization. Know exactly where your tokens go before they're sent.
上下文窗口优化器——分析、审计并优化您的智能体上下文利用率。在发送前确切掌握 Token 的去向。
tkuehnl
安全合规 clawhub v1.0.2 1 版本 99908.6 Key: 无需
★ 0
Stars
📥 1,093
下载
💾 10
安装
1
版本
#latest

概述

When to use this skill

Use this skill when the user wants to:

  • Understand where their context window tokens are going
  • Analyze workspace files (SKILL.md, SOUL.md, MEMORY.md, etc.) for bloat
  • Audit tool definitions for redundancy and overhead
  • Get a comprehensive context efficiency report
  • Compare before/after snapshots to measure optimization progress
  • Optimize system prompts for token efficiency

Commands

# Analyze workspace context files — token counts, efficiency scores, recommendations
python3 skills/context-engineer/context.py analyze --workspace ~/.openclaw/workspace

# Analyze with a custom budget and save a snapshot for later comparison
python3 skills/context-engineer/context.py analyze --workspace ~/.openclaw/workspace --budget 128000 --snapshot before.json

# Audit tool definitions for overhead and overlap
python3 skills/context-engineer/context.py audit-tools --config ~/.openclaw/openclaw.json

# Generate a comprehensive context engineering report
python3 skills/context-engineer/context.py report --workspace ~/.openclaw/workspace --format terminal

# Compare two snapshots to see projected token savings
python3 skills/context-engineer/context.py compare --before before.json --after after.json

What It Analyzes

  • System prompt efficiency — Length, redundancy detection, compression potential
  • Tool definition overhead — Count tools, per-tool token cost, identify unused/overlapping
  • Memory file bloat — MEMORY.md size, stale entries, optimization suggestions
  • Skill overhead — Installed skills contributing to context, per-skill token cost
  • Context budget — What % of model context window is consumed by static content vs available for conversation

Options

  • --workspace PATH — Path to workspace directory (default: ~/.openclaw/workspace)
  • --config PATH — Path to OpenClaw config file (default: ~/.openclaw/openclaw.json)
  • --budget N — Context window token budget (default: 200000)
  • --snapshot FILE — Save analysis snapshot to FILE for later comparison
  • --format terminal — Output format (currently: terminal)

Notes

  • Token estimates are approximate (~4 characters per token). For precise counts, use a model-specific tokenizer.
  • No external dependencies required — runs with Python 3 stdlib only.
  • Built by Anvil AI — context engineering experts. https://anvil-ai.io

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 07:10 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,609
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,720
developer-tools

kube-medic

tkuehnl
Kubernetes集群分诊与诊断 — 通过kubectl实现即时AI驱动的事故分诊
★ 3 📥 1,427