session-execution

Execute shell commands across sessions with separate stdout and stderr streams.

1.1k|107|Updated Jun 22, 2025
One-click install
npx skills add https://github.com/cloudflare/sandbox-sdk --skill session-execution
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-execution
Source: https://github.com/cloudflare/sandbox-sdk/tree/main/.opencode/skill/session-execution
Command: npx skills add https://github.com/cloudflare/sandbox-sdk --skill session-execution

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves reliable session-based command execution with distinct stdout and stderr streams, enabling precise observability for shell tasks across sessions.

Core Features & Use Cases

  • Foreground execution (exec) with persistent state and output captured via temporary files for reliability.
  • Background execution (execStream/startProcess) using FIFOs to stream output without blocking the shell.
  • Atomic exit signaling via per-command exit files and robust completion detection.

Quick Start

Instantiate a session, run a simple command to observe stdout/stderr separation, and verify atomic exit signaling. Then start a long-running command in background mode and confirm that outputs are properly streamed and the final exit is detected only after the command completes.

Frequently Asked Questions about session-execution

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

FAQPage Schema
How do I execute shell commands with separated stdout and stderr streams?

This skill executes shell commands with distinct stdout and stderr streams by capturing foreground output via temporary files, ensuring precise observability for reliable session-based command execution.

What is the best way to run background shell commands without blocking the session?

Background execution uses FIFOs to stream command output without blocking the shell, allowing long-running processes to operate across multiple sessions while maintaining robust completion detection.

How does atomic exit signaling work for background process management?

Atomic exit signaling works by writing to per-command exit files, which guarantees robust completion detection so the final exit is registered only after the command actually finishes processing.

Can I manage multiple command execution sessions concurrently with mutex protection?

Yes, you can manage multiple concurrent sessions because the execution framework applies session-level mutex protection, preventing race conditions when coordinating shell commands across overlapping processes.

Why does command execution require temporary files for foreground output capture?

Foreground execution requires temporary files for output capture to guarantee persistent state and reliable output retrieval, preventing data loss when separating stdout and stderr streams during shell task execution.