Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Cosmos Platform

License Release Python

Keep AI coding agents inside the files you approved — enforced by local hooks, not prompts.

Cosmos is a local safety layer for the coding agent you already use.

  1. The problem. AI coding agents such as Claude Code, Codex, and OpenCode drift out of scope on real tasks. They edit unrelated files, change protected configuration, or claim a test passed without running it once the context fills up. Instructions written in AGENTS.md or CLAUDE.md are not reliable enforcement; they are only suggestions to the model.

  2. What Cosmos does. Cosmos runs on your machine beside your existing agent. It does not replace Claude Code, Codex, or OpenCode, and it does not ask you to switch IDE or route your code through a cloud proxy. Before a task starts, you declare which files the agent is allowed to touch and which command proves the fix worked. Local hooks — small programs your coding tool runs around every tool call — intercept the agent's actions in real time. An out-of-scope edit is blocked before it reaches disk, and the agent is told why so it can stay on track. Before you merge, Cosmos checks the real git diff and the verification output.

  3. Why you can trust it. Enforcement happens in local hooks below the model, so it does not depend on the model choosing to follow instructions. It restrains the agent, not you: your own edits and commands still work. Everything runs on your machine. Cosmos is Apache-2.0 and in Developer Preview.

30-second quickstart

pip install --pre cosmos-platform
cosmos setup
cd your-repo && cosmos init .
cosmos packet contract --id task-1 --mode worker --allow src/auth.py
cosmos packet verify --contract .cosmos/contracts/task-1.json
cosmos status .
Command What it does
pip install --pre cosmos-platform Installs the cosmos command. It changes nothing else.
cosmos setup Connects the hooks to the coding tools installed on this machine. Run it once.
cd your-repo && cosmos init . Creates the .cosmos/ state inside your repository.
cosmos packet contract --id task-1 --mode worker --allow src/auth.py Records one task and the only file it may change.
cosmos packet verify --contract .cosmos/contracts/task-1.json Checks the real diff against that record.
cosmos status . Shows whether Cosmos is active and what it is enforcing.

What you get

Feature What it does
File boundaries The agent can only change the files you named for the task. Everything else is blocked before it hits disk.
Proof before merge Cosmos reads the real git diff and runs the verification command you declared, so "the tests pass" has to be true.
Stuck-agent detection A watchdog notices an agent that is looping or drifting away from the task and tells you.
Continuity Decisions, context, and task state stay with the project, so a new session, a different model, or a different coding tool starts from the same ground truth.
Health checks cosmos status and cosmos doctor report whether the hooks are active and the project state is intact.

Install

Option A: one-line installer (tracks main)

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/cosmos-semantic/cosmos/main/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/cosmos-semantic/cosmos/main/install.ps1 | iex

The installer installs from the main branch of this repository, runs cosmos setup for you, and only reports success after the installed cosmos command has run. If it prints an error, nothing was installed. Set COSMOS_PYTHON to choose a specific interpreter (for example C:\Python312\python.exe).

Option B: PyPI Developer Preview

pip install --pre cosmos-platform
cosmos setup

pip install only installs the cosmos CLI. It does not edit repositories, agent settings, hooks, or MCP configuration. cosmos setup is the one machine-wide activation step: it registers the Cosmos MCP server with Claude Code, OpenCode, and Codex when they are installed, and installs the two local hooks — Guard (file boundaries) and Watchdog (stuck-agent detection). Run it once per machine.

Option C: from a clone

git clone https://github.com/cosmos-semantic/cosmos.git
cd Cosmos

Then run sh install.sh (macOS / Linux) or .\install.ps1 (Windows PowerShell) from inside the clone. This installs your checkout in editable mode and runs cosmos setup.

How it works: once per machine, then per repository

  1. Once per machine: cosmos setup registers Cosmos with the agent tools you have and installs the Guard (file boundaries) and Watchdog (stuck-agent detection) hooks. Every project you open afterwards uses that one registration.
  2. Per repository: the project state attaches on first use, with nothing to run. You can also prepare it explicitly:
    • cosmos init . pre-creates the project state (cosmos.environment.json, .cosmos/graph.json, the first inspection, the retrieval index). It writes no per-project tool configuration and installs no Git hooks.
    • cosmos init . --pin additionally writes project-local configs: .mcp.json, CLAUDE.local.md, opencode.json, .codex/config.toml, .cosmos/CURRENT.md, and .cosmos/AGENT-RULES.md. Use this when you want the project to carry its own connection instead of relying on the global one.
cd /path/to/my-project
cosmos init .
cosmos status

Works with your coding agent

Tool How Cosmos connects
Claude Code Automatic: cosmos setup registers the MCP server and hooks.
OpenCode Automatic: cosmos setup registers the MCP server and watchdog plugin.
Codex Automatic: cosmos setup registers the MCP server; cosmos init --pin can also write .codex/config.toml.
Cursor File-based: point it at the project's AGENTS.md when present and the project state files (cosmos.environment.json, .cosmos/graph.json).
Cline / Roo / VS Code File-based: read the project's AGENTS.md when present, plus the project state files.
Aider File-based: read the project's AGENTS.md when present, plus the project state files.

Repository map

Path What lives there
tools/ The cosmos CLI, hooks, MCP server, merge gate, and supporting tools.
runtime/ The execution runtime and its tests.
docs/ Product, operator, architecture, and governance documentation.
governance/ Policies, decisions, and obligations.
spec/ Interface and contract specifications.
fixtures/ Reference projects for developer, personal, company, and execution-stack use.
catalogs/ Capability and model catalogs.
releases/ Immutable release baselines.
research/ Background research and design notes.

Documentation

License

Cosmos is licensed under the Apache License 2.0. The Community tier is free and open source; trust features such as the merge gate, the vault, the watchdog, and the scorecard are never paywalled.

Metadata

Release files for cosmos-platform 1.6.0.dev6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cosmos-platform 1.6.0.dev6
File Size Uploaded Provenance Actions
cosmos_platform-1.6.0.dev6.tar.gz 2.9 MB With provenance Details for cosmos_platform-1.6.0.dev6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cosmos-platform 1.6.0.dev6
File Interpreter ABI Platform Actions
cosmos_platform-1.6.0.dev6-py3-none-any.whl Python 3 none any Details for cosmos_platform-1.6.0.dev6-py3-none-any.whl

Total release size: 6.0 MB

Release files / cosmos_platform-1.6.0.dev6.tar.gz

Download URL cosmos_platform-1.6.0.dev6.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
848aeecfa043dbd032870e1c2edef5cff277d6c9534cd8b3cb09987039a03030
BLAKE2b-256 checksum
How to use checksums
60f651ef15fad36f717e92080dcd560cc148e5d9395c26e489a36df91a77259c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / cosmos_platform-1.6.0.dev6-py3-none-any.whl

Download URL cosmos_platform-1.6.0.dev6-py3-none-any.whl
Size 3.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
118faaa9e1acf9d2d0857eeef55e1cab5a07e734b28380f85243c717c52858c5
BLAKE2b-256 checksum
How to use checksums
646c72f1fb4b94973a91b4645972519445bcd7da7239e3a4ac56301a7ec1461f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for cosmos-platform 1.6.0.dev6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cosmos_platform-1.6.0.dev6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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