Kasempiternal/Claude-Agent-System
Kasempiternal/K-stack · 17 stars · 1 plugin
Marketplace Claude-only engineering stack for Claude Code: a rigorous mode, per-role Sonnet/Opus effort routing, focused skills, and daily-driver hooks.
Install
/plugin marketplace add Kasempiternal/K-stackRun inside Claude Code, then install plugins from it. Check the repo's README before you run it.
Plugins 1
After adding the marketplace, install one with /plugin install <name>@k-stack.
- 1kstackk-mode router + playbooks, per-role Haiku/Sonnet/Opus effort tiers, k-effort level switch, k-tokens audit and token settings, k-spectre research, k-war-room expert panels, k-review, k-e2e-qa, and safety hooks.
/plugin install kstack@k-stack
Files
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: onekstack:k-*agent per model/effort pair, since the Agent tool cannot carry effort. /kstack:k-effortswitches the routing level the way/effortswitches the session's:lean < balanced < quality, saved as the default, orsessionfor 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 burnholds 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.
The routing shape follows Artificial Analysis measurements quoted 2026-09-29: Sonnet 5.5 High→XHigh is the useful coding step (Coding Agent Index 55→63), XHigh→Max gains little at ~4x cost, and Opus 5.5 High beats Sonnet XHigh on intelligence per dollar, so judgment roles (now including exploration) go to Opus and code volume goes to Sonnet. Anthropic's launch pages agree: Sonnet leads Terminal-Bench 4.0 (70.6 vs 66.4) at half the price, Opus leads the hardest code (FrontierCode 54.4 vs Sonnet-at-Max 46.2), so Burn goes to Opus Max. Security-lens reviewers report their model ID because Opus 5.5 silently falls back to Opus 4.8 on most cybersecurity work.
Haiku 5.5 (2026-10-07) costs 20x less than Sonnet per token and scores 38 to 41 on the Intelligence Index at High and XHigh, but trails far behind on agentic coding (Terminal-Bench 4.0: 39.2 vs 70.6). So it takes lookups and mechanical edits under an Opus lead, never feature code or research claims. There is no Haiku Max tier: AA measured a 415s time to first token at Max for 2 more points than XHigh. haiku is Haiku 5.5 only on the Anthropic API; on Bedrock, Google Cloud and Foundry, k-setup writes # haiku: off and those roles run on Sonnet Low.
Hooks
| Hook | Event | What it does |
|---|---|---|
protect-secrets.js |
PreToolUse Read|Edit|Write|Bash |
Asks before touching .env, private keys, credential files, or commands that expose/exfiltrate secrets |
sensitive-command-approval.cjs |
PreToolUse Bash |
Requires approval for rm, git commit, and git push, including through sudo, env, xargs, bash -c, eval, and find -exec |
no-claude-attribution.js |
PreToolUse Bash |
Denies git commit commands containing Co-Authored-By lines |
kill-before-open.js |
PreToolUse Bash |
macOS only. When a command opens a .app, kills the running instance first so you never test a stale build |
notify-session-start.sh |
SessionStart | Records the terminal tab and project so the notifiers below can route |
k-effort.js hook |
SessionStart compact|resume |
Re-injects the session's /kstack:k-effort routing after a compaction or resume |
notify-attention.sh |
Notification | macOS only. Posts a notification on permission and idle prompts |
notify-stop.sh |
Stop | macOS only. Posts a notification when a task finishes |
Requirements
- Claude Code with plugin support, plus
nodeandbashfor the hooks (python3for the notification scripts). - macOS for the notification and kill-before-open hooks; they no-op silently elsewhere.
- Optional, only if you use the matching skill: the
codexMCP for k-gpt-architect,cursor-agentfor k-cursor-architect, AgentController and Maestro for k-e2e-qa.
Migrating from CAS
The old cas plugin is preserved at tag cas-v7.37.0-final. Renamed: spectre → k-spectre, review → k-review, gpt-architect → k-gpt-architect. Removed: cccontrol, cyberconan, faster, gonk-test, hydra, l30, legion, orchestrate, pcc, pcc-opus, phoenix, setup-hooks, setup-swarm, shared, siege, systemcc, zk, the cccontrol-mcp bridge, and the spectra-mcp-server. They were older-model scaffolding now covered natively by Claude Code subagents, effort control, and worktree isolation.
License
MIT. See LICENSE and NOTICE.
{
"name": "k-stack",
"version": "1.4.0",
"description": "Claude-only engineering stack: a rigorous mode with AA-informed Haiku/Sonnet/Opus effort routing, focused skills, and daily-driver hooks.",
"owner": {
"name": "Kasempiternal",
"url": "https://github.com/Kasempiternal"
},
"plugins": [
{
"name": "kstack",
"version": "1.4.0",
"description": "k-mode router + playbooks, per-role Haiku/Sonnet/Opus effort tiers, k-effort level switch, k-tokens audit and token settings, k-spectre research, k-war-room expert panels, k-review, k-e2e-qa, and safety hooks.",
"source": "./kstack"
}
]
}Facts
- Kind
- Marketplace
- Repo
- Kasempiternal/K-stack
- Group
- Uncategorized
- Stars
- 17
- Marketplace name
- k-stack
- Owner
- Kasempiternal
- License
- MIT
- Language
- JavaScript
- Created
- 2025-07-04
- Last push
- 2026-11-10
- Forks
- 4
- Homepage
- kasempiternal.github.io/K-stack
- Topics
- ai-agents, claude, claude-code, code-review, automation, claude-code-plugin, codex, developer-tools, mcp, multi-agent-systems, research, security
- Plugins
- 1