SuperMarioYL

Tokensched — Development skill for Claude Code

Development community

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)

Hero diagram

tokensched

**在任务树运行前分配 token 预算。**

TokenSched 将声明的任务树转换为预算分配,并与朴素最高档位模拟进行比较。

为什么需要它

预估任务需求超过固定预算时,一些工作需要降档或等待。显式分配可以在调用框架消费 token 前展示这些选择。

  • 执行前预算 — 模型调用前即可检查预期需求。
  • 解释档位选择 — 每个任务获得明确分配动作。
  • 导出决策 — JSON 可供外部编排器使用。

架构

Architecture diagram

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