Skip to main content

AgentAssert Type-C Claude Code hook adapter — enforce behavioral contracts directly in Claude Code CLI.

Project description

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

Project details


Download files

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

Source Distribution

agentassert_typec_claude_code-0.6.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

agentassert_typec_claude_code-0.6.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file agentassert_typec_claude_code-0.6.1.tar.gz.

File metadata

  • Download URL: agentassert_typec_claude_code-0.6.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentassert_typec_claude_code-0.6.1.tar.gz
Algorithm Hash digest
SHA256 c32230c99d2acef4afc5c3b2fda3faa8a6c529d9564e08c5cc8adbcfe3e78e5b
MD5 c95cd32108b0811bc3e6bb26ab803063
BLAKE2b-256 ea7666e3cdfc0e77a80f8871825e2fd0d0734eb01018ebf93f33417b8e166a95

See more details on using hashes here.

File details

Details for the file agentassert_typec_claude_code-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: agentassert_typec_claude_code-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentassert_typec_claude_code-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3287e71bf99d674995d45125f86db5ed16a30e4bed897dde90409c1f6fefb41a
MD5 bc79f94bd2208c18d002aea63933199b
BLAKE2b-256 ac1465947bdaba68d9caea4553f798ecbb5070b3e769d633016de1aa0ff27a4b

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 Pingdom Monitoring Sentry Error logging StatusPage Status page