← Back to Skills Marketplace
tkuehnl

context-engineer

by Todd Kuehnl · GitHub ↗ · v1.0.2
cross-platform ⚠ suspicious
682
Downloads
0
Stars
2
Active Installs
3
Versions
Install in OpenClaw
/install context-engineer
Description
Context window optimizer — analyze, audit, and optimize your agent's context utilization. Know exactly where your tokens go before they're sent.
README (SKILL.md)

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
Usage Guidance
This skill appears to do what it says: it inspects your agent workspace and OpenClaw config and writes analysis snapshots. Before installing or running it: 1) Understand it will read any files you point it at (SKILL.md, MEMORY.md, configs, skills/*/SKILL.md) — do not point it at directories containing secrets you don't want analyzed. 2) Review context.py (or run it in a sandbox) to confirm there are no network/exfiltration calls; the visible code shows only local file I/O and reporting, but the provided context.py snippet in this review was partial, so double-check the full file for network/socket/HTTP usage. 3) When running, avoid using elevated privileges and keep backups of any files you modify; inspect any saved snapshot JSON before sharing, since it may contain extracted text from your workspace. If you want extra assurance, run the script on a copy of your workspace or in an isolated environment first.
Capability Analysis
Type: OpenClaw Skill Name: context-engineer Version: 1.0.2 The skill is classified as suspicious due to a potential arbitrary file read vulnerability. The `context.py` script's `parse_tool_definitions` function attempts to `json.load()` the file specified by the `--config` argument (defaulting to `~/.openclaw/openclaw.json`). While intended for configuration, a malicious prompt could instruct an agent to use `--config` with a sensitive file path (e.g., `/etc/passwd`, `~/.ssh/id_rsa`). Although the script would likely fail to parse non-JSON files, it would still read their content, posing a risk of information disclosure. There is no evidence of intentional malicious behavior like data exfiltration or persistence, but the capability to read arbitrary files via user-controlled input is a significant vulnerability.
Capability Assessment
Purpose & Capability
The skill is described as a context window optimizer and the code and SKILL.md show it scans workspace files (SKILL.md, MEMORY.md, skills/*/SKILL.md, and .openclaw/openclaw.json) and produces token/efficiency reports — the requested binary (python3) and the file reads are appropriate for that purpose.
Instruction Scope
Instructions explicitly tell the agent to run the included Python script against a workspace or OpenClaw config; the script reads many user files under the provided workspace and can write snapshots. This matches the stated scope, but it does mean the skill will examine any files you point it at (which may contain sensitive data).
Install Mechanism
No install spec or third-party downloads are declared; the skill is instruction-only and ships a Python script that runs with the stdlib. No network fetches or external package installs are required according to the metadata and SKILL.md.
Credentials
No environment variables, credentials, or config paths beyond the workspace/config paths are requested. The script reads local workspace and OpenClaw config files only, which is proportionate to a context-auditing tool.
Persistence & Privilege
always is false and the skill does not declare any persistent system-level installation. Its writable actions are limited to saving snapshots/files you explicitly name; it does not request to modify other skills or global agent settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-engineer
  3. After installation, invoke the skill by name or use /context-engineer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
Rebrand to Anvil AI. Remove CacheForge marketing copy. Normalize install commands.
v1.0.1
Fix: box-drawing row alignment off-by-one
v1.0.0
Initial release: context window optimizer with analyze, audit-tools, report, and compare commands
Metadata
Slug context-engineer
Version 1.0.2
License
All-time Installs 2
Active Installs 2
Total Versions 3
Frequently Asked Questions

What is context-engineer?

Context window optimizer — analyze, audit, and optimize your agent's context utilization. Know exactly where your tokens go before they're sent. It is an AI Agent Skill for Claude Code / OpenClaw, with 682 downloads so far.

How do I install context-engineer?

Run "/install context-engineer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is context-engineer free?

Yes, context-engineer is completely free (open-source). You can download, install and use it at no cost.

Which platforms does context-engineer support?

context-engineer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created context-engineer?

It is built and maintained by Todd Kuehnl (@tkuehnl); the current version is v1.0.2.

💬 Comments