Skip to main content

Like `claude -p`, but driven through an interactive Claude Code session.

Project description

claude-i

Like claude -p, but driven through an interactive Claude Code session.

The interactive claude CLI loads everything (hooks, MCPs, skills, plugins); claude -p is headless and skips a lot of it. claude-i bridges the two: it scripts an interactive session inside a headless tmux, captures the final assistant message via a gated Stop hook, and tears down the process tree on exit.

Status

v0.2.4 — production-ready for both interactive use and non-interactive automation. This release includes the v0.2.3 long-prompt / @agent / slash-skill fixes, late Stop-hook artifact cleanup, clearer Bug 5 retry guidance, and Node 24-ready CI/release infrastructure.

Install

Native Windows is not supported; use WSL2. The claude-i CLI emits PLATFORM_ERROR=3 on sys.platform == "win32" (G9 platform guard, STORY-001.2).

Option 1 — PyPI (recommended)

pipx install claude-i
# or: uv tool install claude-i

Option 2 — Homebrew (macOS / Linux)

brew tap rafaelscosta/claude-i
brew install claude-i

Option 3 — pipx + GitHub Release

pipx install https://github.com/rafaelscosta/claude-i/releases/download/v0.2.4/claude_i-0.2.4-py3-none-any.whl

Option 4 — pipx + git tag

pipx install git+https://github.com/rafaelscosta/claude-i.git@v0.2.4

Option 5 — sdist (uv-compatible)

pipx install https://github.com/rafaelscosta/claude-i/releases/download/v0.2.4/claude_i-0.2.4.tar.gz
# or: uv tool install https://github.com/rafaelscosta/claude-i/releases/download/v0.2.4/claude_i-0.2.4.tar.gz

Verify

claude-i --version    # → claude-i 0.2.4
claude-i doctor       # self-diagnostic — should report 5/5 PASS

Artifact checksums

Checksums are published with the GitHub Release assets. For local verification:

shasum -a 256 claude_i-0.2.4-py3-none-any.whl claude_i-0.2.4.tar.gz

Usage

Interactive (single-shot)

claude-i "What is 2+2?"
# → 4

Non-interactive automation / CI / scripts

Use --retries N to absorb the upstream Anthropic-side burst-load session hang (Bug 5 in NOTES.md):

claude-i --retries 3 "<prompt>"

The runner spawns a fresh tmux session on each retry. Recommended:

Use case Invocation
Interactive single-shot claude-i "<prompt>"
Automation / CI scripts claude-i --retries 3 "<prompt>"
High-burst pipeline claude-i --retries 5 "<prompt>" + 2s sleep between calls

If the final stderr contains No Stop hook signal, the CLI now classifies it as the documented Bug 5 environmental/upstream hang and suggests the retry level above. Run claude-i doctor first; if doctor is green, treat the timeout as host/upstream saturation rather than a payload parsing regression.

Script-friendly first run

On the very first invocation, claude-i prompts to install its Stop hook. In a non-TTY context (CI, redirected stdin) this would normally fail with EOFError. Opt into auto-install:

export CLAUDE_I_AUTO_INSTALL_HOOK=1
claude-i --retries 3 "<prompt>"

JSON output

claude-i --output-format json --retries 3 "<prompt>"
# → {"text": "...", "cost_usd": null, "tokens_in": null, "tokens_out": null, "duration_ms": 4231}

Subcommands

claude-i doctor                  # self-diagnostic (5 checks; --json for machine-readable)
claude-i uninstall               # remove the Stop hook from settings.json
claude-i reap                    # kill orphaned claude-i-* tmux sessions

Exit codes

Code Meaning
0 Success
1 Runtime error (timeout, parse failure, doctor FAIL, all retries exhausted)
2 Missing dependency or config error
3 Unsupported platform (native Windows; use WSL2)

Distribution Status

v0.2.4 (2026-06-10) is the current public release. v0.2.3 fixed long prompts, agent/slash-skill invocation, and title/SKIP misattribution; v0.2.4 adds the final PyPI release hygiene and environmental hardening.

Path Status
Repository (PUBLIC) ✓ active
GitHub Release (wheel + sdist) ✓ active
Homebrew tap (rafaelscosta/claude-i) ✓ active
PyPI (pipx install claude-i) ✓ active
install.sh bootstrap (`curl sh`)

The install.sh script lives at the repo root and supports --local <path> mode using artifacts downloaded from a GitHub Release. See docs/guides/homebrew-tap.md for detailed bootstrap docs.

Origin

Forked from gist isingh/62bdfd0886b0b72bf6231c44f0389ecc. Original single-file script preserved in seed/claude-i for traceability.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_i-0.2.4.tar.gz (68.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_i-0.2.4-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file claude_i-0.2.4.tar.gz.

File metadata

  • Download URL: claude_i-0.2.4.tar.gz
  • Upload date:
  • Size: 68.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_i-0.2.4.tar.gz
Algorithm Hash digest
SHA256 ca0a6575917f945fa6cb09c858130c0ae6094500500b70d7ffd9789219c3b9dc
MD5 a7e9fedf72862c3859f5b632d5afa136
BLAKE2b-256 ebe177672eeb8eace8dfe7b272a1226c4ae1b558aed2bd6715c682fed0c69508

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_i-0.2.4.tar.gz:

Publisher: publish.yml on rafaelscosta/claude-i

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_i-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: claude_i-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_i-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6f945ae1be8c77fed6db259e7fec3cef749a3aea77164c3ec1d51cf39274c8cb
MD5 ad94bae3a73510a06e1f1ae8eb052f7d
BLAKE2b-256 b17e48f0a51f0d60fad9a250f7a47989671ef5f13a80247d90dbf8937cac2cd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_i-0.2.4-py3-none-any.whl:

Publisher: publish.yml on rafaelscosta/claude-i

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page