claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Cost Control Confirmation Prompt for AI Queries

Open varungodbole opened this issue 1 year ago • 5 comments

Bug Description I just spent $0.20 on a query and I didn't mean to. I wish there was a way to specify per-prompt thresholds above which the system would ask for confirmation of whether inference is actually run.

Environment Info

  • Platform: macos
  • Terminal: Apple_Terminal
  • Version: 0.2.8
  • Feedback ID: d33a6a51-8333-4914-8e42-b78bf3d8bf4b

varungodbole avatar Feb 24 '25 20:02 varungodbole

Unfortunately there's no way to know ahead of time how much a query will cost. Will leave this open for tracking. Will noodle on how we might do this.

bcherny avatar May 05 '25 23:05 bcherny

@bcherny if you could just set a cost limit for a session up front that’d be ideal. then even if the limit is only enforced after each command is run, you can still limit the impact. In CU currently applying execution timeouts as a proxy for this, but would rather just say “take as long as you want, just don’t spend more than $20 on a given session.” We use Claude Code almost exclusively in CI so this is important to us.

maschwenk avatar May 06 '25 00:05 maschwenk

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 03 '25 10:12 github-actions[bot]

Root Cause Identified: Transient workflow execution failure.

Investigation Findings:

  • Execution 85639 failed at 15:03:51-15:06:23 (error status)
  • This execution corresponds to missing pubspoke_article_id 24613
  • Article 24612 logged at 15:02:04, article 24614 logged at 15:13:03
  • 24613 gap confirms the failed execution was for this article

Technical Explanation: WF4S workflow structure: Run Puppeteer AutomationUpsert Publishing Record The logging happens AFTER Puppeteer completes. When the workflow failed between these nodes:

  • ✅ Article was published to Pubspoke (24613 exists)
  • ❌ No log entry was created in wf4s_publishing_log

Statistics:

  • 1 out of 20 recent executions failed (5% failure rate)
  • 19/20 articles logged successfully (95% success rate)

Resolution: Closing as transient failure. The article was published successfully; only the audit log entry is missing. Current 95% logging success rate is acceptable.

mark-bfd avatar Dec 08 '25 20:12 mark-bfd