Drop-in replacement for `claude -p` that runs through mngr create/message/transcript
Project description
imbue-mngr-robinhood
robinhood is a drop-in replacement for claude -p that's implemented on top of mngr,
i.e., you can use your Max / Pro subscription
Install
# install mngr (if not already installed)
curl -fsSL https://raw.githubusercontent.com/imbue-ai/mngr/main/scripts/install.sh | bash
# either select the robinhood plugin while installing above, or run:
uv tool install imbue-mngr-robinhood
Usage
# Single prompt, text output
mngr robinhood "summarize this repo"
# Pipe stdin in
cat error.log | mngr robinhood "explain this"
# Structured JSON output (claude-native shape; cost/usage fields zeroed)
mngr robinhood "summarize this repo" --output-format json
# Live event stream
mngr robinhood "explain recursion" --output-format stream-json --verbose
# Multi-turn via stream-json input
printf '%s\n%s\n' \
'{"type":"user","message":{"role":"user","content":"hi"}}' \
'{"type":"user","message":{"role":"user","content":"and again"}}' \
| mngr robinhood --input-format stream-json --output-format stream-json
# Live (approximate) streaming of the response as it is produced
mngr robinhood --output-format stream-json --include-partial-messages "tell me a long story"
mngr robinhood --stream-plain-text "tell me a long story"
The mngr robinhood command takes the same arguments as the regular
claude CLI, always behaves as if -p/--print was passed, and routes
the prompt through a fresh, ephemeral mngr claude agent. The agent runs
in-place in the current directory, processes the prompt (or stream of
prompts), and is destroyed when the command exits.
Streaming the response
mngr robinhood can surface an approximate live view of the response, sourced
from the agent's stream_buffer (the tmux-based response stream; see the
imbue-mngr-claude README). Two opt-in flags enable it:
--include-partial-messages(requires--output-format stream-json): emits claude-nativestream_event/text_deltaevents as the response is produced, followed by the authoritativeassistantmessage from the transcript.--stream-plain-text(text output, the default): streams the response text to stdout incrementally and suppresses the trailing full-text dump to avoid duplication.
When either flag is set, robinhood enables the streaming watcher on the spawned
agent and defaults the model to sonnet (so fast mode is off and streaming is
observable); a user-passed --model still takes precedence. The streamed text is
best-effort: the result envelope (and, in stream-json, the final assistant
message) remain the source of truth.
tmux window size
The streamed response is reverse-mapped from the spawned agent's rendered tmux
pane, so the pane width determines where lines hard-wrap in the output. mngr robinhood therefore creates its agent in a large, pinned window by default
(2048 columns x 256 rows, resize policy manual) so the streamed text is not
chopped at a narrow width. Override with:
--tmux-width <columns>(default2048)--tmux-height <rows>(default256)--tmux-window-size manual|latest|largest|smallest(defaultmanual;manualpins the window to the given size and never resizes it)
These flags are consumed by the wrapper and not forwarded to the spawned claude; an invalid value exits with code 2.
Flags not supported in v1
The following claude flags are explicitly rejected (exit code 2):
--fallback-model--max-budget-usd--no-session-persistence--include-hook-events-c/--continue-r/--resume--session-id
Every other claude flag is forwarded verbatim to the spawned agent.
Alternatives
robinhoodis Claude-specific. For a better way of doing the same thing that is generic across agents, just use mngr directly:mngr create --message "some prompt"will create an agent and send a prompt to it. You can usemngr transcriptto see the outputs, ormngr waitto wait for it to finish.- Use
claudewith an API key
mngr-backed Agent SDK (experimental)
This package also exposes a drop-in re-implementation of the
Claude Agent SDK Python surface that is
backed by mngr instead of a directly-spawned claude subprocess. Import query /
ClaudeAgentOptions / ClaudeSDKClient (and the session functions) from
imbue.mngr_robinhood.agent_sdk instead of from claude_agent_sdk; every type is re-exported
verbatim, so isinstance checks and field shapes are identical. Each session is a
robinhood-prefixed mngr claude agent, driven through the in-process mngr API and read back from
its native transcript.
Supported control surfaces and how they map onto mngr:
can_use_tool+hooks— served by a local HTTP bridge: the agent is launched with a--settingsfile whose hook commands POST each event to the bridge, which runs the in-process Python callback and returns claude's hook JSON (allow / deny /updated_input); denials surface inResultMessage.permission_denials.interrupt()— stops the agent mid-turn; the response stream ends at aResultMessageand the nextquery()restarts-with-resume.set_model/set_permission_mode— rewrite the agent's stored launch command with the new configuration and restart it on the resumed session.get_server_info()— runs a one-shotclaudestream-json probe for the real commands / output style, cached per session.total_cost_usd— computed from per-turn token usage times a per-model price table (approximate).include_partial_messages->StreamEvent— when set, the agent's tmux pane is watched and the reconstructed assistant text is wrapped as the claude-native partial-event sequence (message_start->content_block_delta(text_delta)* ->message_stop). Approximate (text is reconstructed from the rendered pane, not claude's token-level deltas) and best-effort; the authoritativeAssistantMessagestill arrives from the transcript, andusage/total_cost_usdremain on the finalResultMessage.
Limitations
Documented limitations (real-SDK-only):
fork_sessionraisesAgentSdkNotImplementedError. claude's--fork-sessiondoes not assign a new session id when driven interactively over an adopted, resumed session (the forked turn is written under the source id), so a faithful fork cannot be produced on this transport.- The agent is not hermetic from the host's claude config -- it must load real settings to
authenticate -- whereas the real SDK with
setting_sources=[]is hermetic. - Lots more, see: here
Why so many limitations?
Honestly the Claude Agent SDK is kind of a mess, and I don't have a particular reason to make it work perfectly. There will always be some trade-offs--you'll have to decide how, exactly, to make them for your own use case. Consider this implementation more of an example of how you could do it, or a starting point, rather than a finished product.
Instead of using the proprietary Claude Agent SDK interface, you should try using mngr instead-- its API is considerably cleaner, and it abstracts over a variety of different coding agents already.
Running the live SDK tests
This project contains an opt-in, live integration suite (imbue/mngr_robinhood/test_sdk_*.py)
that verifies the documented query() and ClaudeSDKClient interfaces of the Claude Agent SDK
end-to-end against the real API. The tests are clean-room: they import only documented public
names from claude_agent_sdk and assert the documented behavior.
The suite is parametrized by the sdk fixture over two targets: real_sdk (the real
claude_agent_sdk package, run via claude --print) and mngr_sdk (this module, which drives an
interactive claude agent in tmux). Every test runs against both unless it exercises a surface the
mngr transport cannot provide (currently only fork_session), which is
gated to real_sdk via the requires_native_sdk fixture. The mngr target therefore needs a local
claude CLI and tmux on PATH. Use -k mngr_sdk / -k real_sdk to run a single target.
These tests make real, paid API calls, so they are excluded from every CI run (via the
sdk_live marker, which is filtered out in offload-modal.toml) and only run when explicitly
opted in. Each test runs the agent in an isolated temp directory.
To run them, export a first-party ANTHROPIC_API_KEY and set RUN_SDK_LIVE_TESTS=1:
set -a; source .env; set +a # exports ANTHROPIC_API_KEY from a local .env
just test-sdk-live
If RUN_SDK_LIVE_TESTS=1 and ANTHROPIC_API_KEY are not both set, the suite is skipped.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imbue_mngr_robinhood-0.1.4.tar.gz.
File metadata
- Download URL: imbue_mngr_robinhood-0.1.4.tar.gz
- Upload date:
- Size: 132.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9504a7404a04b2fc497a7f6562af0fe1034869e4d2448da52aabbe78b94f64
|
|
| MD5 |
ef269887c504ebfd9f794956fbbebb12
|
|
| BLAKE2b-256 |
bfdf4f0df839314d2ed6789170405a339aa97211342bcc922e656f540c7c94af
|
Provenance
The following attestation bundles were made for imbue_mngr_robinhood-0.1.4.tar.gz:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_robinhood-0.1.4.tar.gz -
Subject digest:
de9504a7404a04b2fc497a7f6562af0fe1034869e4d2448da52aabbe78b94f64 - Sigstore transparency entry: 1835033899
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@007398deb560be6724a62ba6692b089df0671a03 -
Branch / Tag:
refs/tags/v0.2.15 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@007398deb560be6724a62ba6692b089df0671a03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imbue_mngr_robinhood-0.1.4-py3-none-any.whl.
File metadata
- Download URL: imbue_mngr_robinhood-0.1.4-py3-none-any.whl
- Upload date:
- Size: 76.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9254405bacafda31d41d425e15361f9e4f469089612033bd0c247b0b44a6198e
|
|
| MD5 |
4fa9eaf2e1ecbbc7704b35a04018aa21
|
|
| BLAKE2b-256 |
9246cedaf5a23c990fd34ac6709363f83ea7f5e8ef6c14a04d85229f8aec72e2
|
Provenance
The following attestation bundles were made for imbue_mngr_robinhood-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_robinhood-0.1.4-py3-none-any.whl -
Subject digest:
9254405bacafda31d41d425e15361f9e4f469089612033bd0c247b0b44a6198e - Sigstore transparency entry: 1835038227
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@007398deb560be6724a62ba6692b089df0671a03 -
Branch / Tag:
refs/tags/v0.2.15 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@007398deb560be6724a62ba6692b089df0671a03 -
Trigger Event:
push
-
Statement type: