The Claude API and Claude Code are architecturally different tools. The gap is larger than most developers think.
I run a personal AI system with custom instructions (CLAUDE.md), MCP servers, and a context-routed knowledge base. When I needed programmatic access to all of it, I discovered three layers with very different capabilities.
(1) The raw Claude API (Messages API) is stateless inference with limited built-in tooling. It has server-side web search and a text editor schema, but no bash execution, no file read/write execution, no agentic loop for client tools, no project context, and no MCP client. For anything beyond web search, you build the tool execution loop, the session layer, and the integrations yourself.
(2) Claude Code is an agent runtime on top of the API. It adds 30 built-in tools (file ops, bash, grep, web search, subagents), automatic CLAUDE.md loading, a hook system with 23 event types, native MCP integration, session persistence, and an agentic loop that handles tool calling automatically. These are not cosmetic additions - they are the difference between a language model and a development agent.
(3) The Claude Agent SDK sits between the two. Built-in tools and auto agentic loop like Claude Code, plus MCP and subagent support. But it defaults to isolation mode - CLAUDE.md loading requires explicit settingSources configuration. Different trade-off: more programmatic control, less automatic context.
(4) To expose Claude Code's environment via HTTP, you can use CLI wrappers - tools that spawn claude -p (headless mode) behind an OpenAI-compatible API. Headless mode inherits CLAUDE.md, MCP servers, auto memory, environment variables, and all 30 tools automatically. Important caveat: hooks do not fire in headless mode, and skills (slash commands) are not available. You get the context and tools, but not the lifecycle automation layer.
(5) I evaluated 8 open-source repos that do this. After checking the actual source code, feature coverage varies more than READMEs suggest.
Repos worth tracking:
- thhuang/claude-max-api-proxy-rs (Rust)
- RichardAtCT/claude-code-openai-wrapper (Python)
- codingworkflow/claude-code-api (Python)
- CaddyGlow/ccproxy-api (Python)
- ZhangHanDong/claude-code-api-rs (Rust)
(6) The architectural decision that matters most: CLI wrappers vs SDK wrappers. CLI wrappers inherit CLAUDE.md and MCP for free because the CLI loads them. SDK wrappers need explicit setup but offer more programmatic control. Neither gives you hooks in headless mode - that remains an open gap.
(7) The capability distance between the Claude API and Claude Code will keep growing as Anthropic adds agent features. Tools that bridge this gap programmatically are infrastructure worth watching.