Skip to main content

anosys-codex

Python integration for Codex CLI turn-completion telemetry. It reads local rollout transcripts, maps messages and tool calls to AnoSys fields, and reports available token counters and estimated cost.

Requires Python 3.10 or later. This package uses the Codex notify callback; it does not register lifecycle hooks under /hooks.

Install and configure

pip install anosys-codex
anosys-codex install

The installer asks for an ingestion key from an AnoSys Claude Code & Codex CLI (CC) endpoint, content redaction, and permission to update the user-level Codex configuration. It backs up the configuration and writes the ingestion key and redaction choice to $CODEX_HOME/anosys-env.sh. CODEX_HOME defaults to ~/.codex.

For non-interactive setup:

anosys-codex install --api-key "your-cc-endpoint-key" --redaction --auto-update --yes

API-key validation produces a warning on failure; it does not prevent installation. Verify the endpoint key and delivery independently.

Notification command

Version 0.1.1 accepts the JSON argument that Codex appends to the notification command. The registered configuration is:

notify = ["anosys-codex", "run"]

Place notify at the top level of the user-level config.toml, before section headers. If the executable is installed in a virtual environment, use its absolute path so Codex can invoke it without activating that environment.

Restart Codex and complete a CLI turn. Check $CODEX_HOME/state/anosys_hook.log for callback execution and delivery errors. The status command checks registration, not network delivery.

Upgrade from version 0.1.0 with pip install --upgrade anosys-codex. Existing direct module notifications remain supported; the default CLI command no longer needs the old workaround. Saved redaction settings are now applied when mapping each turn.

The notify callback is separate from lifecycle hooks displayed by /hooks. See the official Codex notification documentation. Preserve existing notification integrations separately: the installer can replace an existing notify command.

Runtime behavior

The runner finds a rollout file under $CODEX_HOME/sessions, maps the completed turn, and posts batches to https://api.anosys.ai/ingestion. Failed records are buffered in $CODEX_HOME/state/pending_records.jsonl and retried on later invocations.

Token usage and cost depend on the transcript fields and the package's embedded pricing table. Treat cost as an estimate. This package targets local Codex CLI transcripts; do not assume that a desktop or cloud session invokes the same callback.

Environment variables

Variable Purpose
ANOSYS_HOOK_APIKEY Runtime ingestion key; also loaded from anosys-env.sh
ANOSYS_API_KEY Accepted by the installer as a source for the saved ingestion key
ANOSYS_HOOK_ENDPOINT_URL Ingestion URL override
REDACTION true to mask supported content fields
ANOSYS_ENCRYPTION_KEY Enable selected-field encryption
ANOSYS_ENCRYPTED_COLUMNS Override the default encrypted columns
ANOSYS_HOOK_DRY_RUN true to skip network submission
CODEX_HOME Codex configuration, session, and state directory

Version 0.1.1 reads the active REDACTION setting when mapping each turn, including settings loaded from anosys-env.sh.

See content controls for encryption and redaction limitations. Dry-run mode is a network diagnostic; it does not confirm server ingestion.

Commands

  • install: configure the ingestion key and notification entry.
  • status: inspect expected registration and the environment file.
  • uninstall: remove the installer's recognized notification entry and environment file. Remove a manually configured module entry yourself.
  • run: receives the Codex notification JSON and executes the turn-completion handler.

License

Apache License 2.0.

Metadata

Release files for anosys-codex 0.1.1

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

Source distribution (sdist)

Source distribution for anosys-codex 0.1.1
File Size Uploaded Provenance Actions
anosys_codex-0.1.1.tar.gz 19.9 kB Without provenance Details for anosys_codex-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anosys-codex 0.1.1
File Interpreter ABI Platform Actions
anosys_codex-0.1.1-py3-none-any.whl Python 3 none any Details for anosys_codex-0.1.1-py3-none-any.whl

Total release size: 39.7 kB

Release files / anosys_codex-0.1.1.tar.gz

Download URL anosys_codex-0.1.1.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98c26cbb6329f5df07fe7774c9cc31763294a5b47276524f324674240da2e141
BLAKE2b-256 checksum
How to use checksums
f113f2a21cd5d9102fc44544e878efce321b1d659525d00e4bc823c2a6d3b106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / anosys_codex-0.1.1-py3-none-any.whl

Download URL anosys_codex-0.1.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2234e469d342dcbce6aa0e802c30e2d4b83c28d80e32dc48604a0d66fb63fa86
BLAKE2b-256 checksum
How to use checksums
1cbef3f18ee6fd18044ed5708d00d3266f611d283d42c663de0a6d814240b0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for anosys-codex 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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