Skip to content

Everybody write coding agents, but no body writes them in a performant language. So here it is, 'Claude Code' translated to C. 7MB of memory usage vs 200MB of memory usage.

License

Notifications You must be signed in to change notification settings

nmnduy/claude-c

Repository files navigation

Claude Code - Pure C Edition

A lightweight, modular implementation of a coding agent that interacts with an Open API compatible API. This is a pure C port of the core functionality from the TypeScript/Node.js Claude Code CLI.

claude-c preview

Installation

Installing Dependencies

macOS (Homebrew):

brew install curl cjson portaudio libbsd

Ubuntu/Debian:

sudo apt-get install libcurl4-openssl-dev libcjson-dev portaudio19-dev build-essential libbsd-dev

Building

Recommended: Use stable release

git clone --branch v0.1.12 https://github.com/nmnduy/claude-c.git
cd claude-c
make

Building from source (latest development):

cd claude-c
make

This will produce a claude-c executable in the current directory.

Optional: Install globally

make install

This installs to $HOME/.local/bin/claude-c

Usage

Quick start

export OPENAI_API_KEY=$DEEPSEEK_API_KEY
export OPENAI_API_BASE=https://api.deepseek.com
export OPENAI_MODEL=deepseek-chat
claude-c

We dont have config switching yet. But you can also just do this in .bashrc

alias deepseek-chat="OPENAI_API_KEY=$DEEPSEEK_API_KEY OPENAI_API_BASE=https://api.deepseek.com OPENAI_MODEL=deepseek-chat claude-c"
alias glm-4.6="OPENAI_API_KEY=$ZAI_API_KEY OPENAI_API_BASE=https://api.z.ai/api/paas/v4/chat/completions OPENAI_MODEL=glm-4.6 claude-c"
alias kimi-k2-thinking="OPENAI_API_KEY=$MOONSHOT_AI_API_KEY OPENAI_API_BASE=https://api.moonshot.ai OPENAI_MODEL=kimi-k2-thinking claude-c"
alias gpt-5="OPENAI_API_BASE=https://api.openai.com OPENAI_MODEL=gpt-5 claude-c"

Color Theme Support

Available built-in themes: kitty-default, dracula, gruvbox-dark, solarized-dark, black-metal

Override via env var CLAUDE_C_THEME

Memory footprint

Memory usage

Security Notes

  • No sandboxing: Bash tool has full shell access
  • File tools can access any readable/writable file
  • Intended for trusted environments only

About

Everybody write coding agents, but no body writes them in a performant language. So here it is, 'Claude Code' translated to C. 7MB of memory usage vs 200MB of memory usage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •