claude-cli-agent-protocol

Enable NDJSON streaming, tool approvals, and process control for headless Claude CLI hosts.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-cli-agent-protocol
Source: https://github.com/bohdan-shulha/skills/tree/main/claude-cli-agent-protocol
Command: npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Claude-based workflows often require headless control of Claude Code CLI, enabling reliable NDJSON streaming, tool approvals, and lifecycle management without a graphical interface.

Core Features & Use Cases

  • Bidirectional NDJSON streaming for init, events, tool usage, and results.
  • Built-in tool-approval flow via control_request/control_response to authorize commands during a session.
  • Robust lifecycle handling for normal and interrupted requests, including permission modes and long-running processes.

Quick Start

Start Claude CLI in headless mode with stream-json I/O and permission prompts, then connect your host to drive tool approvals and session lifecycle.

Frequently Asked Questions about claude-cli-agent-protocol

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

FAQPage Schema
How do I run Claude CLI in headless mode with NDJSON streaming?

To run Claude CLI in headless mode, start the process with stream-json I/O and permission prompts. This enables bidirectional NDJSON streaming for initialization, events, tool usage, and results without a graphical interface.

How does tool approval work in a headless Claude CLI agent setup?

Tool approval in a headless Claude CLI setup uses control_request and control_response exchanges. The host receives a permission prompt via NDJSON and sends a control response back to authorize commands during the session.

Can I manage long-running processes and interrupted requests with Claude CLI?

Yes, you can manage long-running processes and interrupted requests with Claude CLI. The protocol provides robust lifecycle handling for both normal and interrupted requests, including configurable permission modes for host-driven workflows.

Do I need a SKILL.md file to integrate Claude CLI as an agent?

Yes, you need a SKILL.md file at the root directory to integrate Claude CLI as an agent. The CLI protocol explicitly requires this file to contain a valid name and description for the workflow to function correctly.

What is the best way to automate Claude Code CLI without a graphical interface?

The best way to automate Claude Code CLI without a graphical interface is using a host-driven workflow with NDJSON streaming. This approach enforces the CLI protocol requirements, handling tool approvals and process control bidirectionally.