diff --git a/SETUP.md b/SETUP.md index b133b6a8..c8194731 100644 --- a/SETUP.md +++ b/SETUP.md @@ -81,6 +81,21 @@ the `Quests: ` line), and run it with consent. Codex then asks the user to trust the hooks once through `/hooks`. It keeps the files' other settings and prints what it changed. +## Check agent settings + +[token-max](https://github.com/kixel-ai/token-max) reads the user's Claude +Code and Codex transcripts and recommends cheaper agent settings. Offer it, and +with consent run it once without installing anything: +`curl -LsSf https://max.kixel.ai/run.sh | sh`, or on native Windows +`irm https://max.kixel.ai/run.ps1 | iex`. Each downloads the latest release, +checks it against the release's checksums, and runs `token-max doctor`. Without +a terminal, as an agent runs it, it only prints its report and exits 1 when it +recommends a change; show the user the recommendations and apply none unasked. +On a terminal, it walks the user through each change and writes settings only +after a final yes. +`quest usage` and the records sender also need `token-max` on the `PATH`; +`cargo install --locked token-max` installs it, globally, so ask first. + ## Opt into worktree hooks Quest can create and reclaim Claude Code's worktrees, sharing one disk budget diff --git a/quest/m0/token-waste/README.md b/quest/m0/token-waste/README.md index 6146002c..20152d3b 100644 --- a/quest/m0/token-waste/README.md +++ b/quest/m0/token-waste/README.md @@ -1,4 +1,4 @@ -# Cut agent token waste +# [S] Cut agent token waste ## Goal diff --git a/quest/m0/token-waste/token-max.md b/quest/m0/token-waste/token-max.md deleted file mode 100644 index f9b9f662..00000000 --- a/quest/m0/token-waste/token-max.md +++ /dev/null @@ -1,43 +0,0 @@ -# [XS] Point to token-max - -## Goal - -Quest's `SETUP.md` recommends [token-max](https://github.com/kixel-ai/token-max) -for checking agent settings, and this epic's closing re-measure runs it -beside `quest usage`. - -## Plan - -Decided 2026-11-05 (user, /quest-plan, -[moq-dev/quest#513](https://github.com/moq-dev/quest/pull/513)): the settings -doctor first planned as `quest doctor` is a standalone CLI with no -quest wrapper. Its plan, survey, and checks moved to kixel-ai/token-max's -own quest tree ([kixel-ai/token-max#1](https://github.com/kixel-ai/token-max/pull/1)), -so this quest keeps only quest's side. - -Amended 2026-11-12 (maintainer, /quest-plan, -[moq-dev/quest#677](https://github.com/moq-dev/quest/pull/677), superseding -the text of [moq-dev/quest#670](https://github.com/moq-dev/quest/pull/670)): token-max -moved to the kixel-ai organization -([kixel-ai/token-max#83](https://github.com/kixel-ai/token-max/pull/83)) and -was rewritten in Rust on 2026-11-08 and ships its crate on crates.io and -prebuilt binaries with checksums on GitHub Releases, rejecting npm, which -supersedes the 2026-11-06 npm plan. Point `SETUP.md` at the run-once lines -its install site serves: `curl -LsSf https://max.kixel.ai/run.sh | sh`, and on Windows -`irm https://max.kixel.ai/run.ps1 | iex`. Neither needs a Rust toolchain or -a quest wrapper, and each verifies the binary it downloads against the -release's checksums, as quest's own Windows install does. Still ✅ no npm -package now that the `@kixel` npm scope exists (rejected: cargo-dist's npm -installer for `npx @kixel/token-max`, which adds a release channel and a -GitHub-hosted publish job that `run.ps1` makes unnecessary). - -Cleared 2026-11-18: token-max shipped 0.0.1 rather than 0.1.0 (its own m0 -decision, 2026-11-14). `curl -fsS -A quest https://crates.io/api/v1/crates/token-max/0.0.1` -names `https://github.com/kixel-ai/token-max` as its repository, the -[v0.0.1 release](https://github.com/kixel-ai/token-max/releases/tag/v0.0.1) -lists Linux, macOS and Windows archives with checksums, and -`https://max.kixel.ai/run.sh` and `run.ps1` are scripts that download the -latest release and check it against its checksums before running -`token-max doctor`. The `cargo install --git` hints in `src/cli/send.ts` and -`src/cli/usage.ts` can now name the published crate: -`cargo install --locked token-max`. diff --git a/src/cli/send.ts b/src/cli/send.ts index 0b241e48..77bd15d4 100644 --- a/src/cli/send.ts +++ b/src/cli/send.ts @@ -374,7 +374,7 @@ async function sendOnce(deps: SendDependencies, dir: string): Promise { const exported = deps.sessions(new Date(since)); if (exported === null) throw new Error( - "token-max is not installed, so no record can be priced; install it with `cargo install --locked --git https://github.com/kixel-ai/token-max`", + "token-max is not installed, so no record can be priced; install it with `cargo install --locked token-max`", ); const { kept } = fold(exported); const byId = new Map(kept.flatMap((s) => (s.id === null ? [] : [[`${s.harness}\0${s.id}`, s] as const]))); diff --git a/src/cli/usage.ts b/src/cli/usage.ts index 766c467d..53993b3a 100644 --- a/src/cli/usage.ts +++ b/src/cli/usage.ts @@ -285,7 +285,7 @@ export interface UsageDependencies extends ClaimDependencies { /** The install hint printed when token-max is missing. */ export const TOKEN_MAX_MISSING = - "token-max is not installed, so no session tokens or cost are reported; install it with `cargo install --locked --git https://github.com/kixel-ai/token-max`"; + "token-max is not installed, so no session tokens or cost are reported; install it with `cargo install --locked token-max`"; /** The local date `days` before `now`, as `YYYY-MM-DD`. */ export function daysBefore(now: Date, days: number): string {