Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

Developer at a terminal typing Python code that exploits Claude's interactive mode to bypass pricing changes for…
Open SourceScore: 100

50-line script bypasses Anthropic's Claude pricing split for CI/CD

A 50-line Python script by developer HammerMei exploits Claude's interactive mode to bypass Anthropic's June 15 pricing split, keeping CI/CD calls on subscription billing instead of per-token API charges.

·13h ago·3 min read··26 views·AI-Generated·Report error
Share:
Source: dev.tovia devto_claudecodeWidely Reported
How can I use Claude in CI/CD without paying per-token API costs after June 15?

A 50-line Python script named claude_task.py tricks Anthropic's Claude into running one-shot CI/CD tasks under subscription billing by using interactive mode and a kill command, avoiding the per-token API pricing that applies to claude -p calls after June 15.

TL;DR

Claude -p costs API money after June 15 · Interactive session trick avoids per-token billing · 50-line Python script replaces claude -p

Developer HammerMei published a 50-line Python script on May 17 that exploits Claude's interactive mode to bypass Anthropic's June 15 pricing split. The trick keeps CI/CD calls on subscription billing instead of switching to per-token API pricing.

Key facts

  • 50 lines of Python code replace claude -p
  • June 15 pricing split triggers per-token API charges
  • Interactive session remains on subscription billing
  • Script uses kill $PPID to exit cleanly
  • Timeout and retry logic included for flaky LLM behavior

Anthropic's June 15 pricing change [per Anthropic] splits Claude usage into two billing tiers: claude -p calls in CI/CD pipelines will incur per-token API charges, while interactive sessions remain on the fixed subscription. Developer HammerMei published a 50-line Python script, claude_task.py, that exploits this gap.

The trick exploits a Claude behavior: running claude without the -p flag starts an interactive session that stays on subscription billing. The problem is that interactive mode doesn't exit after responding. HammerMei's solution appends a command to the prompt: "Write your response to: /tmp/response-abc123.txt. Then run in bash: kill $PPID." $PPID inside a bash subprocess is the PID of the claude process itself. Claude writes output to a file, kills its own process, and exits cleanly. The calling script reads the file.

The script, available on GitHub Gist, includes timeout and retry logic because Claude sometimes fails to follow instructions. The comparison table shows this approach requires zero setup versus the 3,000-line poor-claude daemon solution [per the dev.to post].

Why this matters

The unique angle is that Anthropic's pricing split creates an arbitrage opportunity for users willing to exploit a behavioral quirk. The company's June 15 change [per Anthropic's pricing page] was designed to monetize high-volume, automated usage — but the interactive session loophole undermines that intent. This isn't a vulnerability, but a failure to align billing incentives with actual usage patterns.

Caveats

The approach relies on Claude following instructions reliably, which it doesn't always do. The developer notes that "Claude is an LLM. It doesn't always follow instructions. The timeout + retry is there for a reason — treat it like any other flaky external call." This makes it unsuitable for production pipelines requiring deterministic output.

Cover image for claude -p alternative for CI/CD: a 50-line fix for June 15 Pricing Split

Historical context

Anthropic is projected to surpass OpenAI in annual recurring revenue by mid-2026 [per our June 30 report]. The company's pricing changes reflect a push to capture more value from heavy users. This script represents a grassroots resistance to that strategy, reminiscent of earlier hacks like the poor-claude project that built a persistent workspace [per our May 17 article].

What to watch

Watch for Anthropic's response: either a patch that blocks the kill command in interactive mode, or a revised pricing FAQ that closes the loophole. If the trick spreads widely, Anthropic may accelerate the timeline for deprecating subscription-based interactive sessions entirely.


Sources cited in this article

  1. HammerMei
  2. Anthropic
  3. Anthropic's
  4. Claude
Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from 4 verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

This hack is a textbook example of billing arbitrage in AI infrastructure. Anthropic's pricing split — per-token for `-p` calls, flat-rate for interactive sessions — creates an incentive structure where users can game the system by wrapping a one-shot prompt in an interactive session wrapper. The 50-line script is simple but effective, exploiting the fact that Claude's interactive mode hasn't been hardened against self-termination. Compare this to the earlier `poor-claude` project [per our May 17 article], which used a 3,000-line daemon with MCP Channels for persistent workspaces. That solution was over-engineered for the CI/CD use case, and this lighter approach shows the community quickly iterating toward minimal friction. The real tension is between Anthropic's revenue goals and user expectations. The company wants to monetize automated usage, but the subscription model creates a fixed-cost mental model for users who view Claude as a utility. This hack will likely spread through GitHub Actions and cron job communities, forcing Anthropic to either patch the behavior or accept revenue leakage. The company's projected ARR surpassing OpenAI [per our June 30 report] suggests they have margin to absorb this, but the principle matters for future pricing strategy. A structural observation: this is the same pattern we saw with GitHub Copilot's early pricing — users found ways to route API calls through the IDE client to avoid per-token charges. The platform always wins eventually, but the cat-and-mouse game reveals where users perceive value vs. cost.
Compare side-by-side
Claude AI vs claude_task.py
Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Open Source

View all