pks claude

stable

Launch Claude Code in a devcontainer, inline, or against Foundry and Scaleway models, and analyse your local session transcripts for cost, pace, and quota.

Author: Poul Kjeldager
Usage: pks claude <command> [options]
Category: infrastructure

Examples

$ pks claude

Spawn a devcontainer and attach a Claude Code session

$ pks claude --inline

Run Claude Code in the current shell, no container

$ pks claude usage

Price every billed request from local transcripts

$ pks claude limits --json

Session and week quota as machine-readable JSON

$ pks claude codex --model gpt-5.1-codex

Drive Claude Code from an Azure AI Foundry deployment

$ pks claude backup

Mirror ~/.claude to every registered rsync target

pks claude is the branch of the pks CLI that starts Claude Code sessions and reads what those sessions left behind. It launches the real claude binary — in a devcontainer, in your current shell, or pointed at a non-Anthropic model provider — and it parses your local ~/.claude/projects/**/*.jsonl transcripts into cost, pace, and quota numbers.

Overview

The branch has one default command and eleven named subcommands. Running bare pks claude invokes the default: it spawns a devcontainer for the current project on a local Docker host or a registered remote SSH target, then attaches an interactive claude --dangerously-skip-permissions session over docker exec. Everything else hangs off that.

  • Launchers. The default command, plus codex, scaleway, mistral, qwen, and anthropic — each starts the real Claude Code TUI against a different backend.
  • Local analytics. stats, usage, and limits read files on your own machine. stats and usage never touch the network at all.
  • Utilities. backup mirrors ~/.claude to remote targets; managed-settings renders an enterprise policy file.

What you get

  • Containerized sessions, local or remote. Spawn a devcontainer for the project and attach Claude Code to it. Pass --ssh-target to do the same on a registered remote box, so the agent runs somewhere other than your laptop.
  • Container reuse with a real diff. The default command detects an existing container for the project and compares three hashes — your host .devcontainer, the container's build-time label, and the live volume — then prompts to sync, discard, or resolve the conflict.
  • Model-provider swapping without hand-rolled proxies. codex and the Scaleway family host an in-process proxy on 127.0.0.1 that speaks the Anthropic Messages API inbound and relays to Azure AI Foundry Responses or the OpenAI Chat Completions API that Scaleway exposes.
  • Cost and pace answers on demand. usage prices every deduplicated billed request; limits reports SESSION and WEEK percentages, reset countdowns, and burn ratio as JSON you can poll from cron.
  • A mirror of your Claude state. backup rsyncs the whole ~/.claude directory to every target you registered with pks rsync init.

How it fits together

Think of the branch in two halves that never talk to each other. The launch half always ends in the same place: the real claude CLI running as a child process. What differs is the environment it inherits — a devcontainer with forwarded credentials, your bare shell, or a shell whose ANTHROPIC_BASE_URL points at a proxy pks started moments earlier. That is why every launcher needs claude on your PATH, and why a broken Anthropic login breaks all of them the same way.

The analysis half never launches anything except in one case. stats and usage are pure file readers over ~/.claude/projects/. limits is the exception: there is no file holding your quota, so it spawns a detached tmux session running claude, types /usage, captures the rendered panel, and parses it. That makes limits the only analytics command that costs wall-clock time and, on its fallback path, a real billed request.

Two things at a glance:

  • Launchers need claude, and often Docker, tmux, Foundry, or Scaleway credentials.
  • Analytics need transcripts that already exist, and nothing else.

Commands

stats · usage · limits · session-usage · codex · scaleway · mistral · qwen · anthropic · backup · managed-settings

CommandStatusWhat it does
pks claude (default)stableSpawns a devcontainer locally or over SSH and attaches an interactive Claude Code session. --inline skips the container.
pks claude statsstableActivity heatmap, streaks, token totals, and response-time trends from local transcripts.
pks claude usagestableDeduplicates and prices billed requests; hourly and daily cost charts plus a top-models table.
pks claude limitsstableSESSION and WEEK limit percentages, reset times, and pace, as a table or JSON.
pks claude session-usagestableA second registered name for the identical command class as limits.
pks claude codexbetaClaude Code against a Codex or GPT-5.x deployment on Azure AI Foundry, via a local translating proxy.
pks claude scalewaybetaClaude Code against any model in the Scaleway serverless catalog.
pks claude mistralbetaThe Scaleway launcher narrowed to the Mistral and Devstral family.
pks claude qwenbetaThe Scaleway launcher narrowed to the Qwen family.
pks claude anthropicbetaLaunches claude --model <id> directly against a first-party Anthropic model. No proxy.
pks claude backupstablersync -avz --delete of ~/.claude to every registered rsync target.
pks claude managed-settingsbetaRenders a Claude Code managed-settings.json from registered marketplaces.

There is no literal spawn subcommand name. claude.SetDefaultCommand<ClaudeSpawnCommand>() means bare pks claude [PROJECT_PATH] routes straight into the spawn settings.

Next steps

Subcommands

pks claude backup

stable

Mirror your entire ~/.claude directory to every registered rsync target over SSH, with a per-target results table and an all-or-nothing exit code.

pks claude backup

pks claude codex

beta

Run the Claude Code TUI against a Codex or GPT-5.x deployment on Azure AI Foundry through a local proxy that translates the Anthropic Messages API.

pks claude codex [claudeArgs] [options]

Devcontainer and inline Claude Code sessions

stable

Spawn a devcontainer for your project on Docker or a remote SSH target and attach an interactive Claude Code session to it, or run inline instead.

pks claude [PROJECT_PATH] [options]

pks claude limits

stable

Poll Claude Code session and week usage limits as structured JSON — percentages, reset countdowns, and whether you are pacing ahead of the clock.

pks claude limits [options]

pks claude managed-settings

beta

Render a Claude Code managed-settings.json from your registered plugin marketplaces, to stdout or straight into the OS-level policy location.

pks claude managed-settings [options]

pks claude reference

stable

Complete command, flag, argument, and environment-variable reference for the pks claude branch — spawn, model launchers, analytics, backup, and settings.

pks claude <command> [options]

pks claude scaleway

beta

Run Claude Code against Scaleway-hosted Mistral, Qwen, and other open models, or pick a first-party Anthropic model, through one local proxy.

pks claude scaleway [model] [claudeArgs] [options]

pks claude stats

stable

Render a GitHub-style activity heatmap, streaks, token totals, and response-time trends from your local Claude Code session transcripts.

pks claude stats [options]

pks claude usage

stable

Price every billed Claude Code request from local transcripts, deduplicated and charted hourly and daily, with a top-models-by-cost breakdown.

pks claude usage [PROJECT] [options]