claude-p

Manage Claude Code CLI subprocess lifecycles and normalize stream-json events.

1|1|Updated Jun 11, 2026
One-click install
npx skills add https://github.com/valtterimelkko/agent-workflow-skills --skill claude-p
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-p
Source: https://github.com/valtterimelkko/agent-workflow-skills/tree/main/skills/claude-p
Command: npx skills add https://github.com/valtterimelkko/agent-workflow-skills --skill claude-p

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the complexity of running Claude Code CLI sessions programmatically, specifically addressing session locking, authentication, and multi-turn state management that often causes subprocess failures.

Core Features & Use Cases

  • Session Lifecycle Management: Handles the critical distinction between initial session creation and follow-up resume turns to avoid file lock errors.
  • Stream-JSON Normalization: Provides a robust pattern for parsing and normalizing Claude's stream-json output into actionable events.
  • Use Case: Ideal for building server-side agents or automated coding harnesses that need to spawn Claude subprocesses, maintain conversation history, and extract token usage data without manual interaction.

Quick Start

Use the claude-p skill to spawn a new Claude session for the provided prompt and handle the stream-json output events.

Frequently Asked Questions about claude-p

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Claude Code CLI sessions programmatically without subprocess failures?

Programmatic Claude Code CLI session execution requires handling subprocess lifecycles, session file locking, and stream-json event normalization to prevent failures. This skill manages these complexities by enforcing strict session-id management and stdin piping configurations for automated coding harnesses.

Why do I get file lock errors when resuming multi-turn Claude Code CLI conversations?

File lock errors during multi-turn Claude Code CLI conversations occur when the distinction between initial session creation and follow-up resume turns is not handled correctly. This skill manages session lifecycle states to avoid file lock conflicts during automated multi-turn conversation continuity.

How do I parse stream-json output from Claude Code CLI into actionable events?

Parsing stream-json output from Claude Code CLI involves normalizing the event stream into structured data. This skill provides a robust pattern for stream-json normalization, allowing server-side agents to extract actionable events and token usage data without manual interaction.

Can I use Claude Code CLI subprocesses to build a server-side agent architecture?

Claude Code CLI subprocesses can be used to build server-side agent architectures by spawning isolated processes for automated coding tasks. This skill supports server-side agents requiring multi-turn conversation continuity, token usage tracking, and subscription-based authentication protocols.

Do I need subscription-based authentication to manage Claude Code CLI sessions programmatically?

Subscription-based authentication protocols are required for programmatic Claude Code CLI session management. This skill requires strict adherence to subscription-based authentication alongside session-id management and stdin piping configurations to maintain automated subprocess lifecycles.