{"id":51406454,"url":"https://github.com/trustos/ccstack","last_synced_at":"2026-07-04T11:30:27.543Z","repository":{"id":366348783,"uuid":"1275955202","full_name":"trustos/ccstack","owner":"trustos","description":"Reversible setup \u0026 config manager for the Claude Code + local OpenCode/MTPLX stack","archived":false,"fork":false,"pushed_at":"2026-06-21T11:14:02.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-21T14:09:10.609Z","etag":null,"topics":["claude-code","config-management","llm","macos","mlx","reversible-config","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trustos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-21T11:04:22.000Z","updated_at":"2026-06-21T11:14:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trustos/ccstack","commit_stats":null,"previous_names":["trustos/ccstack"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/trustos/ccstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustos%2Fccstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustos%2Fccstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustos%2Fccstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustos%2Fccstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trustos","download_url":"https://codeload.github.com/trustos/ccstack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustos%2Fccstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35120680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","config-management","llm","macos","mlx","reversible-config","rust"],"created_at":"2026-07-04T11:30:26.904Z","updated_at":"2026-07-04T11:30:27.524Z","avatar_url":"https://github.com/trustos.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccstack\n\n[![ci](https://github.com/trustos/ccstack/actions/workflows/ci.yml/badge.svg)](https://github.com/trustos/ccstack/actions/workflows/ci.yml)\n\nOne reversible CLI for the **caching/compression** layer of the stack: the **Claude Code** side (attribution-header KV-cache stability, Headroom MCP compression) and the local **OpenCode → MTPLX Router → mtplx** side (an optional Headroom cache hop inserted between the router and mtplx), plus per-session **token / cache / $ / compression** metrics — where **every change is recorded and fully reversible to a clean slate**.\n\n\u003e `opencode.json` itself (the `mtplx` provider, agents, model wiring) is owned by the **MTPLX Router**, which holds the model list natively and writes the canonical mtplx config. ccstack does **not** touch `opencode.json` — it only inserts the cache hop via the router's `compressionProxyURL`.\n\nDesign \u0026 rationale: [`../LocalInference/CCSTACK_DESIGN.md`](../LocalInference/CCSTACK_DESIGN.md). End-to-end runbook: [`../LocalInference/CLAUDE_CODE_HANDOFF.md`](../LocalInference/CLAUDE_CODE_HANDOFF.md).\n\n## Build\n\n```bash\nmake release                 # builds into ./build (gitignored); binary at build/release/ccstack\nmake install                 # then `ccstack` is on PATH (~/.local/bin)\nmake help                    # list all targets\n# the Makefile sets CARGO_TARGET_DIR=build; raw `cargo` users can export it too\n# `brew install rust` if you don't have cargo\n```\n\n## What `apply` manages (all reversible)\n\n| Target | Kind | Purpose |\n|---|---|---|\n| `~/.claude/settings.json` → `env.CLAUDE_CODE_ATTRIBUTION_HEADER=0` | `json_key` | stop the changing billing-header hash from busting KV caches |\n| `~/.claude.json` → `mcpServers.headroom` | `json_key` | register Headroom MCP compression tools at **user scope** — the file Claude Code actually reads for global MCP servers (subscription-safe; no proxy). Atomic write so the live `~/.claude.json` (auth/history) is never half-written |\n| `~/.claude/agents/executor.md` | `file_create` | local-model executor subagent (hybrid) |\n| `~/.claude-code-router/config.json` | `file_create` | hybrid router — **API-key billing only** (breaks a Claude subscription's OAuth); opt in with `api_key_billing = true` |\n| `~/.claude/CLAUDE.md` → `headroom_compress` rule | `text_block` | sentinel-delimited usage rule (subscription MCP is on-demand) |\n| MTPLX Router `config.json` → `compressionProxyURL` | `json_key` | route the router through the Headroom cache hop (when `[opencode_local].headroom = true`) |\n| Headroom proxy launchd agent | `service` | run `headroom proxy` (cache mode) → mtplx, when enabled |\n| `~/.headroom-venv` (Python 3.13) | `pkg_install` | auto-create venv + `pip install headroom-ai[…]` (opt-in removal; needs `brew install python@3.13`) |\n\n## Commands\n\n```\nccstack init                     # write ~/.config/ccstack/ccstack.toml\nccstack plan                     # preview the change set\nccstack apply [--dry-run]        # render config; record every change\nccstack status                   # applied changes + live sync (in-sync|drifted|missing)\nccstack verify                   # ledger vs disk (nonzero exit on drift)\nccstack revert --all | --profile \u003cp\u003e | --change \u003cid\u003e\nccstack uninstall                # clean slate\nccstack stats [--json] [--session \u003cid\u003e]    # per-session + total tokens/cache/$ + compression\nccstack measure begin|end \u003clabel\u003e          # A/B a task\nccstack measure compare \u003cA\u003e \u003cB\u003e            # off vs on, side by side\n```\n\n## Reversibility\n\nEvery change is logged to `~/.config/ccstack/state.json` with the prior value, a file snapshot, and a content hash. `revert`/`uninstall` restore exactly the prior state and **refuse to touch anything you've since edited** (drift is reported, not clobbered). Full-file backups live under `~/.config/ccstack/backups/`.\n\n**Status:** all five change-kinds implemented end-to-end — `json_key`, `file_create`, `text_block`, `service`, `pkg_install` — covering both the Claude Code side and the local OpenCode→MTPLX stack, including **self-bootstrapping the 3.13 Headroom venv** (`pkg_install`) so there's no manual prerequisite beyond `brew install python@3.13`. Builds in CI on macOS. Next: a profile-activation selector and `stats`/`measure` polish.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustos%2Fccstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrustos%2Fccstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustos%2Fccstack/lists"}