LLM Token Optimizer - Reduce AI API costs by 60-90%. Compresses CLI outputs (git, docker, kubectl) before sending to GPT-4/Claude. AI auto-learning included. By Buba Draugelis 🇱🇹
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install oktk或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install oktk⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/oktk/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: oktk version: 2.4.0 description: LLM Token Optimizer - Reduce AI API costs by 60-90%. Compresses CLI outputs (git, docker, kubectl) before sending to GPT-4/Claude. AI auto-learning included. By Buba Draugelis 🇱🇹 author: Buba Draugelis license: MIT homepage: https://github.com/satnamra/openclaw-workspace/tree/main/skills/oktk tags: - optimization - tokens - cost-savings - cli - filtering - llm requires: bins: - node openclaw: emoji: 🔪 category: optimization ---
When you run commands through an AI assistant, the full output goes into the LLM context:
$ git status
# Returns 60+ lines, ~800 tokens
# Your AI reads ALL of it, you pay for ALL of it
Every token costs money. Verbose outputs waste your context window.
oktk sits between your commands and the LLM, compressing outputs intelligently:
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Command │ ──► │ oktk │ ──► │ LLM │
│ (800 tk) │ │ compress │ │ (80 tk) │
└──────────┘ └──────────┘ └──────────┘
│
90% SAVED
Automatically when you run supported commands through OpenClaw:
| Command | What oktk does | Savings | |---------|----------------|:-------:| | git status | Shows only: branch, ahead/behind, file counts | 90% | | git log | One line per commit: hash + message + author | 85% | | git diff | Summary: X files, +Y/-Z lines, file list | 80% | | npm test | Just: ✅ passed or ❌ failed + count | 98% | | ls -la | Groups by type, shows sizes, skips details | 83% | | curl | Status code + key headers + truncated body | 97% | | grep | Match count + first N matches | 80% | | docker ps | Container list: name, image, status | 85% | | docker logs | Last N lines + error count | 90% | | kubectl get pods | Pod status summary with counts | 85% | | kubectl logs | Last N lines + error/warning counts | 90% | | Any command | AI learns patterns automatically (optional) | ~70% |
On branch main
Your branch is ahead of 'origin/main' by 3 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/components/Button.jsx
modified: src/components/Header.jsx
modified: src/utils/format.js
modified: src/utils/validate.js
modified: package.json
modified: package-lock.json
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/components/Footer.jsx
src/components/Sidebar.jsx
tests/Button.test.js
no changes added to commit (use "git add" and/or "git commit -a")
📍 main
↑ Ahead 3 commits
✏️ Modified: 6
❓ Untracked: 3
Same information. 90% fewer tokens. Same cost savings.
oktk never breaks your workflow:
Try specialized filter
↓ fails?
Try basic filter
↓ fails?
Return raw output (same as without oktk)
Worst case: You get normal output Best case: 90% token savings
After installation, oktk is available globally:
# Pipe any command through oktk
git status | oktk git status
docker ps | oktk docker ps
kubectl get pods | oktk kubectl get pods
# See your total savings
oktk --stats
# Bypass filter (get raw)
oktk --raw git status
Source the aliases file for automatic filtering:
# Add to ~/.zshrc or ~/.bashrc
source ~/.openclaw/workspace/skills/oktk/scripts/oktk-aliases.sh
Then use short aliases:
gst # git status (filtered)
glog # git log (filtered)
dps # docker ps (filtered)
kpods # kubectl get pods (filtered)
# Universal wrapper - filter ANY command
ok git status
ok docker ps -a
ok kubectl describe pod my-pod
When using OpenClaw's exec tool, pipe outputs through oktk:
# In your prompts, ask OpenClaw to:
git status | oktk git status
docker logs container | oktk docker logs
# Or use the 'ok' wrapper (if aliases sourced):
ok git diff HEAD~5
Note: OpenClaw doesn't have a built-in exec output transformer yet. The recommended approach is:
ok wrapper for any command | oktk After 1 week of normal usage:
📊 Token Savings
━━━━━━━━━━━━━━━━
Commands filtered: 1,247
Tokens saved: 456,789 (78%)
💰 At $0.01/1K tokens = $4.57 saved
Already included in OpenClaw workspace, or:
clawhub install oktk
---
Made with ❤️ in Lithuania 🇱🇹
安装 Oktk 后,可以对 AI 说这些话来触发它
Help me get started with Oktk
Explains what Oktk does, walks through the setup, and runs a quick demo based on your current project
Use Oktk to lLM Token Optimizer - Reduce AI API costs by 60-90%
Invokes Oktk with the right parameters and returns the result directly in the conversation
What can I do with Oktk in my developer & devops workflow?
Lists the top use cases for Oktk, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/oktk/ 目录(个人级,所有项目可用),或 .claude/skills/oktk/(项目级)。重启 AI 客户端后,用 /oktk 主动调用,或让 AI 根据上下文自动发现并使用。
Oktk 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Oktk 可免费安装使用。请查阅仓库了解许可证信息。
LLM Token Optimizer - Reduce AI API costs by 60-90%. Compresses CLI outputs (git, docker, kubectl) before sending to GPT-4/Claude. AI auto-learning included. By Buba Draugelis 🇱🇹
Oktk 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Oktk
Identifies repetitive steps in your workflow and sets up Oktk to handle them automatically