K-stack
A Claude-only engineering stack for Claude Code: a rigorous working mode, per-role Haiku/Sonnet/Opus effort routing, focused skills, and daily-driver hooks.
K-stack is my personal Claude Code stack, and the next version of what used to be Claude Agent System (CAS). I merged the parts of CAS I still use every day (Spectre research, the safety hooks, the Codex and Cursor delegation skills) with my global setup (e2e QA through AgentController, notifications, commit guards). I removed the routers and swarm wrappers that current models no longer need. I also brought in the working mode and playbooks from pstack by Lauren Tan (MIT), and rebuilt them around Claude-only Sonnet and Opus routing.
Install
/plugin marketplace add Kasempiternal/K-stack
/plugin install kstack@k-stack
/kstack:k-setup
/kstack:k-mode
k-setup writes a managed kstack-routing block into ~/.claude/CLAUDE.md and asks for a preset. k-mode starts the mode.
How it works
- The lead is Opus 5.5 at High. It plans, briefs, reviews diffs, and talks to you. It edits directly only for one-or-two-turn changes.
- Work routes by role, never by model name. A playbook step names a role (
build, explore, review, ...), and the role resolves to a tier agent: one kstack:k-* agent per model/effort pair, since the Agent tool cannot carry effort.
/kstack:k-effort switches the routing level the way /effort switches the session's: lean < balanced < quality, saved as the default, or session for this session only.
- Burn is a deliberate spend-more switch. Say "burn" or name a Max tier and the current task escalates to Opus Max;
/kstack:k-effort burn holds it for the session. It never turns on by itself. Sonnet Max is forbidden and has no tier.
- Haiku work fans out by default. Independent slices go out in one message, at most 8 workers per wave, each returning a capped list of facts. Cheap tokens make splitting the default; the lead's context and file ownership set the limits.
- The loop is design → build → review → fix. Nontrivial changes go through k-design first, every worker diff goes through k-review before landing, and verification happens on the real surface (k-e2e-qa for UI and devices).
- Nothing is done without evidence. Workers paste the command and its outcome; unverifiable claims get labeled, not laundered.
Skills
| Skill | What it does |
|---|
/kstack:k-mode | The mode: playbooks, role routing, evidence discipline |
/kstack:k-setup | Writes the role→tier routing block into ~/.claude/CLAUDE.md |
/kstack:k-effort | Switches the routing level (lean, balanced, quality, up, down, burn), like /effort |
/kstack:k-tokens | Audits local transcripts for token waste and applies a few cache, compaction, subagent-model and effort settings |
/kstack:k-explore | Read-only subsystem explanations and git-history archaeology |
/kstack:k-design | Design before code: data shape, interface, file plan, failure cases |
/kstack:k-agent-time | Prices options in agent time, not human-hours, before an open-ended improvement or before dismissing an option as too big |
/kstack:k-review | Diff review on separate Opus lenses, judged by the lead |
/kstack:k-write | Prose rules for docs, commits, PRs, and replies |
/kstack:k-spectre | Parallel web/codebase research with independent claim validation |
/kstack:k-war-room | A moderated expert panel (mixed Claude tiers, optional external models) that debates in a live chat you watch in the browser, votes, and writes a verdict |
/kstack:k-e2e-qa | UI and device verification: macOS, iOS, Android, web |
/kstack:k-gpt-architect | Optional: delegate to the Codex MCP to spend ChatGPT quota |
/kstack:k-cursor-architect | Optional: delegate to cursor-agent (Grok) to spend Cursor quota |
Balanced routing (default)
| Role | Covers | Tier |
|---|
scan | lookups that return facts: find files and symbols, summarize logs and CI output, triage lists | haiku-high |
mechanical | renames, formatting, boilerplate, small CSS, changelogs | haiku-xhigh |
docs | README, developer docs, docstrings, API docs | sonnet-medium |
build | normal features and UI, simple bugs, tests | sonnet-high |
build-hard | large features, complex state, refactors, hard bugs | sonnet-xhigh |
explore | unfamiliar code, repo-wide search, regression archaeology | opus-medium |
research | web and document research seats (k-spectre) | sonnet-high |
design | architecture, API design, plans, RFCs | opus-high |
review | diff review, simplification, security, claim validation | opus-high |
sweep | final pre-release sweep, stubborn cross-system root cause | opus-xhigh |
Max never appears in a preset; Burn reaches it per task. The full table with Lean and Quality presets lives in kstack/skills/k-mode/references/routing.md.