Fire in da houseTop Tip:Most people pay up to $340 per month for Perplexity, MidJourney, Runway, ChatGPT, and more - but you can get them all your AI tools for $15 with Galaxy. It's free to test!Fire in da houseCheck it out

claude-code-is-programmable

MCP.Pizza Chef: disler

Claude Code is Programmable is an MCP server that enables scalable, programmable agentic coding workflows by integrating Claude Code with various tools. It allows developers to programmatically control coding tasks such as writing and editing code through natural language commands, supporting multi-tool orchestration for next-generation engineering automation. This server facilitates voice-to-code interactions and multi-language examples, making it a powerful platform for automating complex coding workflows with LLMs.

Use This MCP server To

Automate code generation and editing via natural language commands Integrate voice commands to generate and modify code Scale coding workflows by orchestrating multiple coding tools Programmatically control coding tasks across different programming languages Enable agentic coding assistants for software development Demonstrate programmable LLM-driven coding workflows Prototype next-generation AI-powered developer tools

README

Claude Code is Programmable

This repository demonstrates how to use Claude Code programmatically, showcasing examples in different programming languages. Watch this video to understand why this is so important for next generation engineering. Check out the voice to Claude Code video to see how to use the voice_to_claude_code.py script.

Voice to Claude Code

Claude Code is Programmable

Quick Start

First off - run these right away to understand how important this is:

# Claude Code example (with only Write and Edit tools allowed)
claude -p "make a hello.js script that prints hello" --allowedTools "Write" "Edit"

# Aider equivalent example
aider --message "make a hello.js script that prints hello" hello.js

Here's the big trick - with Claude Code, you can call ANY TOOL IN ANY ORDER IN NATURAL LANGUAGE.

Check out the other examples in the repo to understand how to scale your impact with this feature.

Watch this video to internalize how important this is for next generation engineering. View the brief anthropic documentation here and a more comprehensive write up on agentic coding here. The Claude Code team is doing incredible work.

You can also use Aider as a programmable ai coding tool to do similar things although it's strictly limited to AI Coding (which is still incredibly useful). Check out the documentation here.

Setup

Configuration Files

  1. MCP (Multi-call Protocol) Configuration

    • Copy the sample configuration file to create your own:
      cp .mcp.sample.json .mcp.json
    • Edit .mcp.json to add your Notion API key in the OPENAPI_MCP_HEADERS section:
      {
        "mcpServers": {
          "notionApi": {
            "command": "npx",
            "args": ["-y", "@notionhq/notion-mcp-server"],
            "env": {
              "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NOTION_API_KEY\", \"Notion-Version\": \"2022-06-28\" }"
            }
          }
        }
      }
  2. Environment Variables

    • Copy the sample environment file:
      cp .env.sample .env
    • Add the following API keys to your .env file:
      NOTION_INTERNAL_INTEGRATION_SECRET=your_notion_integration_secret
      ANTHROPIC_API_KEY=your_anthropic_api_key
      OPENAI_API_KEY=your_openai_api_key
      
    • Note: The voice_to_claude_code.py script specifically requires both ANTHROPIC_API_KEY and OPENAI_API_KEY to be set.
    • The anthropic_search.py script requires ANTHROPIC_API_KEY to be set.

File Descriptions

Shell Scripts

  • claude_code_is_programmable_1.sh: Simple shell script that uses Claude Code's CLI to generate a basic "hello.js" script with limited allowed tools.
    sh claude_code_is_programmable_1.sh
  • aider_is_programmable_1.sh: Similar script using Aider to create a "hello.js" file.
    sh aider_is_programmable_1.sh
  • reset.sh: Utility script to clean up branches and directories created by the demo scripts.
    sh reset.sh

Python Files

  • claude_code_is_programmable_2.py: Python script that executes Claude Code to create a TypeScript CLI todo app, with permissions for Edit, Replace, Bash, and Create tools.
    uv run claude_code_is_programmable_2.py
  • claude_code_is_programmable_3.py: Advanced Python script integrating Claude Code with Notion API for todo management, including rich console output and streaming results. Requires a Notion page name as an argument.
    uv run claude_code_is_programmable_3.py "My Notion Page"
  • aider_is_programmable_2.py: Python script that uses Aider to create a TypeScript todo application with git operations.
    uv run aider_is_programmable_2.py
  • anthropic_search.py: A self-contained Python script for searching the web using Anthropic's Claude AI with web search capabilities.
    ./anthropic_search.py "your search query"

JavaScript Files

  • claude_code_is_programmable_2.js: JavaScript version of the Claude Code script that creates a TypeScript todo app, with permissions for Edit, Replace, Bash, and Create tools.
    bun claude_code_is_programmable_2.js
  • aider_is_programmable_2.js: JavaScript version of the Aider script for creating a TypeScript todo app with git operations.
    bun aider_is_programmable_2.js

Voice to Claude Code

  • voice_to_claude_code.py: A voice-enabled Claude Code assistant that allows you to interact with Claude Code using speech commands. Combines RealtimeSTT for speech recognition and OpenAI TTS for speech output.
    uv run voice_to_claude_code.py
    
    # With a specific conversation ID
    uv run voice_to_claude_code.py --id "my-chat-id"
    
    # With an initial prompt
    uv run voice_to_claude_code.py --prompt "create a hello world script"
    
    # With both ID and prompt
    uv run voice_to_claude_code.py --id "my-chat-id" --prompt "create a hello world script"

Bonus Directory

  • starter_notion_agent.py: A starter template for creating a Notion agent using the OpenAI Agent SDK.
    uv run bonus/starter_notion_agent.py
  • claude_code_inside_openai_agent_sdk_4_bonus.py: An advanced implementation that integrates Claude Code within the OpenAI Agent SDK. Requires a Notion page name as an argument.
    uv run bonus/claude_code_inside_openai_agent_sdk_4_bonus.py "My Notion Page"

Core Tools Available in Claude Code

  • Task: Launch an agent to perform complex tasks
  • Bash: Execute bash commands in a shell
  • Batch: Run multiple tools in parallel
  • Glob: Find files matching patterns
  • Grep: Search file contents with regex
  • LS: List directory contents
  • Read: Read file contents
  • Edit: Make targeted edits to files
  • Write: Create or overwrite files
  • NotebookRead/Edit: Work with Jupyter notebooks
  • WebFetch: Get content from websites

Claude Code response formats

claude -p 'hello, run git ls-files, how many files are in the current directory' --output-format text > test.txt
claude -p 'hello, run git ls-files, how many files are in the current directory' --output-format json > test.json
claude -p --continue 'hello, run git ls-files, how many files are in the current directory' --output-format stream-json > test.stream.json

Anthropic Web Search Tool

See the anthropic_search.py file for more details.

A command-line utility for searching the web using Anthropic's Claude AI with their web search tool capability.

Prerequisites

  • Python 3.8+
  • UV package manager (pip install uv)
  • Anthropic API key

Setup

Make the script executable:

chmod +x anthropic_search.py

Usage

Basic search:

./anthropic_search.py "your search query"

With domain filtering (only include results from these domains):

./anthropic_search.py "javascript best practices" --domains "developer.mozilla.org,javascript.info"

Block specific domains:

./anthropic_search.py "climate change" --blocked "unreliablesource.com,fakenews.org"

With location context:

./anthropic_search.py "local restaurants" --location "US,California,San Francisco" --timezone "America/Los_Angeles"

Increase maximum searches:

./anthropic_search.py "complex research topic" --max-uses 5

Use a different Claude model:

./anthropic_search.py "your query" --model "claude-3-5-sonnet-latest"

Output

The script produces:

  1. The search query used
  2. Claude's response with inline citations marked as [1], [2], etc.
  3. A list of sources at the end, numbered to match the citations
  4. Usage information showing how many web searches were performed

Notes

  • Web search is available on Claude 3.7 Sonnet, Claude 3.5 Sonnet, and Claude 3.5 Haiku
  • Each search counts as one use, regardless of the number of results returned
  • Searches cost $10 per 1,000 searches, plus standard token costs for search-generated content
  • Domain filtering doesn't need https:// prefixes and automatically includes subdomains

Built with ❤️ by IndyDevDan with Claude Code, and Principled AI Coding

claude-code-is-programmable FAQ

How do I start using Claude Code is Programmable?
Run the provided quick start commands to generate and edit code using natural language prompts.
Can Claude Code is Programmable integrate with voice input?
Yes, it supports voice-to-code scripts to convert spoken commands into coding actions.
What programming languages does Claude Code support?
It supports multiple languages as demonstrated in examples, enabling flexible coding workflows.
How does Claude Code handle tool permissions?
You can specify allowed tools like Write and Edit to control what actions the model can perform.
Is Claude Code compatible with other LLM providers?
While designed for Claude, it can be adapted to work with OpenAI, Anthropic, and Gemini models.
What is the benefit of using Claude Code programmatically?
It enables scalable, automated coding workflows that reduce manual effort and speed up development.
Can I extend Claude Code with custom tools?
Yes, the architecture allows integration of any tool to expand coding capabilities.
Where can I find examples and demos?
The GitHub repository includes multi-language examples and video demos showcasing key features.