[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79970":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":13,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":8,"rankLanguage":8,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":8,"pushedAt":8,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},79970,"claude-p","Equality-Machine\u002Fclaude-p","Equality-Machine",null,"Python",86,12,76,1,0,6,10,5,46.34,"MIT License",false,"main",true,[],"2026-06-12 04:01:26","# claude-p — bring `claude -p` back to subscription users\n\n> Use what you already paid for: `claude -p`-style automation on top of your\n> interactive Claude Code subscription session.\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fclaude-p.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fclaude-p\u002F)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](LICENSE)\n[![GitHub release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002FEquality-Machine\u002Fclaude-p)](https:\u002F\u002Fgithub.com\u002FEquality-Machine\u002Fclaude-p\u002Freleases)\n\n`claude-p` is a `claude -p` compatible CLI and Python SDK backed by the\ninteractive Claude Code TUI.\n\n[中文说明](#中文说明) is included below.\n\nIt is built for the annoying gap where interactive Claude Code works with your\nsubscription login, but `claude -p` \u002F programmatic agent workflows are limited,\ncapped, or unavailable in the environment you are using.\n\n## Why claude-p\n\nClaude Code users increasingly rely on `claude -p` for scripts, agent harnesses,\nlocal evals, CI-like workflows, and one-off automations. But in some setups,\nprogrammatic `claude -p` usage does not behave like the interactive subscription\nsession you already pay for.\n\n`claude-p` bridges that gap.\n\nIt exposes the **interactive** Claude Code TUI through a `claude -p`-compatible\nCLI and an Agent-SDK-shaped Python API:\n\n- no Anthropic API key required;\n- no new account;\n- no new subscription;\n- same local Claude Code login state;\n- familiar `claude -p` output formats: `text`, `json`, and `stream-json`.\n\nUnder the hood, `claude-p` starts interactive `claude` in a pseudo-TTY, assigns a\nsession id, waits for the response, then reads Claude Code's canonical session\nJSONL so the final output is not dependent on lossy terminal scraping.\n\n## 30-second quickstart\n\nRecommended for CLI use:\n\n```bash\nuv tool install claude-p --force\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\nIf you prefer installing into your current Python environment, use Python 3.10+\nand call pip through that interpreter:\n\n```bash\npython -m pip install claude-p\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\n![claude-p CLI demo](assets\u002Fclaude-p-cli.gif)\n\nDefault output is plain text, just like `claude -p`.\n\nStructured outputs work too:\n\n```bash\nclaude-p \"Respond exactly: hello\" --output-format json\nclaude-p \"Respond exactly: hello\" --output-format stream-json --include-partial-messages\n```\n\nIf the smoke command does not print `CLAUDE_P_OK`, run:\n\n```bash\nclaude-p --doctor\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2 --raw-log \u002Ftmp\u002Fclaude-p-smoke.raw.log\n```\n\nThe raw log shows the real interactive Claude Code TUI state: workspace trust\nprompts, auth problems, rate limits, MCP startup failures, or other local blocks.\n\n## Drop-in compatibility\n\n| If you use | Try |\n|---|---|\n| `claude -p \"prompt\"` | `claude-p \"prompt\"` |\n| `claude -p --output-format json \"prompt\"` | `claude-p --output-format json \"prompt\"` |\n| `claude -p --output-format stream-json` | `claude-p --output-format stream-json` |\n| `claude -p --model sonnet` | `claude-p --model sonnet` |\n| `claude -p --tools ''` | `claude-p --tools ''` |\n| `claude -p --permission-mode default` | `claude-p --permission-mode default` |\n| `from claude_agent_sdk import query` | `from claude_p import query` |\n\n`claude-p` accepts a broad subset of Claude Code CLI flags, including:\n\n- `-p`, `--print`\n- `--model`\n- `--tools`\n- `--permission-mode`\n- `--output-format text|json|stream-json`\n- `--include-partial-messages`\n- `--session-id`\n- `--cwd`\n- common context\u002Fconfig flags such as `--system-prompt`,\n  `--append-system-prompt`, `--mcp-config`, `--settings`, `--plugin-dir`,\n  `--allowedTools`, `--disallowedTools`, `--resume`, and `--continue`\n\n## Python SDK\n\nThe API is intentionally shaped like the official Claude Agent SDK.\n\n```python\nimport asyncio\nfrom claude_p import ClaudePOptions, query\n\n\nasync def main():\n    options = ClaudePOptions(\n        model=\"sonnet\",\n        tools=\"default\",\n        permission_mode=\"default\",\n    )\n\n    async for message in query(\"How many files are in this directory?\", options=options):\n        print(message)\n\n\nasyncio.run(main())\n```\n\nFor a single final result:\n\n![claude-p Python SDK demo](assets\u002Fclaude-p-sdk.gif)\n\n```python\nimport asyncio\nfrom claude_p import ClaudePClient, ClaudePOptions\n\n\nasync def main():\n    async with ClaudePClient(ClaudePOptions(model=\"sonnet\")) as client:\n        result = await client.run(\"Respond exactly: SDK_OK\")\n        print(result.result)\n\n\nasyncio.run(main())\n```\n\n## How it works\n\n`claude-p` does **not** call `claude -p`.\n\nIt:\n\n1. starts interactive `claude` in a pseudo-TTY;\n2. passes a deterministic `--session-id`;\n3. waits for the TUI response to complete;\n4. reads Claude Code's canonical session JSONL from\n   `~\u002F.claude\u002Fprojects\u002F**\u002F\u003Csession-id>.jsonl`;\n5. emits text\u002Fjson\u002Fstream-json output compatible with `claude -p`.\n\nThe session JSONL step matters. Terminal rendering is lossy: cursor redraws,\nspinners, and wide glyphs can drop characters in captured TTY output. The JSONL\nsession record is the stable source of truth for final `assistant` and `result`\ntext.\n\n## What works today\n\n- Plain text output by default.\n- JSON single-result output.\n- Core `stream-json` event shape.\n- Tool use through the interactive Claude Code session.\n- Python SDK with `query(...)` and `ClaudePClient(...).run(...)`.\n- Global console command after `uv tool install claude-p` or `python -m pip install claude-p`.\n\n## Known limits\n\n`claude-p` is a developer convenience tool, not a replacement for the official\nAnthropic API.\n\nCurrent limits:\n\n- Token usage, cost, and exact rate-limit fields are best-effort placeholders.\n- Hook lifecycle events from `claude -p --include-hook-events` are not replayed yet.\n- `--input-format stream-json` is accepted but not implemented.\n- `--bare` conflicts with the subscription-login goal because Claude bare mode\n  bypasses OAuth\u002Fkeychain auth.\n- TUI automation can break if Claude Code significantly changes its interactive\n  interface or local session storage.\n\nFor production agent workloads, use the official Anthropic API \u002F official Claude\nAgent SDK when possible.\n\n## Verification checklist\n\nFor a manual install, these two commands should produce the same kind of visible\ndemo result as the README GIF:\n\n```bash\nuv tool install claude-p --force\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\nExpected output:\n\n```text\nCLAUDE_P_OK\n```\n\nFor an LLM\u002Fagent asked to install and verify this repository from source, use:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FEquality-Machine\u002Fclaude-p.git\ncd claude-p\nuv run --with pytest pytest tests -q\nuv tool install . --force\nclaude-p --doctor\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2 --raw-log \u002Ftmp\u002Fclaude-p-smoke.raw.log\n```\n\nIf the final command does not print `CLAUDE_P_OK`, inspect\n`\u002Ftmp\u002Fclaude-p-smoke.raw.log` before guessing. The failure is usually in the\nlocal interactive Claude Code state, not in PyPI installation.\n\n## FAQ\n\n### Is this bypassing authentication?\n\nNo. `claude-p` uses your local authenticated Claude Code session. If interactive\nClaude Code does not work on your machine, `claude-p` will not magically make it\nwork.\n\n### Is this avoiding billing or rate limits?\n\nNo. It does not remove Anthropic-side rate limits or account policy. It exposes\nyour interactive Claude Code session through a programmatic interface. Any limits\nthat apply to your account still apply.\n\n### Why not just use `claude -p`?\n\nIf `claude -p` works for your use case, keep using it. `claude-p` is for\nenvironments where interactive Claude Code works with subscription login state,\nbut `claude -p` \u002F programmatic usage is unavailable or hits a different limit\nsurface first.\n\n### Why read session JSONL instead of terminal text?\n\nBecause terminal capture is not reliable enough for exact agent output. In local\ntesting, the rendered terminal surface dropped characters during redraws, while\nClaude Code's session JSONL contained the exact final assistant message.\n\n### Will this break?\n\nPossibly. It depends on interactive Claude Code behavior and local session JSONL\nformat. The project is intentionally small so breakages can be fixed quickly.\n\n## Installation troubleshooting\n\n`claude-p` requires Python 3.10+ and an existing local Claude Code login.\n\nThe most reliable installation path for end users is:\n\n```bash\nuv tool install claude-p --force\nclaude-p --help\nclaude-p \"Respond exactly: OK\" --tools ''\n```\n\nIf `uv` is not installed:\n\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\nexec $SHELL -l\nuv tool install claude-p --force\n```\n\nIf you prefer `pip`, use `python -m pip` from a Python 3.10+ interpreter:\n\n```bash\npython --version\npython -m pip install claude-p\npython -m pip show -f claude-p\nwhich claude-p\n```\n\nCommon install failures:\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `zsh: command not found: pip` | Your shell has no `pip` command on `PATH`. | Use `python -m pip ...` or `uv tool install claude-p`. |\n| `No matching distribution found for claude-p` | Usually an old Python\u002Fpip pair, or Python \u003C 3.10. | Check `python3 --version`; install with `uv tool install claude-p`, or use a modern Python such as 3.11\u002F3.12. |\n| `claude-p: command not found` after install | Python's scripts directory is not on `PATH`. | Add `~\u002F.local\u002Fbin` to `PATH`, or use `uv tool run claude-p ...`. |\n| Import works in one terminal but not another | `pip` and `python` point to different environments. | Always run `python -m pip install claude-p` inside the environment you will use. |\n\nFor conda\u002Fvenv users, activate the environment first:\n\n```bash\nconda activate your-env\npython -m pip install claude-p\nwhich python\nwhich claude-p\nclaude-p \"Respond exactly: OK\"\n```\n\nOn macOS, avoid relying on the Apple Command Line Tools `pip3` if it is old. It\nmay not see modern wheels correctly. Prefer `uv tool install claude-p`, Homebrew\nPython, or a conda\u002Fvenv environment.\n\n## Development and release flow\n\nBranching:\n\n- `main`: released versions only.\n- `dev`: integration branch.\n- `feat\u002F\u003Cname>`: feature branches opened from `dev`.\n\nLocal validation:\n\n```bash\nuv run --with pytest pytest tests -q\nuv build\nuvx twine check dist\u002F*\npython -m venv \u002Ftmp\u002Fclaude-p-smoke\n\u002Ftmp\u002Fclaude-p-smoke\u002Fbin\u002Fpython -m pip install dist\u002F*.whl\n\u002Ftmp\u002Fclaude-p-smoke\u002Fbin\u002Fclaude-p \"Respond exactly: SMOKE_OK\" --tools ''\n```\n\nRelease:\n\n1. Merge feature branch into `dev`.\n2. Open PR from `dev` to `main`.\n3. After merge, create a GitHub release tag, for example `v0.1.1`.\n4. The `publish.yml` workflow publishes to PyPI when PyPI Trusted Publishing is configured.\n\n## 中文说明\n\n`claude-p` 是一个兼容 `claude -p` 调用方式的命令行工具和 Python SDK。它不调用\n`claude -p` 本身，而是把交互式 Claude Code TUI 包装成可编程接口，让你在已经登录\nClaude Code 订阅账号的环境里，用类似 `claude -p` 的方式跑脚本、agent harness、本地\n评测和一次性自动化任务。\n\n一句话：**把你已经付费、已经登录的交互式 Claude Code subscription 用到程序化工作流里。**\n\n### 为什么需要 claude-p\n\n很多 Claude Code 用户会把 `claude -p` 用在这些场景：\n\n- shell 脚本和本地自动化；\n- agent runner \u002F benchmark harness；\n- 本地 eval 和 CI-like 工作流；\n- 需要 JSON 或 stream-json 输出的工具链；\n- Python 代码里调用 Claude agent。\n\n但在一些环境里，交互式 Claude Code 可以正常使用订阅账号登录态，而 `claude -p` 或\nprogrammatic agent workflow 会遇到不同的额度、限制或不可用状态。\n\n`claude-p` 的目标就是补这个 gap：\n\n- 不需要 Anthropic API key；\n- 不需要新账号；\n- 不需要新订阅；\n- 使用本机已有 Claude Code 登录态；\n- 默认输出纯文本，支持 `json` 和 `stream-json`；\n- 提供接近 Claude Agent SDK 形态的 Python API。\n\n### 30 秒上手\n\n推荐给命令行用户的安装方式：\n\n```bash\nuv tool install claude-p --force\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\n如果你想安装到当前 Python 环境里，请使用 Python 3.10+，并通过这个 Python 调 pip：\n\n```bash\npython -m pip install claude-p\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\n默认输出是纯文本，和 `claude -p` 的常用体验一致。\n\n也可以输出结构化结果：\n\n```bash\nclaude-p \"Respond exactly: hello\" --output-format json\nclaude-p \"Respond exactly: hello\" --output-format stream-json --include-partial-messages\n```\n\n如果 smoke 命令没有打印 `CLAUDE_P_OK`，先跑：\n\n```bash\nclaude-p --doctor\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2 --raw-log \u002Ftmp\u002Fclaude-p-smoke.raw.log\n```\n\nraw log 里能看到真实的交互式 Claude Code TUI 状态：workspace trust、auth、额度限制、\nMCP 启动失败或其他本地阻塞。不要只看表层“没输出”。\n\n### Drop-in 替换\n\n| 你现在使用 | 可以尝试 |\n|---|---|\n| `claude -p \"prompt\"` | `claude-p \"prompt\"` |\n| `claude -p --output-format json \"prompt\"` | `claude-p --output-format json \"prompt\"` |\n| `claude -p --output-format stream-json` | `claude-p --output-format stream-json` |\n| `claude -p --model sonnet` | `claude-p --model sonnet` |\n| `claude -p --tools ''` | `claude-p --tools ''` |\n| `claude -p --permission-mode default` | `claude-p --permission-mode default` |\n| `from claude_agent_sdk import query` | `from claude_p import query` |\n\n当前支持的常用参数包括：\n\n- `-p`, `--print`\n- `--model`\n- `--tools`\n- `--permission-mode`\n- `--output-format text|json|stream-json`\n- `--include-partial-messages`\n- `--session-id`\n- `--cwd`\n- 常见上下文和配置参数，例如 `--system-prompt`、`--append-system-prompt`、\n  `--mcp-config`、`--settings`、`--plugin-dir`、`--allowedTools`、\n  `--disallowedTools`、`--resume`、`--continue`\n\n### Python SDK\n\nSDK 的形态尽量贴近官方 Claude Agent SDK，方便已有代码迁移。\n\n```python\nimport asyncio\nfrom claude_p import ClaudePOptions, query\n\n\nasync def main():\n    options = ClaudePOptions(\n        model=\"sonnet\",\n        tools=\"default\",\n        permission_mode=\"default\",\n    )\n\n    async for message in query(\"How many files are in this directory?\", options=options):\n        print(message)\n\n\nasyncio.run(main())\n```\n\n如果只需要最终结果：\n\n```python\nimport asyncio\nfrom claude_p import ClaudePClient, ClaudePOptions\n\n\nasync def main():\n    async with ClaudePClient(ClaudePOptions(model=\"sonnet\")) as client:\n        result = await client.run(\"Respond exactly: SDK_OK\")\n        print(result.result)\n\n\nasyncio.run(main())\n```\n\n### 工作原理\n\n`claude-p` 不会直接调用 `claude -p`。\n\n它的流程是：\n\n1. 在 pseudo-TTY 里启动交互式 `claude`；\n2. 传入确定性的 `--session-id`；\n3. 等待 TUI 响应完成；\n4. 从 Claude Code 的本地 session JSONL 读取结果：\n   `~\u002F.claude\u002Fprojects\u002F**\u002F\u003Csession-id>.jsonl`；\n5. 输出兼容 `claude -p` 的 `text`、`json` 或 `stream-json`。\n\n读取 session JSONL 是关键设计。直接抓终端文本是不可靠的：TUI 的光标重绘、\nspinner、宽字符和 redraw 都可能让捕获文本丢字。Claude Code 的 session JSONL 才是\n最终 assistant message 和 result 的稳定来源。\n\n### 当前可用能力\n\n- 默认纯文本输出；\n- 单次 JSON 结果输出；\n- 核心 `stream-json` event shape；\n- 通过交互式 Claude Code session 使用工具；\n- Python SDK：`query(...)` 和 `ClaudePClient(...).run(...)`；\n- 通过 `uv tool install claude-p` 或 `python -m pip install claude-p` 安装后提供\n  全局命令 `claude-p`。\n\n### 已知限制\n\n`claude-p` 是开发者便利工具，不是官方 Anthropic API 的替代品。\n\n当前限制：\n\n- token usage、cost、rate-limit 字段是 best-effort placeholder；\n- 暂不回放 `claude -p --include-hook-events` 的 hook lifecycle events；\n- 接受 `--input-format stream-json` 参数，但尚未实现；\n- `--bare` 与订阅登录态目标冲突，因为 Claude bare mode 会绕过 OAuth\u002Fkeychain auth；\n- 如果 Claude Code 大幅改变交互式 TUI 或本地 session 存储格式，可能需要适配。\n\n生产级 agent workload 仍建议优先使用官方 Anthropic API \u002F 官方 Claude Agent SDK。\n\n### 验证清单\n\n手动安装时，这两条命令应该给出和 README GIF 同类的可见 demo 结果：\n\n```bash\nuv tool install claude-p --force\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2\n```\n\n期望输出：\n\n```text\nCLAUDE_P_OK\n```\n\n如果把仓库交给另一个大模型\u002Fagent 安装和验证，让它按这组命令走：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FEquality-Machine\u002Fclaude-p.git\ncd claude-p\nuv run --with pytest pytest tests -q\nuv tool install . --force\nclaude-p --doctor\nclaude-p \"Respond exactly: CLAUDE_P_OK\" --tools '' --timeout-sec 45 --quiet-after-sec 2 --raw-log \u002Ftmp\u002Fclaude-p-smoke.raw.log\n```\n\n如果最后没有打印 `CLAUDE_P_OK`，先检查 `\u002Ftmp\u002Fclaude-p-smoke.raw.log`，不要直接猜原因。\n大多数失败来自本机交互式 Claude Code 状态，而不是 PyPI 安装。\n\n### FAQ\n\n#### 这是绕过登录认证吗？\n\n不是。`claude-p` 使用的是你本机已经认证过的 Claude Code session。如果你的机器上交互式\nClaude Code 本来不能用，`claude-p` 也不会让它凭空可用。\n\n#### 这是绕过计费或 rate limit 吗？\n\n不是。它不会移除 Anthropic 侧的 rate limit 或账号策略。它只是把你的交互式 Claude\nCode session 暴露成程序化接口；所有适用于你账号的限制仍然适用。\n\n#### 为什么不直接用 `claude -p`？\n\n如果 `claude -p` 已经满足你的需求，继续用它即可。`claude-p` 是给这些场景准备的：\n交互式 Claude Code 可以用订阅登录态正常工作，但 `claude -p` 或 programmatic usage\n不可用，或者先碰到不同的限制面。\n\n#### 为什么读取 session JSONL，而不是读取终端文本？\n\n因为终端捕获不够可靠。实际测试里，TUI 渲染层会在 redraw 过程中丢字符，但 Claude\nCode 的 session JSONL 包含准确的最终 assistant message。\n\n#### 会不会失效？\n\n可能。它依赖交互式 Claude Code 行为和本地 session JSONL 格式。项目保持很小，是为了\n在 Claude Code 变化时能快速修复。\n\n### 安装排查\n\n`claude-p` 需要 Python 3.10+，并且需要本机已有可用的 Claude Code 登录态。\n\n对普通用户最稳的安装方式是：\n\n```bash\nuv tool install claude-p --force\nclaude-p --help\nclaude-p \"Respond exactly: OK\" --tools ''\n```\n\n如果还没有 `uv`：\n\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\nexec $SHELL -l\nuv tool install claude-p --force\n```\n\n如果你更想用 `pip`，请从 Python 3.10+ 解释器调用 pip：\n\n```bash\npython --version\npython -m pip install claude-p\npython -m pip show -f claude-p\nwhich claude-p\n```\n\n常见安装失败：\n\n| 现象 | 原因 | 解决方式 |\n|---|---|---|\n| `zsh: command not found: pip` | 当前 shell 里没有 `pip` 命令。 | 用 `python -m pip ...`，或直接 `uv tool install claude-p`。 |\n| `No matching distribution found for claude-p` | 通常是 Python\u002Fpip 太旧，或 Python 版本低于 3.10。 | 先看 `python3 --version`；推荐 `uv tool install claude-p`，或换 Python 3.11\u002F3.12。 |\n| 安装后 `claude-p: command not found` | Python scripts 目录不在 `PATH`。 | 把 `~\u002F.local\u002Fbin` 加到 `PATH`，或用 `uv tool run claude-p ...`。 |\n| 一个终端能 import，另一个不行 | `pip` 和 `python` 指向不同环境。 | 在目标环境里始终使用 `python -m pip install claude-p`。 |\n\nconda \u002F venv 用户：\n\n```bash\nconda activate your-env\npython -m pip install claude-p\nwhich python\nwhich claude-p\nclaude-p \"Respond exactly: OK\"\n```\n\nmacOS 用户不要优先依赖 Apple Command Line Tools 自带的旧 `pip3`。它可能看不到现代\nPython wheel 或因为 Python 版本太低报 `No matching distribution found`。优先使用\n`uv tool install claude-p`、Homebrew Python，或 conda\u002Fvenv。\n\n### 开发和发布流程\n\n分支约定：\n\n- `main`：只放已经发布的版本；\n- `dev`：集成分支；\n- `feat\u002F\u003Cname>`：从 `dev` 拉出的功能分支。\n\n本地验证：\n\n```bash\nuv run --with pytest pytest tests -q\nuv build\nuvx twine check dist\u002F*\npython -m venv \u002Ftmp\u002Fclaude-p-smoke\n\u002Ftmp\u002Fclaude-p-smoke\u002Fbin\u002Fpython -m pip install dist\u002F*.whl\n\u002Ftmp\u002Fclaude-p-smoke\u002Fbin\u002Fclaude-p \"Respond exactly: SMOKE_OK\" --tools ''\n```\n\n发布流程：\n\n1. 将 feature branch 合并到 `dev`；\n2. 从 `dev` 向 `main` 开 PR；\n3. 合并后创建 GitHub release tag，例如 `v0.1.1`；\n4. 如果 PyPI Trusted Publishing 已配置，`publish.yml` workflow 会自动发布到 PyPI。\n\n## License\n\nMIT\n","claude-p 是一个兼容 `claude -p` 的命令行工具和Python SDK，旨在为Claude Code订阅用户提供自动化功能。其核心功能是通过交互式的Claude Code TUI支持 `claude -p` 风格的自动化工作流，无需额外的API密钥、新账户或新订阅。该项目采用Python编写，支持文本、JSON和流式JSON输出格式，并且能够保持与本地登录状态的一致性。适合需要在已有Claude Code订阅环境下进行脚本编写、代理封装、本地评估或一次性自动化的场景使用。",2,"2026-06-11 03:58:43","CREATED_QUERY"]