dex-agents-claude-sdk-cli
dex-agents-claude-sdk-cli provides the dex-agents-claude-sdk command. It
runs a Claude Agent SDK
agent as a durable Dex agent session and chats with it in your terminal. The
shared CLI core, dex-agents-cli-core, starts or reuses
dexcli dev, connects the connectors MCP server, and runs the Worker. This
package only builds the agent with the
Claude Agent SDK adapter.
The TypeScript package @superdurable/dex-agents-claude-sdk-cli provides the
same command with the same behavior.
Running it
The command needs Python 3.11 or later and an Anthropic API key:
export ANTHROPIC_API_KEY=sk-ant-...
uvx --from dex-agents-claude-sdk-cli dex-agents-claude-sdk
The first run asks the init questions and writes
~/.dex/agents/claude-sdk.yaml. Then type a message at the > prompt. Approve
or reject tool calls with y or n, and press Ctrl-D to exit. The session
stays in Dex, and the command prints the --resume line that continues it.
See the CLI core README for every
subcommand and option, and agents/cli for the
configuration file.
The command passes its environment to Claude Code unchanged and never stores the key.
Configuration
The model defaults to claude-opus-5-5; set model in the file or pass
--model to change it. system_prompt replaces the default instructions.
The claude section has no options yet, and any key in it is a configuration
error.
The session setting reasoning_effort may be low, medium, high,
xhigh, or max. Each turn passes it to Claude Code as the Claude Agent
SDK's effort option. Without it, Claude Code's default applies. In the
terminal UI, /effort sets it, and /model also offers claude-opus-5-5,
claude-sonnet-5-5, claude-haiku-5-5, and claude-fable-5-2.
Local tools
Claude Code's own tools replace the CLI core's files, shell, and
web_fetch tools. The CLI core's browser tools and connector tools stay.
local_tools group |
Claude Code tools | Approval |
|---|---|---|
files |
Read, Grep, Glob |
No |
files |
Write, Edit |
Every call |
shell |
Bash |
Unless local_tools.shell.allow has the whole command text. A background command always waits. |
web_fetch |
WebFetch |
No |
- Each turn offers only the tools whose group the turn switches on, after the session settings narrow the file. A switched-off group's tools are not offered, and a call of one is refused. One exception: a resumed segment also lists the Claude Code tools the turn already recorded calls of, so the CLI can replay those records; a new call of such a tool is still refused while its group is off.
approval.alwaysadds approval to any of these tools by name, such asRead.- Claude Code runs in the workspace. The file tools refuse a path outside it,
after resolving
~, symbolic links, and relative paths, and refuse any path with... A dangling symbolic link counts as the target it would create. AGlobpattern or aGrepglobmust not contain..at all, and an absolute one must start inside the workspace.Bashis not confined: an approved command runs with your permissions. - Claude Code reads no settings files, so their allow rules cannot skip an approval. Its other tools, such as subagents, are not offered.
- The command uses only these Claude Code tools, the CLI core's browser
tools, and the connector tools. It loads no MCP servers and no claude.ai
connectors from your Claude Code configuration or login, such as a
workspace
.mcp.jsonor the Gmail connector of a claude.ai account. External tools come only from the Dex connectors, which Dex approves and records as Steps. - An approved call is checked again in its tool Step, on the Worker that runs it, with that Worker's configuration file narrowed by the turn's session settings. It fails without running when its group is off there or its path is outside the workspace, and the model sees why. The session settings count as the turn started with them, so a change takes effect from the next turn.
- These tools run inside the Claude Code CLI, not in their own Dex Steps. A Worker that dies during a turn segment runs the segment again, so a tool call in it can run twice. Connector and browser tools run in their own Steps and are recorded.
Images
/image <path> attaches an image file to the next message. The command gives
the Claude Agent SDK adapter the media store of media.store, so the model sees the
image, and images that tools return go to the same store. See
Images.
Development
Develop with uv 0.12.2. The package resolves dex-agents, the adapter, and
the CLI core from this repository by path. ci.sh installs the locked
dependencies, checks lint and types, and runs the tests against a private
dexcli dev:
cd agents/cli/python/claude-sdk
DEXCLI=/path/to/dexcli ./ci.sh
The tests run the command in a pseudo-terminal with a private home. The
bundled Claude Code CLI calls tests/mock_messages_api.py, a scripted
Messages API on 127.0.0.1; a refused proxy stops any other request. A fake
connectors MCP server serves a connector read and write. The tests cover a
chat turn and --resume, a connector read and an approved connector write
that runs once, Read, Glob, Grep, and WebFetch without approval,
Write, Edit, and Bash after approval, an allow-listed command run in the
workspace and an allow-listed background command that still waits, paths and
patterns that leave the workspace, a dangling link to outside, session
settings that switch the shell off, a reasoning_effort in the session
settings that reaches the Messages API request and an undeclared one that
fails the turn, an approved call that the Worker running
it refuses after its file switched the group off, and the environment that
reaches Claude Code with and without a key.
Metadata
Release files for dex-agents-claude-sdk-cli 0.6.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dex_agents_claude_sdk_cli-0.6.6.tar.gz | 11.7 kB | Without provenance | Details for dex_agents_claude_sdk_cli-0.6.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dex_agents_claude_sdk_cli-0.6.6-py3-none-any.whl | Python 3 | none | any | Details for dex_agents_claude_sdk_cli-0.6.6-py3-none-any.whl |
Total release size: 25.8 kB
Release files / dex_agents_claude_sdk_cli-0.6.6.tar.gz
| Download URL | dex_agents_claude_sdk_cli-0.6.6.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3556c3bd0d865d29a88320613937185fffd8721bbda793fd6fe5f19f4cf716a
|
|
BLAKE2b-256 checksum How to use checksums |
dab56e89b7ba8d55aa7ce95d0f25ace040bdf3f8eb4e505363830cf27688f2a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dex_agents_claude_sdk_cli-0.6.6-py3-none-any.whl
| Download URL | dex_agents_claude_sdk_cli-0.6.6-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
011c8a007b6cf6c8ce0378d74a1ed29af95afa1b4442ceeef823044f6869f17e
|
|
BLAKE2b-256 checksum How to use checksums |
5abc2bc8a92ca3bcd56130b3b9f23fd2d7f0e4decbd4ce2c62307fe682014509
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dex-agents-claude-sdk-cli 0.6.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.