SDK Integration

Explore embedding Claude Code SDK to automate tasks, inherit CLI configurations, and manage permissions safely.

Claude Code is an “agentic” coding assistant that you have been using interactively through the command-line interface (CLI). The software development kit (SDK) lets you embed the same assistant directly into scripts and applications, so that your code can talk to Claude with no human in the loop. In other words, instead of typing questions in the terminal, you write a program that sends instructions to Claude and handles its answers. This turns Claude Code from a manual assistant into a programmable agent in your software toolbox. Much like adding a powerful engine to the architecture, the SDK gives you programmatic control over Claude’s capabilities, allowing you to automate coding tasks. For example, you can write a script that scans for code patterns, fixes bugs, or writes tests by calling the SDK rather than running the CLI by hand.

Press + to interact

The SDK is not a limited version of Claude Code; it is the same intelligent agent that powers the CLI, accessed through code. All the features you know are available: tools for reading and writing files, running shell commands, and searching your codebase or the web. The SDK includes a rich tool ecosystem and advanced permissions built on the same engine.

In practice, your programmatic agent can open files, make edits, compile code, run tests, or look up documentation just as the interactive Claude can. The SDK also supports Anthropic’s Model Context Protocol (MCP), so custom tools (for example, API integrations or Puppeteer servers) that work in the CLI also work through the SDK.

How the SDK inherits CLI configuration

Because the SDK uses the same backend as the CLI, it automatically inherits your Claude Code settings and project context. In practical terms, any configuration you have put in a .claude/settings.json file or any context files, such as a CLAUDE.md, also applies when you call Claude through the SDK.

For example, you might keep a CLAUDE.md in your repository root to document coding guidelines or common commands. ...