Skip to main content

agentassert-typec-claude-code

Claude Code hook adapter — contract enforcement directly in Claude Code.

Install

pip install agentassert-typec-claude-code
agentassert-claude-code install --contract partner-mode.yaml
export AGENTASSERT_CONTRACT=$(pwd)/partner-mode.yaml

What Happens

  1. A 00-agentassert-typec.py hook is placed in ~/.claude-hooks/
  2. Every tool call in Claude Code is intercepted
  3. Contract is evaluated in-process (sub-10ms)
  4. On DENY: block with reason; on ALLOW: forward

Available Contracts

# Minimal: just block destructive tools
agentassert-claude-code install --contract $(pip show agentassert-typec-claude-code | grep Location | cut -d' ' -f2)/contracts/templates/safety-minimal.yaml

# Partner mode: challenge-first, cost-before-paid, drift detection
agentassert-claude-code install --contract $(pip show agentassert-typec-claude-code | grep Location | cut -d' ' -f2)/contracts/templates/partner-mode.yaml

# Full governance: all 7 operators
agentassert-claude-code install --contract $(pip show agentassert-typec-claude-code | grep Location | cut -d' ' -f2)/contracts/templates/full-governance.yaml

The Partner Mode Story

Varun's ~/.claude/CLAUDE.md + ~/.claude/rules/*.md contained ~14,000 tokens of process rules. After migrating to partner-mode.yaml:

  • 47.8% token reduction per turn (49,636 → ~25,920 bytes)
  • process rules: 31,322 bytes → 1,203 bytes (96% compression of rules)
  • Replaced: challenge-first, cost-before-paid-API, tool blocklist, destructive-command firewall, context budget
  • Preserved: style/voice rules (cannot formalize), capability routing, reference docs

See case_study/measurements.md for the full analysis.

Status

agentassert-claude-code status

Uninstall

agentassert-claude-code uninstall

License

MIT

Metadata

Release files for agentassert-typec-claude-code 0.7.0

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

Source distribution (sdist)

Source distribution for agentassert-typec-claude-code 0.7.0
File Size Uploaded Provenance Actions
agentassert_typec_claude_code-0.7.0.tar.gz 3.0 kB Without provenance Details for agentassert_typec_claude_code-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentassert-typec-claude-code 0.7.0
File Interpreter ABI Platform Actions
agentassert_typec_claude_code-0.7.0-py3-none-any.whl Python 3 none any Details for agentassert_typec_claude_code-0.7.0-py3-none-any.whl

Total release size: 6.2 kB

Release files / agentassert_typec_claude_code-0.7.0.tar.gz

Download URL agentassert_typec_claude_code-0.7.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
59b70ab7855836c2a8fa52a58bf8cf0941fc348895e22a61c75aa8bc27f41498
BLAKE2b-256 checksum
How to use checksums
7806fc492526d3a5d867c6ef21d9e0a102ce9315812c9ec65fe69310571c21e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / agentassert_typec_claude_code-0.7.0-py3-none-any.whl

Download URL agentassert_typec_claude_code-0.7.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6609f306897572a11eebe2a34f491ec704b7fa84ae6109bd7e86805cb8588de
BLAKE2b-256 checksum
How to use checksums
d8f3242fbec2ff06e197e67446d2bb195ecfd46ad3c0789b51e4f054bb00463e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for agentassert-typec-claude-code 0.7.0

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