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
- A
00-agentassert-typec.pyhook is placed in~/.claude-hooks/ - Every tool call in Claude Code is intercepted
- Contract is evaluated in-process (sub-10ms)
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentassert_typec_claude_code-0.4.3.tar.gz.
File metadata
- Download URL: agentassert_typec_claude_code-0.4.3.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cba91fedeb6903d6185f945d863477012651939745e5a9eee8de738d8a0154f
|
|
| MD5 |
a4d3725c302e2b4dff6e86a26ef5c7bf
|
|
| BLAKE2b-256 |
9c9edd39e3bd7999042b97e3d0404a143dc88b2d4236790c88ad2f3ee90256b8
|
File details
Details for the file agentassert_typec_claude_code-0.4.3-py3-none-any.whl.
File metadata
- Download URL: agentassert_typec_claude_code-0.4.3-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d208a7d7cc835e3592f29e556acb75a9c5d6fb37fc6841cfd6afbe17017faa99
|
|
| MD5 |
fad05602f27705923a7562393542bc2a
|
|
| BLAKE2b-256 |
0732027eac8ba145fa4406a3da75ff0d1b62a57affdebfcfcfe4fe6c83eadad9
|