Skip to main content

abstract-claude

Fresh Claude Code session manager: a settings-only template, durable OAuth, automatic quota fallback, and a web console — packaged as one pip-installable CLI.

Install

pip install abstract-claude                 # from your index
# or from the private index:
pip install -i https://<index>/api/pypi/simple/ abstract-claude

Quickstart

abstract-claude init                        # materialize AC_ROOT (config + template)
abstract-claude serve                       # web console (default http://127.0.0.1:9111)
sudo abstract-claude install-service        # install + enable the systemd unit

Commands

Command What it does
serve [--host --port] Run the web console (Model+fallback, OAuth, Template+reset, Session settings).
init Create AC_ROOT with config.json + template/ from shipped defaults.
save-template Capture current ~/.claude/settings.json + minimal flags as the template.
restore Create a fresh ~/.claude (settings + flags) if it doesn't exist.
reset [-y] Wipe ALL Claude state (transcripts/history/creds) → reseed template → clean session.
oauth-status / oauth-set <token> Show / store the durable 1-year claude-auth token.
launch -- <claude args> Launch Claude Code in a brand-new per-session config dir (~/.claude-sessions/<stamp>-<pid>, via CLAUDE_CONFIG_DIR), auto-switching to the fallback model when the default is over quota.
sessions [--prune KEEP] List per-launch session dirs (LIVE/done); --prune removes the oldest finished ones beyond KEEP.
mcp stdio MCP bridge: exposes an abstract_toolserver instance to Claude Code as native tools (TOOLSERVER_URL, default https://toolserver.hugpy.ai).
install-service [--user] Write + enable 9111_abstract_claude_web.service (needs sudo).

Tool-aware sessions (MCP)

abstract-claude mcp discovers a toolserver's /endpoints and serves them to Claude Code over stdio MCP — so the .claude session can call the whole abstract_* tool surface (and /claude/*) through one authed entry point. The template registers it automatically; to add it to an existing install:

claude mcp add -s user toolserver -e TOOLSERVER_URL=https://toolserver.hugpy.ai -- abstract-claude mcp

How it works

  • Template = config only. template/settings.json + a minimal ~/.claude.json (onboarding/trust flags). No credentials, history, or transcripts — a reset gives a genuinely clean session, not a restored snapshot.
  • OAuth is not templated. Login rides on the durable 1-year CLAUDE_CODE_OAUTH_TOKEN (managed by claude-auth), so a fresh session auto-authenticates — no /login.
  • Quota fallback is the wrapper. Claude Code's fallbackModel only fires on overload, never on quota; autoContinueAtUsageLimit doesn't exist before v2.1.234. abstract-claude launch handles the real case: default Fable maxed → run on Opus 4.8.
  • Fresh .claude per launch. Every launch materializes a new config dir from the template (settings + onboarding/trust flags + MCP servers) plus a copy of the freshest login, and hands it to Claude Code as CLAUDE_CONFIG_DIR. No transcripts, history or project trust carry over between sessions; ~/.claude is only the login holder (the refresh-rotated token is synced back to it on each launch). Finished dirs beyond keep_sessions (default 30) are pruned; live ones never are. Opt out per launch with AC_FRESH=0, globally with "fresh_session_per_launch": false in config.json, or by pre-setting CLAUDE_CONFIG_DIR yourself. Embedders (hugpy-station seats/keepers) pass AC_SETTINGS_JSON (a settings.json doc that replaces the template for that session) and AC_SESSION_LABEL (suffix on the dir name). The fresh .claude.json carries the login identity (oauthAccount/userID) from ~/.claude.json, trusts the launch cwd, and gives the toolserver MCP bridge the operator token when resolvable. An explicit --model in the pass-through args is honored as-is (no launcher model, no quota preflight). Wire it up with:
    alias claude='abstract-claude launch --dangerously-skip-permissions'
    

Config

AC_ROOT (default /srv/abstract_claude) holds config.json:

{ "listen_host": "127.0.0.1", "listen_port": 9111,
  "default_model": "claude-fable-5[1m]", "quota_fallback_model": "claude-opus-4-8",
  "preflight_quota_check": true }

Override the data root with AC_ROOT=/path abstract-claude ....

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstract_claude-0.1.25.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstract_claude-0.1.25-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file abstract_claude-0.1.25.tar.gz.

File metadata

  • Download URL: abstract_claude-0.1.25.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for abstract_claude-0.1.25.tar.gz
Algorithm Hash digest
SHA256 d5c040da493ae32c5f4428288c26abae7da7a5a8cc385c60a13d44b97cdaf989
MD5 709bc635b9b4168fd1ee96a644f735d4
BLAKE2b-256 4af8f16541170a1d309dc6259a16681f1a538df11f355955cb84ced4cec4cf7c

See more details on using hashes here.

File details

Details for the file abstract_claude-0.1.25-py3-none-any.whl.

File metadata

File hashes

Hashes for abstract_claude-0.1.25-py3-none-any.whl
Algorithm Hash digest
SHA256 96d4653bfccd1fe6e9c50e1c15535fb5f291a48bfc5036e083aeb3487477ef6e
MD5 48e28df446bd701b186c4bd7afddc511
BLAKE2b-256 ff2103e75a97b1c32da74dbcfcdea5483ef0b5ac5806e8d6c82291edd2385e93

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

This release

0.1.25 This release

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page