[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75751":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":13,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},75751,"shannon","dexhorthy\u002Fshannon","dexhorthy","alternative to claude -p that lifecycles interactive sessions in tmux",null,"TypeScript",236,17,2,1,0,9,79,3.77,"MIT License",false,"main",true,[],"2026-06-12 02:03:35","# Shannon\n\nShannon 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.\n\n```mermaid\nflowchart LR\n    User([Your code \u002F shell])\n    subgraph Shannon[\"@dexh\u002Fshannon\"]\n      SDK[\"SDK\u003Cbr\u002F>query()\"]\n      CLI[\"CLI\u003Cbr\u002F>shannon\"]\n    end\n    subgraph Host[\"Local host\"]\n      Tmux[\"tmux session\"]\n      Claude[\"claude (interactive)\"]\n      Transcript[(\"~\u002F.claude\u002Fprojects\u003Cbr\u002F>transcript JSONL\")]\n    end\n    Anthropic[[\"Anthropic API\"]]\n\n    User -->|\"prompt\"| SDK\n    User -->|\"prompt\"| CLI\n    SDK -->|\"spawns\"| CLI\n    CLI -->|\"sends keys\"| Tmux\n    Tmux --> Claude\n    Claude \u003C-->|\"HTTPS\"| Anthropic\n    Claude -->|\"appends\"| Transcript\n    CLI -->|\"tails\"| Transcript\n    CLI -->|\"stream-json \u002F json \u002F text\"| User\n```\n\nThe 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.\n\n## Requirements\n\n- [Bun](https:\u002F\u002Fbun.sh)\n- `claude` on `PATH`\n- `tmux` on `PATH`\n- A working Claude Code login\n\n## CLI\n\nRun without installing:\n\n```sh\nnpx @dexh\u002Fshannon -p \"Reply with exactly: hello\" --output-format=stream-json --verbose\n```\n\nOr install globally:\n\n```sh\nnpm install -g @dexh\u002Fshannon\nshannon -p \"Reply with exactly: hello\" --output-format=stream-json --verbose\n```\n\nOutput formats: `stream-json` (JSONL), `json` (single array), `text` (final result text).\n\n## SDK\n\n```sh\nnpm install @dexh\u002Fshannon\n```\n\n```ts\nimport { query } from \"@dexh\u002Fshannon\";\n\nfor await (const message of query({\n  prompt: \"Reply with exactly: hello\",\n  options: { outputFormat: \"stream-json\", verbose: true },\n})) {\n  console.log(JSON.stringify(message));\n}\n```\n\nAsync input is also accepted for finite user-message streams:\n\n```ts\nimport { query, type ShannonUserMessage } from \"@dexh\u002Fshannon\";\n\nasync function* messages(): AsyncIterable\u003CShannonUserMessage> {\n  yield {\n    type: \"user\",\n    message: {\n      role: \"user\",\n      content: [{ type: \"text\", text: \"Reply with exactly: hello\" }],\n    },\n    parent_tool_use_id: null,\n    session_id: \"\",\n  };\n}\n\nfor await (const message of query({ prompt: messages() })) {\n  console.log(JSON.stringify(message));\n}\n```\n\nPass an `AbortController` in options to terminate the underlying Shannon subprocess.\n\n## Agent SDK facade\n\n`@dexh\u002Fshannon-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`).\n\n```sh\nnpm install @dexh\u002Fshannon-agent-sdk\n```\n\n```ts\nimport { query } from \"@dexh\u002Fshannon-agent-sdk\";\n\nfor await (const message of query({\n  prompt: \"Reply with exactly: hello\",\n  options: { outputFormat: \"stream-json\", verbose: true },\n})) {\n  console.log(JSON.stringify(message));\n}\n```\n\n## Development\n\n```sh\nbun install\nbun test\nbun run typecheck\nbun .\u002Findex.ts -p \"hello\" --output-format=stream-json --verbose\n```\n","Shannon 是一个基于 TypeScript 的命令行工具和 SDK，用于替代 claude -p 命令，在 tmux 中管理交互式会话。它通过驱动真实的 claude 会话并读取磁盘上的转录文件来实现功能，而不是直接调用 Anthropic API。支持多种输出格式如 `stream-json`、`json` 和 `text`，并且可以通过 CLI 或 SDK 方式使用。适用于需要在本地环境中与 Claude AI 进行交互的开发者，特别是那些希望在 tmux 会话中管理和监控对话过程的场景。","2026-06-11 03:53:12","CREATED_QUERY"]