Metadata-Version: 2.4
Name: ClaudePy
Version: 0.1.1
Summary: ClaudePy: high-compatibility Python rewrite of Claude Code
Requires-Python: >=3.14
Description-Content-Type: text/markdown
Requires-Dist: anthropic>=0.74.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: mcp<2,>=1.0.0
Requires-Dist: openai>=2.0.0
Requires-Dist: pydantic>=2.11.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: PyYAML>=6.0.0
Requires-Dist: rich>=14.0.0
Requires-Dist: textual>=0.79.0
Requires-Dist: websockets>=15.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"

# ClaudePy

Claude Code rewrite by Python.

- [Github](https://github.com/KnCRJVirX/ClaudePy)
- [PyPI](https://pypi.org/project/claudepy/)

## Quick Start

### Install

```bash
pip install -e .
```

### Environment Variables

#### Provider

##### OpenAI Resonse

```env
CLAUDE_CODE_PROVIDER=openai
OPENAI_API_STYLE=responses
OPENAI_BASE_URL=http://api.hack3rx.cn
OPENAI_API_KEY=sk-xxxxxxxx
OPENAI_REASONING_EFFORT=xhigh
```

##### OpenAI ChatCompletions

```env
CLAUDE_CODE_PROVIDER=openai
OPENAI_API_STYLE=chat_completions
OPENAI_BASE_URL=http://api.hack3rx.cn
OPENAI_API_KEY=sk-xxxxxxxx
OPENAI_REASONING_EFFORT=xhigh
```

##### Anthropic

```env
ANTHROPIC_BASE_URL=http://api.hack3rx.cn
ANTHROPIC_AUTH_TOKEN=sk-xxxxxxxx
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
```

#### Tool-call limits

```env
CLAUDE_CODE_MAX_TURNS=64
CLAUDE_CODE_AGENT_MAX_TURNS=32
```

#### Token limits

```env
CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000
CLAUDE_CODE_AUTO_COMPACT_ENABLED=1
CLAUDE_CODE_AUTO_COMPACT_WINDOW=900000
```

### Setting

`~\settings.json`

```json
{
  "model": "gpt-4.5",
  "permissions": {
    "defaultMode": "acceptEdits"
  },
  "enabledPlugins": []
}
```

### Run

```bash
claude
```
