Scan Report
22 /100
token-optimizer
AI agent session token optimization skill - compresses conversation tokens from 100k+ to under 8000 using three-layer indexing and AI-powered summarization
Token optimization skill for AI agent conversations with legitimate credential access for compression API calls and one dangerous documentation command that should be fixed.
Safe to install
Fix the dangerous shell command in INSTALL.md line 129 (quote the tilde). The credential access is legitimate but should be clearly declared in SKILL.md.
Findings 3 items
| Severity | Finding | Location |
|---|---|---|
| Medium | Dangerous rm command in documentation Doc Mismatch | INSTALL.md:129 |
| Low | Undeclared credential access Doc Mismatch | scripts/compress_session.py:47 |
| Low | Undeclared environment variable access Doc Mismatch | SKILL.md |
| Resource | Declared | Inferred | Status | Evidence |
|---|---|---|---|---|
| Filesystem | NONE | WRITE | ✓ Aligned | compress_session.py:52 - reads ~/.openclaw/config.json; creates/manages files in… |
| Network | NONE | READ | ✓ Aligned | compress_session.py:144 - calls OpenAI API with extracted credentials |
| Environment | NONE | READ | ✗ Violation | session_guard.py:16, compress_session.py:63-69 - reads TOKEN_OPTIMIZER_* env var… |
| Shell | NONE | NONE | — | No shell execution found in code |
1 Critical 8 findings
Critical Dangerous Command 危险 Shell 命令
rm -rf ~ INSTALL.md:129 Medium External URL 外部 URL
https://keepachangelog.com/en/1.0.0/ CHANGELOG.md:5 Medium External URL 外部 URL
https://semver.org/spec/v2.0.0.html CHANGELOG.md:6 Medium External URL 外部 URL
https://img.shields.io/badge/License-MIT-yellow.svg README.md:5 Medium External URL 外部 URL
https://opensource.org/licenses/MIT README.md:5 Medium External URL 外部 URL
https://img.shields.io/badge/python-3.8+-blue.svg README.md:6 Medium External URL 外部 URL
https://www.python.org/downloads/ README.md:6 Medium External URL 外部 URL
https://clawhub.com/skills/token-optimizer README.md:241 File Tree
15 files · 54.9 KB · 1846 lines Python 8f · 1127L
Markdown 5f · 702L
JSON 1f · 16L
Text 1f · 1L
├─
▾
scripts
│ ├─
compress_session.py
Python
│ ├─
new_session.py
Python
│ ├─
session_guard.py
Python
│ └─
status.py
Python
├─
▾
tests
│ ├─
▾
fixtures
│ │ └─
README.md
Markdown
│ ├─
__init__.py
Python
│ ├─
test_compress.py
Python
│ ├─
test_config.py
Python
│ └─
test_session_guard.py
Python
├─
_meta.json
JSON
├─
CHANGELOG.md
Markdown
├─
INSTALL.md
Markdown
├─
README.md
Markdown
├─
requirements.txt
Text
└─
SKILL.md
Markdown
Dependencies 1 items
| Package | Version | Source | Known Vulns | Notes |
|---|---|---|---|---|
openai | >=1.0.0 | pip | No | Version specified but not pinned to exact version |
Security Positives
✓ No shell execution found in Python scripts - only documentation contains shell commands
✓ No base64 encoding or obfuscation detected
✓ No credential exfiltration - API keys are used locally for compression only
✓ No access to sensitive paths like ~/.ssh, ~/.aws, or .env files
✓ Clean codebase with proper error handling
✓ Includes file permission checks for config files
✓ Uses exponential backoff for API rate limits