惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
B
Blog
S
SegmentFault 最新的问题
Vercel News
Vercel News
博客园 - 聂微东
宝玉的分享
宝玉的分享
C
Check Point Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
V
V2EX
爱范儿
爱范儿
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
博客园 - 司徒正美
博客园_首页
Last Week in AI
Last Week in AI
博客园 - 叶小钗
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Fortinet All Blogs
腾讯CDC
J
Java Code Geeks

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
claude -p alternative for CI/CD: a 50-line fix for June 1...
Mei Hammer · 2026-05-18 · via DEV Community
Cover image for claude -p alternative for CI/CD: a 50-line fix for June 15 Pricing Split

Mei Hammer

This is a follow-up to my previous post where I built poor-claude to keep my AI family alive. That solution uses MCP Channels and a persistent session daemon — powerful, but a lot of machinery. After publishing, I realised: most people using claude -p in CI/CD pipelines don't need any of that.


The use case

You have a script. It calls claude -p "review this PR diff" or claude -p "generate release notes". It runs in GitHub Actions. It runs on a cron job. It doesn't need conversation history. It just needs an answer.

After June 15, that call costs API money. All you want is to keep it on your subscription.


The trick

When you run claude "hello" without -p, it starts an interactive session — which stays on subscription billing. The problem is interactive mode doesn't exit after responding.

Unless you ask it to.

do X.

Write your response to: /tmp/response-abc123.txt
Then run in bash: kill $PPID

Enter fullscreen mode Exit fullscreen mode

$PPID inside a bash subprocess is the PID of the claude process itself. Claude writes the output, runs kill $PPID, and exits cleanly. Your script reads the file. Done.


The implementation

The full script is here:
👉 claude_task.py

Drop it in your repo. Call it like claude -p. That's it.


When to use this vs poor-claude

This gist poor-claude
CI/CD one-shot tasks overkill
Conversational agents
Setup required none daemon + MCP
Latency (cold start) same as claude -p fast after 1st request
Code 50 lines ~3000 lines

If you're running claude -p in GitHub Actions or a cron job, this is probably all you need.


The caveat

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, and you'll be fine.


— hammer.mei