Tokensched — Development skill for Claude Code
TokenSched 给 Claude Code 的 token 预算装上了一个 CPU 调度器:它按子任务期望值预分配预算、预测超支,并在 5 小时窗口耗尽前自动把低价值工作降级到 Haiku 或抢占——把硬截断变成可调度的软退让.
How to install Tokensched
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open SuperMarioYL/tokensched and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Tokensched does
TokenSched 给 Claude Code 的 token 预算装上了一个 CPU 调度器:它按子任务期望值预分配预算、预测超支,并在 5 小时窗口耗尽前自动把低价值工作降级到 Haiku 或抢占——把硬截断变成可调度的软退让。
Alternatives in Development
- GenericAgent — Self-evolving agent: grows skill tree from 3.3K-line seed, achieving full system control with 6x less token co 6.1k ★
- Claude Token Efficient — One CLAUDE.md file 3.8k ★
- Crypto Research Haiku Command — Execute lightweight cryptocurrency research by calling only haiku versions of crypto analysis agents in parall 3.4k ★
README
[English](./README.en.md) · [Website](https://tokensched.lei6393.com) · [GitHub](https://github.com/SuperMarioYL/tokensched)
tokensched
**在任务树运行前分配 token 预算。**
TokenSched 将声明的任务树转换为预算分配,并与朴素最高档位模拟进行比较。
为什么需要它
预估任务需求超过固定预算时,一些工作需要降档或等待。显式分配可以在调用框架消费 token 前展示这些选择。
- 执行前预算 — 模型调用前即可检查预期需求。
- 解释档位选择 — 每个任务获得明确分配动作。
- 导出决策 — JSON 可供外部编排器使用。
架构
YAML 加载器生成包含价值、预估 token 和可用档位的任务叶子。贪心分配器按单位 token 价值排序,在剩余预算内安排任务,根据策略降档或抢占。模拟器再与按声明顺序运行的朴素策略比较。
| 组件 | 职责 |
|---|---|
Task tree |
internal/tasktree |
Policy / tiers |
internal/policy; internal/tier |
Greedy allocation |
internal/budget |
Simulation report |
internal/sim; internal/report |
安装与快速上手
使用仓库清单指定的运行时版本构建,并在仓库根目录运行示例。
git clone https://github.com/SuperMarioYL/tokensched.git
cd tokensched
go build ./cmd/tokensched
以 200000-token 预算模拟随仓六任务树,并打印实际分配报告。
python3 examples/presentation-demo.py
实际运行示例
Related Skills
Investigate Performance
Investigate a Nimbalyst performance problem (freeze, lag, idle CPU, slow op, memory growth) with measured evid
Orpheus
Orpheus is an Agent Runtime that solves the 'Silent Failure' of CPU autoscaling. It scales on queue depth, per
Unity Profile
Deep profiling session — captures frames via MCP, analyzes CPU/GPU timing, memory snapshots, rendering stats,
Notchy
Tiny native macOS notch status indicator for Claude Code — 0.1% CPU, 29MB RAM, 180KB binary
Claude Autoshutdown
Shut down Windows only after every Claude Code session and its subagents have really finished. Reads agent tur
Explore 에이전트 시스템 프롬프트
관찰 위치: Claude Code 내부 아키텍처 속도에 최적화된 읽기 전용 코드베이스 검색 전문가입니다. 외부 사용자에게는 Haiku 모델을 사용하고, Anthropic 직원에게는 메인 모델을 상속
Related Agents
Perf Analyst
Use when interpreting a gperftools/pprof CPU profile or proposing optimizations from one. Trigger on "profile
Unity Optimizer
Profiles and optimizes Unity performance. Uses MCP profiler for frame timing, memory snapshots, rendering stat
Application Profiler
Code-level optimization expert with profiling and algorithm optimization expertise. CPU, memory, and algorithm