Skip to content

DLhugly/Clif-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ClifCode

~20MB native code editor with built-in AI agents. Open source.

MIT License Release crates.io npm npm downloads GitHub Stars ~20MB Tauri 2 Platform

Website Β Β·Β  Get It Β Β·Β  ClifPad Β Β·Β  ClifCode Β Β·Β  Development Β Β·Β  Releases


Cursor is 400MB. VS Code is 350MB. Zed doesn't do AI.

ClifPad is ~20MB. A native Rust IDE with a 7KB SolidJS frontend. VS Code-quality editing via Monaco. Real terminal via PTY. Git built into the backend. AI via ClifCode and Claude Code β€” both integrated, both optional.

No Electron. No telemetry. No subscription. Open source.

ClifPad Screenshot


πŸ“¦ Get It

ClifPad β€” Desktop IDE

Apple Silicon Intel

Windows Linux deb Linux AppImage

macOS "App can't be opened"? β€” Run xattr -cr /Applications/ClifPad.app then open normally. Why?

ClifCode β€” Terminal Agent

cargo install clifcode
npm i -g clifcode

Run clifcode in any project directory. That's it.

Other install methods
# Or clone and build locally
git clone https://github.com/DLhugly/Clif-Code.git
cd Clif-Code/clif-code-tui && cargo install --path .

All releases & checksums


πŸ–₯️ ClifPad

πŸ“ Monaco Editor β€” 70+ languages, IntelliSense, multi-cursor, minimap, code folding. Same engine as VS Code.

πŸ–₯️ Real Terminal β€” Native PTY via Rust. Your actual shell with 256-color, resize, 10K scrollback.

πŸ” Dev Preview β€” One-click npm run dev, auto-detects localhost, live iframe preview.

🌿 Git β€” Branch, status, stage, commit, per-file +/- diff stats, visual commit graph. All Rust.

πŸ€– AI Agents β€” Built-in support for ClifCode (our open-source TUI agent) and Claude Code. Also connects to OpenRouter (100+ models) and Ollama (fully local). Ghost text completions. All opt-in.

🎨 5 Themes β€” Midnight, Graphite, Dawn, Arctic, Dusk. Editor, terminal, and UI stay in sync.

⌨️ Keys β€” Ctrl+`` terminal, Ctrl+B sidebar, Ctrl+S save, Ctrl+Shift+P palette.

πŸ“Š The Size Flex

Binary Runtime RAM idle
ClifPad ~20MB 7KB ~80MB
Cursor ~400MB ~50MB ~500MB+
VS Code ~350MB ~40MB ~400MB+
Zed ~100MB native ~200MB

Tauri 2 compiles to a single native binary. SolidJS has no virtual DOM overhead. Rust handles file I/O, git, PTY, AI streaming β€” zero garbage collection.


⚑ ClifCode

The open-source AI agent that powers ClifPad's AI β€” and works as a standalone terminal tool.

Like Claude Code, but you own it, configure it, and run it with any LLM.

   _____ _ _  __ _____          _
  / ____| (_)/ _/ ____|        | |
 | |    | |_| || |     ___   __| | ___
 | |    | | |  _| |    / _ \ / _` |/ _ \
 | |____| | | | | |___| (_) | (_| |  __/
  \_____|_|_|_|  \_____\___/ \__,_|\___|

  AI coding assistant β€” works anywhere, ships fast

  β—† Model  anthropic/claude-sonnet-4    β—† Mode  auto-edit
  β—† Path   ~/projects/my-app

  Type a task to get started, or /help for commands
  ─────────────────────────────────────────────

  ❯ refactor the auth module to use JWT tokens

  [1/7] β€’β€’β€’ thinking
    β–Ά read  src/auth/mod.rs
    β–Ά read  src/auth/session.rs
    β—‡ find  config.toml
    ✎ edit  src/auth/mod.rs  +42 -18
    ✎ edit  src/auth/session.rs  +15 -8
    β–Έ run   cargo test
    βœ“ All 23 tests passed

  ✦ ClifCode  Refactored auth module to use JWT tokens.
              Replaced session-based auth with stateless JWT
              verification. Added token expiry and refresh logic.

  βˆ™ 2.1k tokens  βˆ™ ~$0.0312

What it does: Tool-calling AI agent that reads your codebase, writes code, runs commands, searches files, and auto-commits β€” all from a TUI. Bring your own API key, use any LLM, or run fully local with Ollama.

πŸ”§ 9 Built-in Tools

Tool Description
read_file Read file contents with offset support for large files
write_file Create or overwrite files, auto-creates directories, shows diff
edit_file Targeted string replacement with fuzzy matching fallback (60%+ similarity)
find_file Recursive file search by name (5 levels deep, top 30 results)
search Grep-based pattern search across 15+ file types
list_files Tree view directory listing (3 levels, 200 entry max)
run_command Execute shell commands in workspace context
change_directory Switch workspace, auto-updates repo map
submit Mark task complete, triggers git auto-commit

πŸŽ›οΈ 3 Autonomy Modes

Mode Behavior
suggest Shows diff, prompts Y/n before every write
auto-edit (default) Applies changes automatically, shows collapsed diff (Ctrl+O to expand)
full-auto Hands-off β€” applies all changes silently

✨ Feature Highlights

Feature Details
Agentic loop Up to 7 tool calls per turn with chained reasoning
Parallel tools Read-only calls execute concurrently on threads
Session persistence Auto-saves every conversation β€” resume any session by ID
Git auto-commit Commits on task completion β€” author: ClifCode <clifcode@local>, undo with /undo
Repo mapping Auto-generates directory tree (4 levels deep) injected into context
Auto-context Reads README, Cargo.toml, package.json, pyproject.toml, go.mod, Dockerfile, .clifcode.toml, etc.
Smart compaction 3-tier context management: truncate large results β†’ stub old results β†’ drop old turns
Fuzzy edit matching When exact match fails, line-based sliding window with 60%+ similarity threshold
Cost tracking Per-turn token usage and estimated cost displayed inline
Streaming markdown Live token-by-token rendering with code block detection
npm distribution 6 platform binaries: macOS/Linux/Windows Γ— x64/ARM64

πŸ“‹ Slash Commands

β—† Session     /new  /sessions  /resume [id]  /cost  /clear  /quit
β—† Workspace   /cd   /add       /drop         /context
β—† Settings    /mode /backend   /config
β—† Git         /status  /undo
β—† Help        /help
Command What it does
/new Start a fresh conversation
/sessions List all saved sessions with date and preview
/resume [id] Resume a saved session (interactive picker if no ID)
/cost Show session token usage and estimated cost
/mode Switch between suggest / auto-edit / full-auto
/backend Show current provider and model
/config Re-run provider setup wizard
/cd [dir] Change workspace directory
/add <file> Add file to persistent context
/drop <file> Remove file from context
/context Show conversation messages and context files
/status Show git status --short
/undo Soft-reset last ClifCode commit (keeps changes staged)

πŸ”Œ Providers

Provider Setup Default Model
OpenRouter (default) CLIFCODE_API_KEY anthropic/claude-sonnet-4
OpenAI --api-url https://api.openai.com/v1 gpt-4o
Anthropic --api-url https://api.anthropic.com/v1 claude-sonnet-4-20250514
Ollama --backend ollama (no API key needed) qwen2.5-coder:7b
Any OpenAI-compatible --api-url <endpoint> user-specified

🚩 CLI Flags

clifcode                                          # interactive mode
clifcode -p "explain this codebase"               # non-interactive single prompt
clifcode --backend ollama                         # use local models
clifcode --autonomy suggest                       # confirm every write
clifcode --resume                                 # resume last session
clifcode --resume <session-id>                    # resume specific session
clifcode -w /path/to/project                      # set workspace
clifcode --api-model gpt-4o --api-url https://api.openai.com/v1  # custom provider
clifcode --max-tokens 2048                        # max completion tokens
Flag Env Variable Default
--backend <auto|api|ollama|stub> β€” auto
--api-url <url> CLIFCODE_API_URL OpenRouter
--api-key <key> CLIFCODE_API_KEY β€”
--api-model <name> CLIFCODE_API_MODEL anthropic/claude-sonnet-4
--workspace, -w <path> β€” current directory
--max-tokens <n> β€” 1024
--prompt, -p <text> β€” β€”
--autonomy <mode> β€” auto-edit
--resume [id] β€” β€”

βš”οΈ Why ClifCode?

ClifCode Claude Code Aider
Open source βœ… MIT βœ… Apache-2.0 βœ… Apache-2.0
Any LLM provider βœ… 100+ via OpenRouter Anthropic only βœ… Multi-provider
Local models (Ollama) βœ… ❌ βœ…
Tool-calling agent βœ… 9 tools βœ… ❌ diff-based
Session persistence βœ… Resume any βœ… ❌
Git auto-commit βœ… βœ… βœ…
TUI interface βœ… βœ… βœ…
Cost tracking βœ… Per-turn βœ… βœ…
Runtime Rust (native binary) Node.js Python
No subscription βœ… BYO key API costs βœ… BYO key

ClifCode gives you the agentic tool-calling experience of Claude Code with the provider freedom of Aider β€” in a single native Rust binary.


πŸ› οΈ Build & Contribute

# ClifPad β€” desktop IDE
cd clif-pad-ide
npm install && npm run tauri dev        # dev mode + hot reload
npm run tauri build                     # production binary

# ClifCode β€” terminal agent
cd clif-code-tui
cargo run --release                     # run directly
cargo install --path .                  # install to PATH

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             Tauri 2 (Rust)              β”‚
β”‚  File I/O Β· Git Β· PTY Β· AI Β· Search    β”‚
β”‚                  β”‚                      β”‚
β”‚            IPC (invoke/events)          β”‚
β”‚                  β”‚                      β”‚
β”‚           SolidJS + TypeScript          β”‚
β”‚       Monaco Editor Β· xterm.js          β”‚
β”‚           Tailwind CSS 4                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Layer Tech Size
Backend Tauri 2 + Rust ~20MB compiled
UI SolidJS 7KB runtime
Editor Monaco tree-shaken
Terminal xterm.js + portable-pty real PTY
Styles Tailwind CSS 4 zero runtime
Build Vite 6 <5s HMR
CI/CD Semantic Release auto-versioned

Project Structure

Clif-Code/
β”œβ”€β”€ clif-pad-ide/    πŸ–₯️  Desktop IDE β€” Tauri 2 + SolidJS + Monaco
β”œβ”€β”€ clif-code-tui/   ⚑  Terminal AI agent β€” pure Rust, any API
└── .github/         πŸ”„  CI/CD (auto-release, npm publish)
clif-pad-ide/
β”œβ”€β”€ src/                     # SolidJS frontend
β”‚   β”œβ”€β”€ components/          # editor, terminal, layout, explorer
β”‚   β”œβ”€β”€ stores/              # reactive state (signals + stores)
β”‚   β”œβ”€β”€ lib/                 # IPC wrappers, keybindings, themes
β”‚   └── types/               # TypeScript interfaces
β”œβ”€β”€ src-tauri/src/           # Rust backend
β”‚   β”œβ”€β”€ commands/            # fs, git, pty, ai, search, settings
β”‚   └── services/            # file watcher, ai providers
└── www/                     # Landing page (clifcode.io)

clif-code-tui/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs              # CLI, TUI loop, agent orchestration
β”‚   β”œβ”€β”€ backend.rs           # API backend (OpenRouter, OpenAI, Ollama)
β”‚   β”œβ”€β”€ tools.rs             # Tool definitions and execution
β”‚   β”œβ”€β”€ ui.rs                # Terminal UI rendering
β”‚   β”œβ”€β”€ session.rs           # Session persistence
β”‚   β”œβ”€β”€ config.rs            # Config (API keys, provider setup)
β”‚   β”œβ”€β”€ git.rs               # Git integration
β”‚   └── repomap.rs           # Workspace structure analysis
β”œβ”€β”€ npm/                     # npm distribution packages
β”‚   β”œβ”€β”€ clifcode/            # Main wrapper (npm i -g clifcode)
β”‚   └── @clifcode/cli-*/     # 6 platform-specific binaries
└── scripts/
    └── bump-version.js      # Syncs versions across Cargo.toml + npm

Conventional commits β€” feat: bumps minor, fix: bumps patch, feat!: bumps major. Semantic release handles the rest.


❓ FAQ

Why does macOS say "App can't be opened"? macOS Gatekeeper blocks apps that aren't signed with a $99/year Apple Developer certificate. ClifPad is open source and safe β€” run xattr -cr /Applications/ClifPad.app in Terminal to remove the quarantine flag, then open normally.

Is Clif safe? 100% open source. Read every line: github.com/DLhugly/Clif-Code. No telemetry, no network calls unless you enable AI. The xattr command just removes Apple's download flag β€” it doesn't disable any security.

Why not just pay for code signing? We will. For now, the $99/year Apple Developer fee goes toward more important things. Proper signing + notarization is on the roadmap.

Does it work offline? ClifPad: Yes β€” AI features are opt-in. Without API keys, it's a fully offline editor with terminal and git. ClifCode: Needs an API provider (but Ollama runs fully local with no internet).

What models does ClifCode support? Any model accessible through an OpenAI-compatible API. Default is anthropic/claude-sonnet-4 via OpenRouter, which gives access to 100+ models including GPT-4o, Gemini, Llama, Qwen, Mistral, and DeepSeek. Use --backend ollama for fully local inference with any Ollama-supported model.

How does ClifCode compare to Claude Code / Aider? ClifCode is a tool-calling agent (like Claude Code) that works with any LLM provider (like Aider). It combines the agentic loop and tool-calling architecture of Claude Code with the provider flexibility of Aider β€” in a single native Rust binary with no Node.js or Python runtime. See the comparison table for details.


πŸ“œ License

MIT β€” use it however you want.


20MB. Native. Private. Fast.

Built with Rust and care by DLhugly

About

~20MB native code editor with built-in AI agents. ClifPad: Tauri 2 IDE with Monaco, real terminal, git, ClifCode + Claude Code integration. ClifCode: open-source Rust TUI agent with tool-calling, sessions, git auto-commit, any LLM. No Electron. No telemetry.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors