agentcap-cli 0.5.2__tar.gz → 0.5.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/PKG-INFO +7 -7
  2. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/README.md +6 -6
  3. agentcap_cli-0.5.3/plugin/README.md +90 -0
  4. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/pyproject.toml +1 -1
  5. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/__init__.py +1 -1
  6. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/quota.py +2 -2
  7. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_cc_plugin.py +61 -0
  8. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/.gitignore +0 -0
  9. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/LICENSE +0 -0
  10. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/codex-plugin/LICENSE +0 -0
  11. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/landing/v2/README.md +0 -0
  12. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/plugin/LICENSE +0 -0
  13. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/_lifeline_exec.py +0 -0
  14. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/_lifeline_watch.py +0 -0
  15. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/adapters.py +0 -0
  16. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/alerts.py +0 -0
  17. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/analytics.py +0 -0
  18. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/budget.py +0 -0
  19. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/clamp.py +0 -0
  20. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/cli.py +0 -0
  21. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/cli_history.py +0 -0
  22. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/data/pricing.json +0 -0
  23. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/demo.py +0 -0
  24. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/devtools/__init__.py +0 -0
  25. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/devtools/fake_upstream.py +0 -0
  26. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/estimate.py +0 -0
  27. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/eta.py +0 -0
  28. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/failsafe.py +0 -0
  29. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/harness.py +0 -0
  30. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/history.py +0 -0
  31. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/ledger.py +0 -0
  32. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/license.py +0 -0
  33. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/lifeline.py +0 -0
  34. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/live_quota.py +0 -0
  35. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/logschema.py +0 -0
  36. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/loop.py +0 -0
  37. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/plans.py +0 -0
  38. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/pricing.py +0 -0
  39. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/private.py +0 -0
  40. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/procstop.py +0 -0
  41. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/proxy.py +0 -0
  42. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/report.py +0 -0
  43. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/runner.py +0 -0
  44. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/upstreams.py +0 -0
  45. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/usage.py +0 -0
  46. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/src/agentcap/waste.py +0 -0
  47. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/conftest.py +0 -0
  48. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/claude/projects/-home-dev-shop/sess-p/subagents/agent-a1b2c3.jsonl +0 -0
  49. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/claude/projects/-home-dev-shop/sess-p/subagents/agent-d4e5f6.jsonl +0 -0
  50. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/claude/projects/-home-dev-shop/sess-p.jsonl +0 -0
  51. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/codex/sessions/2026/10/29/rollout-2026-10-29T09-00-00-thr-parent.jsonl +0 -0
  52. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/codex/sessions/2026/10/29/rollout-2026-10-29T09-00-50-thr-child.jsonl +0 -0
  53. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/agents/codex/sessions/2026/10/29/rollout-2026-10-29T09-01-20-thr-fork.jsonl +0 -0
  54. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/harness_logs/agy-1.4.11-2026-10-30.jsonl +0 -0
  55. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/harness_logs/claude-2.1.316-pretooluse.json +0 -0
  56. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/harness_logs/claude-2.1.316-statusline.json +0 -0
  57. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/harness_logs/codex-rollout-2026-10-29.jsonl +0 -0
  58. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/harness_logs/opencode-2026-10-30.jsonl +0 -0
  59. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/history/claude/.credentials.json +0 -0
  60. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/history/claude/projects/-home-dev-shop/1f0c-sess-a.jsonl +0 -0
  61. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/history/codex/auth.json +0 -0
  62. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/history/codex/sessions/2026/10/29/rollout-2026-10-29T10-00-00-0199aaaa-bbbb-cccc-dddd-eeeeeeeeeeee.jsonl +0 -0
  63. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/README.md +0 -0
  64. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/anthropic_403_permission_error.json +0 -0
  65. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/openai_403_region_blocked.json +0 -0
  66. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/openrouter_401_user_not_found.json +0 -0
  67. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/openrouter_403_moderation.json +0 -0
  68. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/fixtures/upstream/openrouter_429_rate_limited.json +0 -0
  69. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/license_support.py +0 -0
  70. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/proxy_support.py +0 -0
  71. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_adapters.py +0 -0
  72. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_agent_set.py +0 -0
  73. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_agents.py +0 -0
  74. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_alerts.py +0 -0
  75. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_analytics.py +0 -0
  76. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_anthropic_proxy.py +0 -0
  77. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_anthropic_units.py +0 -0
  78. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_budget.py +0 -0
  79. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_child_status.py +0 -0
  80. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_clamp.py +0 -0
  81. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_claude_adapter_and_tiers.py +0 -0
  82. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_cli.py +0 -0
  83. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_codex_plugin.py +0 -0
  84. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_concurrent_forgive.py +0 -0
  85. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_e2e_claude.py +0 -0
  86. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_estimate.py +0 -0
  87. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_exit_codes.py +0 -0
  88. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_failsafe.py +0 -0
  89. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_harness.py +0 -0
  90. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_history.py +0 -0
  91. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_ledger.py +0 -0
  92. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_license.py +0 -0
  93. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_lifeline.py +0 -0
  94. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_live_quota.py +0 -0
  95. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_log_contract.py +0 -0
  96. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_log_contract_live.py +0 -0
  97. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_loop.py +0 -0
  98. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_plugin_package.py +0 -0
  99. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_pricing.py +0 -0
  100. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_private_dirs.py +0 -0
  101. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_procstop.py +0 -0
  102. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_prompt_block.py +0 -0
  103. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_proxy_auth.py +0 -0
  104. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_proxy_cancel.py +0 -0
  105. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_proxy_core.py +0 -0
  106. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_proxy_extras.py +0 -0
  107. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_proxy_streaming.py +0 -0
  108. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_quota.py +0 -0
  109. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_release.py +0 -0
  110. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_report_cli.py +0 -0
  111. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_runaway.py +0 -0
  112. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_runner.py +0 -0
  113. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_self_approve.py +0 -0
  114. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_stop_matrix.py +0 -0
  115. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_upstream_refusals.py +0 -0
  116. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_upstreams.py +0 -0
  117. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_usage.py +0 -0
  118. {agentcap_cli-0.5.2 → agentcap_cli-0.5.3}/tests/test_zombie_collector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentcap-cli
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: Local-first quota and cost guard for coding agents: per-job share of Claude Code/Codex/Gemini subscription quota, loop breaker, evidence receipt.
5
5
  Project-URL: Homepage, https://agentcap.launchbench.studio
6
6
  Project-URL: Repository, https://github.com/Blitz00X/agentcap
@@ -846,7 +846,7 @@ steps are noisy. No team aggregation: everything stays on your machine.
846
846
 
847
847
  ## Free vs Pro (0.2)
848
848
 
849
- **Free (MIT License, forever):** the per-run spend cap.
849
+ **Free (MIT License):** the per-run spend cap.
850
850
  - Per-run `--cap` (`--hour-cap` / `--day-cap` exit 2 on Free with a clear message)
851
851
  - Output clamping, fail-closed metering, terminal alerts
852
852
  - Claude Code, Codex, any SDK script (and Gemini CLI)
@@ -855,7 +855,7 @@ steps are noisy. No team aggregation: everything stays on your machine.
855
855
  When the Pro detectors below would have fired on a Free run, AgentCap does not stop it.
856
856
  It prints one line: `Pro's loop breaker would have stopped this at $X.XX`.
857
857
 
858
- **Pro, $12 one-time (launch week; $19 after): stop runs that loop or eat your quota.**
858
+ **Pro, $7 one-time during the beta ($12 after): stop runs that loop or eat your quota.**
859
859
 
860
860
  **Get Pro:** buy at https://agentcap.launchbench.studio/#pricing (Polar checkout). Polar then
861
861
  emails you an **Access purchase** link; the key is in the Polar customer portal (not in the
@@ -880,11 +880,11 @@ The VS Code/Cursor extension and the Claude Code plugin use the same CLI licence
880
880
  `AGENTCAP_RECEIPT_DIR`) with requests, spend, caps, the stop reason and the exit code. It contains
881
881
  numbers only, never prompts. The same one-line receipt is sent to Telegram and the webhook.
882
882
 
883
- [Buy AgentCap Pro — $12 launch week](https://buy.polar.sh/polar_cl_qagsvUdwQ0dRvaW7X5ynEJg5md27pEctIRAr40MBeLi)
883
+ [Buy AgentCap Pro — $7 beta price](https://buy.polar.sh/polar_cl_qagsvUdwQ0dRvaW7X5ynEJg5md27pEctIRAr40MBeLi)
884
884
 
885
885
  ### Purchase terms
886
886
 
887
- - Pro is $12 one-time (launch week; $19 after), no subscription. The current launch-week end date is on the pricing page.
887
+ - Pro is $7 one-time during the beta ($12 after), no subscription.
888
888
  - 14-day no-questions refund — email
889
889
  [kutaykarahan6@gmail.com](mailto:kutaykarahan6@gmail.com).
890
890
  - One licence key activates on up to 3 machines.
@@ -912,7 +912,7 @@ Polar customer portal.
912
912
  | LoopGuard | [tryloopguard.com](https://tryloopguard.com): free MIT CLI that integrates with Claude Code, Codex CLI and Cursor (no proxy, works with subscriptions) with per-session/daily caps and a no-progress loop killer; paid tier ($9/month) adds phone/Slack alerts and remote pause. A good fit if you use subscriptions or Claude Code. |
913
913
  | LiteLLM budgets | Budgets per key, user or team in the LiteLLM proxy; budgets need its database. A good fit if you already run a LiteLLM gateway; it is a server you deploy and configure. |
914
914
  | OpenRouter credit limits / provider spend caps | Account- or key-level and typically monthly (OpenRouter credit limits, OpenAI and Google spend caps). Provider caps are evaluated with a delay — Google has described about 10 minutes for the Gemini API cap — so a fast loop can overshoot. |
915
- | AgentCap | Local proxy for API-key traffic from Claude Code, Codex CLI, Gemini CLI or your own script: run cap (Free) with conservative reservation and output clamping, kills the process group at the cap and prints why. Pro (unattended pack): hour/day caps, loop/burn breaker, Telegram/webhook alerts, spend receipt, $19 one-time. |
915
+ | AgentCap | Local proxy for API-key traffic from Claude Code, Codex CLI, Gemini CLI or your own script: run cap (Free) with conservative reservation and output clamping, kills the process group at the cap and prints why. Pro (unattended pack): hour/day caps, loop/burn breaker, Telegram/webhook alerts, spend receipt, $7 one-time during the beta ($12 after). |
916
916
 
917
917
  The comparison above is from public pages; see the RelayPlane detail below.
918
918
 
@@ -953,7 +953,7 @@ prices and reported usage; when usage is missing it charges the full reservation
953
953
  **Is the day cap shared across machines?** No. Hour/day caps are per machine
954
954
  (local SQLite ledger). A license covers 3 machines, each with its own budget.
955
955
 
956
- **What does one-time purchase include?** $12 once in launch week ($19 after), all 0.x updates; not a
956
+ **What does one-time purchase include?** $7 once during the beta ($12 after), all 0.x updates; not a
957
957
  promise of future major versions. 14-day refund window per purchase terms.
958
958
 
959
959
  ## License
@@ -816,7 +816,7 @@ steps are noisy. No team aggregation: everything stays on your machine.
816
816
 
817
817
  ## Free vs Pro (0.2)
818
818
 
819
- **Free (MIT License, forever):** the per-run spend cap.
819
+ **Free (MIT License):** the per-run spend cap.
820
820
  - Per-run `--cap` (`--hour-cap` / `--day-cap` exit 2 on Free with a clear message)
821
821
  - Output clamping, fail-closed metering, terminal alerts
822
822
  - Claude Code, Codex, any SDK script (and Gemini CLI)
@@ -825,7 +825,7 @@ steps are noisy. No team aggregation: everything stays on your machine.
825
825
  When the Pro detectors below would have fired on a Free run, AgentCap does not stop it.
826
826
  It prints one line: `Pro's loop breaker would have stopped this at $X.XX`.
827
827
 
828
- **Pro, $12 one-time (launch week; $19 after): stop runs that loop or eat your quota.**
828
+ **Pro, $7 one-time during the beta ($12 after): stop runs that loop or eat your quota.**
829
829
 
830
830
  **Get Pro:** buy at https://agentcap.launchbench.studio/#pricing (Polar checkout). Polar then
831
831
  emails you an **Access purchase** link; the key is in the Polar customer portal (not in the
@@ -850,11 +850,11 @@ The VS Code/Cursor extension and the Claude Code plugin use the same CLI licence
850
850
  `AGENTCAP_RECEIPT_DIR`) with requests, spend, caps, the stop reason and the exit code. It contains
851
851
  numbers only, never prompts. The same one-line receipt is sent to Telegram and the webhook.
852
852
 
853
- [Buy AgentCap Pro — $12 launch week](https://buy.polar.sh/polar_cl_qagsvUdwQ0dRvaW7X5ynEJg5md27pEctIRAr40MBeLi)
853
+ [Buy AgentCap Pro — $7 beta price](https://buy.polar.sh/polar_cl_qagsvUdwQ0dRvaW7X5ynEJg5md27pEctIRAr40MBeLi)
854
854
 
855
855
  ### Purchase terms
856
856
 
857
- - Pro is $12 one-time (launch week; $19 after), no subscription. The current launch-week end date is on the pricing page.
857
+ - Pro is $7 one-time during the beta ($12 after), no subscription.
858
858
  - 14-day no-questions refund — email
859
859
  [kutaykarahan6@gmail.com](mailto:kutaykarahan6@gmail.com).
860
860
  - One licence key activates on up to 3 machines.
@@ -882,7 +882,7 @@ Polar customer portal.
882
882
  | LoopGuard | [tryloopguard.com](https://tryloopguard.com): free MIT CLI that integrates with Claude Code, Codex CLI and Cursor (no proxy, works with subscriptions) with per-session/daily caps and a no-progress loop killer; paid tier ($9/month) adds phone/Slack alerts and remote pause. A good fit if you use subscriptions or Claude Code. |
883
883
  | LiteLLM budgets | Budgets per key, user or team in the LiteLLM proxy; budgets need its database. A good fit if you already run a LiteLLM gateway; it is a server you deploy and configure. |
884
884
  | OpenRouter credit limits / provider spend caps | Account- or key-level and typically monthly (OpenRouter credit limits, OpenAI and Google spend caps). Provider caps are evaluated with a delay — Google has described about 10 minutes for the Gemini API cap — so a fast loop can overshoot. |
885
- | AgentCap | Local proxy for API-key traffic from Claude Code, Codex CLI, Gemini CLI or your own script: run cap (Free) with conservative reservation and output clamping, kills the process group at the cap and prints why. Pro (unattended pack): hour/day caps, loop/burn breaker, Telegram/webhook alerts, spend receipt, $19 one-time. |
885
+ | AgentCap | Local proxy for API-key traffic from Claude Code, Codex CLI, Gemini CLI or your own script: run cap (Free) with conservative reservation and output clamping, kills the process group at the cap and prints why. Pro (unattended pack): hour/day caps, loop/burn breaker, Telegram/webhook alerts, spend receipt, $7 one-time during the beta ($12 after). |
886
886
 
887
887
  The comparison above is from public pages; see the RelayPlane detail below.
888
888
 
@@ -923,7 +923,7 @@ prices and reported usage; when usage is missing it charges the full reservation
923
923
  **Is the day cap shared across machines?** No. Hour/day caps are per machine
924
924
  (local SQLite ledger). A license covers 3 machines, each with its own budget.
925
925
 
926
- **What does one-time purchase include?** $12 once in launch week ($19 after), all 0.x updates; not a
926
+ **What does one-time purchase include?** $7 once during the beta ($12 after), all 0.x updates; not a
927
927
  promise of future major versions. 14-day refund window per purchase terms.
928
928
 
929
929
  ## License
@@ -0,0 +1,90 @@
1
+ # AgentCap for Claude Code
2
+
3
+ Stop a Claude Code session before it loops or eats your Max/Pro quota.
4
+
5
+ AgentCap watches every tool call through Claude Code hooks. It warns, and on Pro ends the turn,
6
+ when a session reaches its share of your weekly or 5-hour quota, repeats the same tool call 4 times
7
+ in a row, or fails 8 tool calls in a row. Every stop says why, in plain numbers.
8
+
9
+ ## Install
10
+
11
+ ```
12
+ /plugin marketplace add Blitz00X/agentcap
13
+ /plugin install agentcap@agentcap
14
+ /agentcap:setup # once: adds AgentCap's read-only statusLine (your own line keeps showing)
15
+ ```
16
+
17
+ Needs `python3` on PATH. No pip install, no account, no network access.
18
+
19
+ ## Use
20
+
21
+ ```
22
+ /agentcap:quota 5% # this session may use 5 more points of the weekly quota
23
+ /agentcap:quota 2% 5h # or 2 more points of the 5-hour window
24
+ /agentcap:quota until 70% 5h # or stop when the 5-hour window reaches 70%
25
+ /agentcap:status # where this session stands and where it stops
26
+ /agentcap:default 10% 5h # give every new session (also claude -p) a limit; `off` removes it
27
+ /agentcap:approve # Pro, after a stop: raise the limit by 50% (at most twice)
28
+ /agentcap:off # clear this session's limit
29
+ /agentcap:unsetup # restore your previous statusLine and delete AgentCap's settings backup
30
+ ```
31
+
32
+ You can also ask in plain words. Claude Code shows a permission prompt with the stop point, and
33
+ the limit is set only after you approve:
34
+
35
+ - "Use at most 10% of the weekly quota in this session."
36
+ - "Stop when the 5-hour limit reaches 70%."
37
+ - "Why did AgentCap stop my last turn?"
38
+
39
+ The agent may only set or tighten a limit. Raising it, clearing it and approving a stop stay
40
+ yours: AgentCap denies any tool call by the agent that would run its script or edit its state.
41
+
42
+ ## Free and Pro
43
+
44
+ - **Free (MIT):** the live quota meter, a warning at 80% of the limit, and one notice when a limit,
45
+ a loop or an error streak is reached ("AgentCap Pro would stop the agent here"). Nothing is
46
+ blocked.
47
+ - **Pro ($7 one-time during the beta, $12 after):** the same detectors end the turn
48
+ (`PreToolUse` deny with `continue: false`), block new prompts while the session is over its
49
+ limit, and write a receipt. Pro is unlocked by a licence key that you activate with the separate
50
+ `agentcap` CLI (`pipx install agentcap-cli`, then `agentcap license activate`). Buy at
51
+ https://agentcap.launchbench.studio/#pricing. 14-day refund.
52
+
53
+ ## What the plugin runs, changes, stores and sends
54
+
55
+ - **Runs:** `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/agentcap_cc.py` on SessionStart,
56
+ UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure and Stop, and for the slash
57
+ commands above. Standard library only. While a limit is set it may start
58
+ `claude -p /usage` in the background, at most every 30 seconds, to read the current quota
59
+ (a local Claude Code command; no model call). Its statusLine command also runs your previous
60
+ user-level statusLine command, unchanged, so your own line keeps showing.
61
+ - **Changes:** `/agentcap:setup` sets only the `statusLine` key in `~/.claude/settings.json` and
62
+ keeps an owner-only backup of that file (`settings.json.agentcap-backup`).
63
+ `/agentcap:unsetup` restores your previous statusLine and deletes the backup.
64
+ - **Stores, on your machine only** (`~/.local/state/agentcap/quota/`): session ids, quota
65
+ percentages and reset times, counters, the tool name and a 16-character hash of each tool call,
66
+ and receipts (numbers and the last tool name). Never prompts, tool inputs, tool output, tokens or
67
+ credentials. Loop counters are deleted after 7 days, session files after 30 days, receipts after
68
+ 90 days.
69
+ - **Reads:** the `rate_limits` values Claude Code passes to the statusLine, Claude Code's own
70
+ `/usage` output, and the licence file `~/.config/agentcap/license.json` if it exists.
71
+ - **Sends:** nothing. The plugin makes no network requests. The separate `agentcap` CLI checks a
72
+ Pro key with Polar's licence API about once a week; Free users make no licence requests at all.
73
+
74
+ Privacy policy: https://agentcap.launchbench.studio/privacy
75
+
76
+ ## Limits
77
+
78
+ - The quota % is account-level: other sessions, devices and claude.ai use in the same window count
79
+ against this session's limit.
80
+ - A stop can be one response (or one 30-second `/usage` check) late, so a session can pass its
81
+ limit by a few points.
82
+ - macOS and Windows are not tested yet; Windows needs WSL.
83
+
84
+ ## Support
85
+
86
+ - Issues: https://github.com/Blitz00X/agentcap/issues
87
+ - Security reports: https://github.com/Blitz00X/agentcap/security/policy
88
+ - Source and the full CLI documentation: https://github.com/Blitz00X/agentcap
89
+
90
+ MIT License. Copyright (c) 2026 Kutay Karahan.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "agentcap-cli"
7
- version = "0.5.2"
7
+ version = "0.5.3"
8
8
  description = "Local-first quota and cost guard for coding agents: per-job share of Claude Code/Codex/Gemini subscription quota, loop breaker, evidence receipt."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2,6 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "0.5.2"
5
+ __version__ = "0.5.3"
6
6
 
7
7
  __all__ = ["__version__"]
@@ -1964,7 +1964,7 @@ class QuotaRunner:
1964
1964
  code = EXIT_GUARD_FAILED
1965
1965
  if loop_detail and not self.enforce:
1966
1966
  self._say(f"agentcap: Pro's loop breaker would have stopped this job at {LOOP_REPEATS} repeats"
1967
- f" ({loop_detail}). https://agentcap.launchbench.studio/#pricing")
1967
+ f" ({loop_detail}). See the Pro section of the AgentCap README.")
1968
1968
  self.summary = QuotaSummary(
1969
1969
  self.agent, self.window, self.quota, share, code, reason,
1970
1970
  tracker.baseline_exact, tracker.resets_seen, parallel, observed,
@@ -2131,7 +2131,7 @@ class QuotaRunner:
2131
2131
  if not self.enforce and s.observed and s.share >= s.quota:
2132
2132
  self._say(
2133
2133
  f"agentcap: Pro's quota mode would have stopped this job at {s.quota:g}%. "
2134
- "https://agentcap.launchbench.studio/#pricing"
2134
+ "See the Pro section of the AgentCap README."
2135
2135
  )
2136
2136
  if self.enforce:
2137
2137
  self._event("quota_receipt", s.share, reason=s.reason, exit_code=s.exit_code)
@@ -618,6 +618,67 @@ def test_setup_backup_is_private(env, monkeypatch):
618
618
  assert stat.S_IMODE(backup.stat().st_mode) == 0o600
619
619
 
620
620
 
621
+ def test_unsetup_restores_statusline_and_deletes_backup(env):
622
+ """0.5.3: the full-settings backup (may hold env keys) does not outlive /agentcap:unsetup."""
623
+
624
+ settings = cc.claude_settings_path()
625
+ settings.parent.mkdir(parents=True, exist_ok=True)
626
+ settings.write_text(json.dumps({
627
+ "statusLine": {"type": "command", "command": "echo old"},
628
+ "env": {"ANTHROPIC_API_KEY": "synthetic-not-a-real-key"},
629
+ }))
630
+ cc.cmd_setup(now=1.0)
631
+ backup = settings.with_name(settings.name + ".agentcap-backup")
632
+ assert backup.exists()
633
+ out = cc.cmd_unsetup()
634
+ assert "restored" in out and backup.name in out
635
+ assert not backup.exists()
636
+ data = json.loads(settings.read_text())
637
+ assert data["statusLine"] == {"type": "command", "command": "echo old"}
638
+ assert data["env"] == {"ANTHROPIC_API_KEY": "synthetic-not-a-real-key"}
639
+
640
+
641
+ def test_unsetup_of_a_foreign_statusline_keeps_the_backup(env):
642
+ settings = cc.claude_settings_path()
643
+ settings.parent.mkdir(parents=True, exist_ok=True)
644
+ settings.write_text(json.dumps({"statusLine": {"type": "command", "command": "echo mine"}}))
645
+ backup = settings.with_name(settings.name + ".agentcap-backup")
646
+ backup.write_text("{}")
647
+ assert "left unchanged" in cc.cmd_unsetup()
648
+ assert backup.exists()
649
+
650
+
651
+ def test_session_start_prunes_old_session_files_and_receipts(env):
652
+ import os as _os
653
+ import time as _t
654
+
655
+ now = _t.time()
656
+ month = 31 * 86400
657
+ files = {}
658
+ for sub in ("sessions", "usage", "by_cwd"):
659
+ d = cc.cc_dir() / sub
660
+ d.mkdir(parents=True, exist_ok=True)
661
+ files[sub] = (d / "old.json", d / "fresh.json")
662
+ for f in files[sub]:
663
+ f.write_text("{}")
664
+ _os.utime(files[sub][0], (now - month, now - month))
665
+ keep_txt = cc.cc_dir() / "sessions" / "notes.txt"
666
+ keep_txt.write_text("x")
667
+ _os.utime(keep_txt, (now - month, now - month))
668
+ receipts = cc.cc_dir() / "receipts.jsonl"
669
+ receipts.write_text(
670
+ json.dumps({"ts": now - 100 * 86400, "reason": "old"}) + "\n"
671
+ + json.dumps({"ts": now - 86400, "reason": "recent"}) + "\n"
672
+ + "not json\n")
673
+ hook("start", {"session_id": SID, "cwd": "/w", "hook_event_name": "SessionStart"})
674
+ for old, fresh in files.values():
675
+ assert not old.exists() and fresh.exists()
676
+ assert keep_txt.exists()
677
+ lines = receipts.read_text().splitlines()
678
+ assert [json.loads(line)["reason"] for line in lines[:1]] == ["recent"]
679
+ assert lines[1:] == ["not json"]
680
+
681
+
621
682
  def test_git_output_is_not_treated_as_a_plain_read(env):
622
683
  """L-3: --output writes state/plugin files even though git looks read-only."""
623
684
 
File without changes
File without changes