@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
@QingQ77: Run multiple Claude Code sessions in tmux with a pop-up picker to view each session's status, live preview, and jump to any session with one key. https://github.com/craftzdog/tmux-claude-session-manager…
A tmux plugin that lets you run multiple Claude Code sessions in separate tmux windows, with a central fzf picker showing live status and previews, and the ability to jump between sessions.
@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.
@LangChain: We built a plugin that traces every Claude Code session straight into LangSmith. Three commands, one JSON block, and ev…
LangChain released a plugin that logs all Claude Code sessions into LangSmith for debugging, with a quick three-command setup.
@adocomplete: Your sessions have names and can DM each other in Claude Code. claude --name backend claude --name frontend > tell fron…
A tweet highlights that Claude Code sessions can now be named and message each other directly, allowing developers to coordinate multiple coding sessions via CLI commands.
@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.