Skip to main content

Klyra V3.0 — Enterprise Control Plane

Claude Code → Klyra → Anthropic.

Klyra is a local-first optimization and organization control layer for Claude Code.

Install

pip install klyra
klyra start

Then in another terminal:

export ANTHROPIC_BASE_URL="http://127.0.0.1:8787"
claude

(PowerShell: $env:ANTHROPIC_BASE_URL="http://127.0.0.1:8787")

That's it — Claude Code works exactly as before, with Klyra optimizing transparently in between. No config file or account setup required for local use. To go back to unoptimized Claude Code, just unset ANTHROPIC_BASE_URL.

V2.4 focus

This release closes the most important product-readiness gaps discovered during the v2.x review:

  • organization-scoped authentication and session revocation
  • verified machine API-key identity for proxy traffic
  • real policy enforcement and repository-optimization control
  • organization optimization enable/disable switch
  • daily/monthly hard budget enforcement
  • explicit global optimization kill switch
  • outcome attribution separate from usage-verified savings
  • authenticated organization dashboard
  • security, install, API, architecture and rollback documentation
  • pinned runtime dependencies
  • CI regression suite
  • semantic tool-output classification for shell, git, search, file, test, build and package-manager workflows
  • deterministic low-risk tool-noise compaction
  • failure/summary preservation and fail-open tool analysis
  • organization policy control for tool intelligence

Security model

Local development

Loopback proxy traffic (127.0.0.1 / ::1) can use the configured local identity for backwards-compatible Claude Code setup.

Remote deployment

Remote proxy clients must authenticate with:

X-Klyra-API-Key: <organization machine key>

Set:

KLYRA_REQUIRE_PROXY_AUTH=1

Klyra derives organization and user identity from the verified machine key. It does not trust X-Klyra-Org-Id or X-Klyra-User-Id for authenticated remote traffic.

Running from source (development)

py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m klyra start

Then in another terminal:

$env:ANTHROPIC_BASE_URL="http://127.0.0.1:8787"
claude

Configure an owner password:

python -m klyra org-password

Organization dashboard:

http://127.0.0.1:8787/org

Policies and budgets

Organization policy controls:

  • context optimization
  • tool optimization
  • repository optimization
  • prompt caching
  • minimum confidence
  • optimization enabled/disabled
  • daily budget
  • monthly budget
  • hard budget enforcement

Disabling optimization is a transparent-pass-through mode.

Set KLYRA_KILL_SWITCH=1 for an emergency optimization bypass while keeping the proxy available.

Savings accounting

Klyra distinguishes:

  1. optimization candidate
  2. applied optimization
  3. usage-verified/counterfactual dollar saving
  4. task outcome (accepted, reverted, failed, unconfirmed)

Klyra does not treat an estimated optimization as a realized financial saving.

Agent / tool intelligence

Klyra classifies tool results by workflow before optimizing them. Git diffs and file reads are observe-only because semantic loss is too risky. Search and file-discovery results may compact exact duplicate lines. Test, build and package-manager output may compact repeated PASS/progress noise while preserving failures, tracebacks, summaries and unique lines. The engine is deterministic and fail-open.

Set tool_intelligence in the organization policy to disable this analysis independently of ordinary tool optimization.

Repository intelligence

Repository inspection is local-only and fail-open. It can inventory files, Git state, referenced paths, and safe duplicate repository/tool snapshots. Repository source is not uploaded by the optimizer.

Documentation

  • docs/INSTALL.md
  • docs/API.md
  • docs/ARCHITECTURE.md
  • docs/DATA_HANDLING.md
  • docs/ROLLBACK.md
  • SECURITY.md
  • CONTRIBUTING.md

Validation

Current release:

31 passed
Python compilation: PASS
CLI help: PASS

The CI workflow runs the same regression suite on Python 3.11, 3.12 and 3.13.

V2.5 Adaptive Context & Tool Planner

Klyra now infers the current task intent and produces deterministic relevance/preservation decisions for tool results. Failures and summaries remain protected, while only the existing lossless optimizers may mutate eligible noise.

Internal Git + GitHub workspace (V2.6)

Klyra includes organization-scoped Git-style workflows and GitHub integration. See docs_git_layer.md for commands, session querying, branch descriptions, and token handling.

V2.8 Semantic Safety Layer

Klyra adds a conservative structural-semantic redundancy detector for large tool outputs. It normalizes volatile metadata such as timestamps, durations, and counters, then identifies highly similar repeated output blocks. Only safe tool categories are eligible, and blocks containing failures or summaries are protected. This layer is deterministic and does not call an LLM or send source code to a secondary model. Disable it per organization with semantic_optimization: false.

V2.8 Billing-Grade Economics

V2.8 adds canonical Anthropic usage parsing, versioned pricing, separate verified cache and estimated optimization savings, 5-minute/1-hour cache accounting, live telemetry, and non-streaming proxy support. See docs/V2_8_BILLING.md.

Klyra V3.0 — Enterprise Control Plane

V3.0 unifies Klyra's organization boundary, authenticated identity, RBAC, scoped API access, gateway authorization, billing-grade economics, usage analytics and auditability into an enterprise control-plane foundation.

See docs/V3_0_ENTERPRISE_CONTROL_PLANE.md for the architecture and API model.

Download files

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

Source Distribution

klyra-3.0.0.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

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

klyra-3.0.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file klyra-3.0.0.tar.gz.

File metadata

  • Download URL: klyra-3.0.0.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for klyra-3.0.0.tar.gz
Algorithm Hash digest
SHA256 db1ce0d1e4bad7a0242fd5f10b8ce9ed816de416aadd2841e3d71bed6790cb8c
MD5 c2faa4bebffbaad7e90e89ef46cacb23
BLAKE2b-256 bea6e3c08274b2ff27f4210d8b9d74682f8411e38a04b39bf6e71cce5954bf15

See more details on using hashes here.

File details

Details for the file klyra-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: klyra-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for klyra-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f98a7ee30a7870f49d06cbc4c842b550ff091971d98a25269e3927a95a307fa
MD5 0abfd1d97a495ec9160e75f7f1d79f8f
BLAKE2b-256 33740205357987ff7c4fbf09184ad9bbb013acec5ccd9901d596220dbc6c3b33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page