@dexhorthy: hey surprise - you can just launch interactive in tmux and then tail the jsonl - shipped a small wrapper...ralph loop i…
Summary
Shannon is a CLI and SDK wrapper that runs an interactive Claude Code session inside tmux, allowing programmatic querying and streaming JSON output by tailing the on-disk transcript.
View Cached Full Text
Cached at: 05/14/26, 08:33 AM
hey surprise - you can just launch interactive in tmux and then tail the jsonl - shipped a small wrapper…ralph loop iterating to full parity rn https://t.co/3N4klSSEwd https://t.co/Q1ODMrVdpB
dexhorthy/shannon
Source: https://github.com/dexhorthy/shannon
Shannon
Shannon is a CLI and SDK wrapper around the interactive Claude Code CLI. It runs a real claude session inside tmux, sends a prompt, and emits stream JSON.
flowchart LR
User([Your code / shell])
subgraph Shannon["@dexh/shannon"]
SDK["SDK<br/>query()"]
CLI["CLI<br/>shannon"]
end
subgraph Host["Local host"]
Tmux["tmux session"]
Claude["claude (interactive)"]
Transcript[("~/.claude/projects<br/>transcript JSONL")]
end
Anthropic[["Anthropic API"]]
User -->|"prompt"| SDK
User -->|"prompt"| CLI
SDK -->|"spawns"| CLI
CLI -->|"sends keys"| Tmux
Tmux --> Claude
Claude <-->|"HTTPS"| Anthropic
Claude -->|"appends"| Transcript
CLI -->|"tails"| Transcript
CLI -->|"stream-json / json / text"| User
The dashed-style boundary: Shannon never calls the Anthropic API directly — it drives a real claude session and reads its on-disk transcript. claude -p is not used internally.
Requirements
- Bun
claudeonPATHtmuxonPATH- A working Claude Code login
CLI
Run without installing:
npx @dexh/shannon -p "Reply with exactly: hello" --output-format=stream-json --verbose
Or install globally:
npm install -g @dexh/shannon
shannon -p "Reply with exactly: hello" --output-format=stream-json --verbose
Output formats: stream-json (JSONL), json (single array), text (final result text).
SDK
npm install @dexh/shannon
import { query } from "@dexh/shannon";
for await (const message of query({
prompt: "Reply with exactly: hello",
options: { outputFormat: "stream-json", verbose: true },
})) {
console.log(JSON.stringify(message));
}
Async input is also accepted for finite user-message streams:
import { query, type ShannonUserMessage } from "@dexh/shannon";
async function* messages(): AsyncIterable<ShannonUserMessage> {
yield {
type: "user",
message: {
role: "user",
content: [{ type: "text", text: "Reply with exactly: hello" }],
},
parent_tool_use_id: null,
session_id: "",
};
}
for await (const message of query({ prompt: messages() })) {
console.log(JSON.stringify(message));
}
Pass an AbortController in options to terminate the underlying Shannon subprocess.
Agent SDK facade
@dexh/shannon-agent-sdk is a Claude Agent SDK-compatible facade that re-exports Shannon’s SDK surface. Full parity is a work in progress (see GOAL_PROGRESS.md).
npm install @dexh/shannon-agent-sdk
import { query } from "@dexh/shannon-agent-sdk";
for await (const message of query({
prompt: "Reply with exactly: hello",
options: { outputFormat: "stream-json", verbose: true },
})) {
console.log(JSON.stringify(message));
}
Development
bun install
bun test
bun run typecheck
bun ./index.ts -p "hello" --output-format=stream-json --verbose
Similar Articles
@tom_doerr: Runs Claude agents 24/7 inside tmux https://github.com/Jedward23/Tmux-Orchestrator…
Tmux-Orchestrator is an open-source tool that enables autonomous 24/7 operation of Claude AI agents using a multi-agent hierarchy within tmux sessions for parallel project management and coding.
@trq212: https://x.com/trq212/status/2061907337154367865
Claude Code releases dynamic workflows, enabling Claude to create custom harnesses for tasks like research, security analysis, agent teams, and code review, all natively within the tool.
Show HN: Rmux – A programmable terminal multiplexer with a Playwright-style SDK
Rmux is a new programmable terminal multiplexer written in Rust, offering a tmux-compatible CLI, a typed SDK, and features for agentic workflows, allowing detachable, scriptable terminal sessions across Linux, macOS, and Windows.
@steipete: I'm late to the party, but cmux is great. https://github.com/manaflow-ai/cmux… current split: codex mac app: knowledege…
cmux is a Ghostty-based macOS terminal with vertical tabs and notifications designed for AI coding agents, featuring SSH support, in-app browser, and Claude Code Teams integration.
claude-share
A tool to securely share Claude Code sessions with friends.