SkillAgentSearch skills...

Clio

A Claude Code clone CLI - agentic coding assistant in your terminal

Install / Use

/learn @icebear0828/Clio
About this skill

Quality Score

0/100

Supported Platforms

Claude Code
Claude Desktop

README

中文 | English

Clio — Claude Code CLI

A feature-rich Claude Code clone that runs in your terminal. Connects to the Anthropic API (or any compatible endpoint) and provides an interactive agentic coding assistant with local tool execution.

46 source files, ~9200 lines of TypeScript. Zero external runtime dependencies beyond fast-glob.

Quick Start

# Clone and install
git clone https://github.com/icebear0828/clio.git
cd clio
npm install

# Set your API key (pick one)
export CLIO_API_KEY=sk-ant-xxx          # Linux/macOS
set CLIO_API_KEY=sk-ant-xxx             # Windows CMD
$env:CLIO_API_KEY = "sk-ant-xxx"        # PowerShell

# Run without building (development)
npm run dev

# Or build and install globally
npm run build
npm link                                # now `clio` is available everywhere

# Use in any project
cd your-project
clio

Features

  • Agent Loop — Multi-turn tool calling: Claude reads files, writes code, runs commands, iterates until done
  • 21 Tools — Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Agent, AskUserQuestion, EnterPlanMode, ExitPlanMode, TaskCreate/Update/List/Get, Skill, ToolSearch, TeamCreate/Delete, SendMessage
  • Streaming — Real-time markdown rendering with syntax-highlighted code blocks, headers, lists, inline formatting
  • Prompt Cachingcache_control on system prompt, tools, and message history for ~90% input token savings
  • Model-aware Context — Dynamic context limits per model (opus 1M, sonnet/haiku 200k), auto-compact at 85%
  • Permissions — Three modes (default/auto/plan), Y/n/a prompts, regex allow + deny rules, two-stage auto classifier (pattern + LLM), Shift+Tab to cycle
  • Context — Auto-loads CLAUDE.md files (upward traversal) + git branch/status/commits into system prompt
  • Sessions — Auto-save conversations, resume with --resume <id>, fork with --fork-session <id>
  • Git Workflow/commit, /pr, /review commands with AI-generated messages
  • MCP Support — JSON-RPC 2.0 over stdio, server lifecycle management, tool discovery with mcp__ prefix
  • Custom Agents — Define agents in .clio/agents/*.md with front-matter (tools, model, max_iterations)
  • Background Agentsrun_in_background for async sub-agent execution with completion notifications
  • Worktree Isolation — Run sub-agents in isolated git worktrees
  • Agent Teams — TeamCreate/TeamDelete/SendMessage for inter-agent messaging and collaboration
  • Extended Thinking — Show Claude's reasoning process with --thinking, adaptive thinking budget
  • Image Input — Paste image file paths to send screenshots to Claude
  • Hooks — Pre/post tool execution hooks via settings.json with env vars and tool filtering
  • Plugin System — Manifest-driven plugins (plugin.json) supporting skills, agents, hooks, MCP, LSP, commands injection
  • LSP Integration — LspClient/LspManager with Content-Length framing, diagnostics injected into system prompt
  • Skills — Skill/ToolSearch tools for deferred tool loading and built-in skill execution
  • Sandboxing — Path restrictions, env filtering, network control, resource limits
  • Status Bar — Configurable bottom bar (model/tokens/cost/mode/verbose/session)
  • Syntax Highlighting — Language-aware coloring for TS/JS/Python/Rust/Go/Bash/JSON/CSS/HTML
  • Undo/Redo — Ctrl+Z / Ctrl+Shift+Z in input with snapshot-based undo stack
  • Checkpoint Rollback — Esc-Esc to restore files modified by Write/Edit
  • Task Management — TaskCreate/Update/List/Get for tracking multi-step workflows
  • Smart Truncation — Grep pagination (head_limit/offset), Bash output capped at 500 lines, Glob pagination
  • Cost Tracking/cost command + status bar with per-model USD pricing
  • Print Mode — Non-interactive output with -p flag, JSON support
  • Keybindings — Customizable keyboard shortcuts via keybindings.json
  • OpenAI Compatibility--api-format openai for any OpenAI-compatible endpoint

Configuration

CLI Flags

--api-url <url>          API base URL (default: https://api.anthropic.com)
--api-key <key>          API key
--api-format <fmt>       anthropic | openai (default: anthropic)
--model <model>          Model name (default: claude-sonnet-4-20250514)
--resume <id>            Resume a previous session
--fork-session <id>      Fork from an existing session
--thinking <tokens>      Enable extended thinking with token budget
--permission-mode <mode> default | auto | plan
--allow <pattern>        Auto-allow Bash commands matching glob pattern (repeatable)
--deny <pattern>         Always deny Bash commands matching pattern (repeatable)
--allow-outside-cwd      Allow file tools to access paths outside working directory
--dangerously-skip-permissions  Allow all tools without prompting
--no-color               Disable colored output
--version                Show version

Environment Variables

| Variable | Description | |----------|-------------| | ANTHROPIC_API_KEY | Anthropic API key | | ANTHROPIC_BASE_URL | Custom API base URL | | CLIO_API_KEY | Gateway API key (alternative) | | CLIO_API_URL | Gateway URL (alternative) | | CLIO_MODEL | Default model | | NO_COLOR | Disable colored output |

Settings Files

4-level hierarchy (later overrides earlier):

~/.clio/settings.json           Global config (shared across projects)
~/.clio/settings.local.json     Global secrets (gitignored — API keys)
.clio/settings.json             Project config (committed, team-shared)
.clio/settings.local.json       Project secrets (gitignored, personal)

Example ~/.clio/settings.json:

{
  "model": "claude-sonnet-4-20250514",
  "permissionMode": "default",
  "allowRules": ["npm *", "git *", "pnpm *"],
  "denyRules": ["rm -rf *"],
  "thinkingBudget": 0,
  "allowOutsideCwd": false,
  "hooks": {
    "pre": [
      { "command": "echo $CLIO_TOOL_NAME", "tools": ["Bash"], "timeout": 5000 }
    ]
  },
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["./mcp-server.js"]
    }
  }
}

Arrays (allowRules, denyRules, hooks.pre, hooks.post) concatenate across layers. Scalars override.

Commands

| Command | Description | |---------|-------------| | /btw | Quick side question without derailing main conversation | | /clear | Reset conversation | | /commit | Generate commit message and commit staged changes | | /compact | Compress conversation context to reduce token usage | | /context | Show context window analysis (tokens by category, capacity bar) | | /cost | Show session token usage and USD cost | | /doctor | System health check (git, node, API, settings, working dir) | | /exit | Save session and quit | | /help | Show command list and keyboard shortcuts | | /init | Scan project and generate CLAUDE.md | | /model [name] | Show or switch model | | /pr | Generate PR title/body and create via gh | | /review | Code review current git diff | | /sessions | List saved sessions | | /settings | Show settings file hierarchy and merged config | | /theme | Cycle through three output themes | | /quit | Quit (alias for /exit) |

Input

| Key | Action | |-----|--------| | Enter | Submit input | | Ctrl+J / Shift+Enter | Insert newline (multi-line input) | | Up / Down | Command history (single-line) / cursor navigation (multi-line) | | Tab | Complete / commands or @file references | | Ctrl+R | Reverse history search | | Ctrl+A / Ctrl+E | Move to start / end of line | | Ctrl+W | Delete word backward | | Ctrl+K | Kill to end of line | | Ctrl+U | Kill to start of line | | Ctrl+Y | Yank (paste from kill ring) | | Ctrl+Z | Undo last input change | | Ctrl+Shift+Z | Redo | | Ctrl+L | Clear screen | | Ctrl+O | Toggle verbose mode | | Shift+Tab | Cycle permission mode (default → auto → plan) | | Ctrl+Left/Right | Move by word | | Home / End | Move to start / end of line | | Escape | Cancel generation or close menu | | Escape Escape | Rollback last checkpoint (undo Write/Edit changes) | | Ctrl+C | Cancel input or interrupt running request | | Ctrl+D | Exit (on empty line) | | Paste | Multi-line paste auto-detected |

Tools

| Tool | Category | Description | |------|----------|-------------| | Read | safe | Read files with line numbers, offset/limit support | | Glob | safe | Fast file pattern matching with head_limit/offset pagination | | Grep | safe | Regex search with output_mode, head_limit, context lines, type/glob filter, multiline, case-insensitive | | WebFetch | safe | Fetch URLs, HTML auto-stripped to text (50k char default) | | WebSearch | safe | DuckDuckGo web search with configurable result limit | | AskUserQuestion | safe | Prompt user for input during agent execution | | EnterPlanMode | safe | Switch to read-only mode for exploration | | ExitPlanMode | safe | Restore previous permission mode | | TaskCreate | safe | Create a task for progress tracking | | TaskUpdate | safe | Update task status or add progress note | | TaskList | safe | List all tasks with statuses | | TaskGet | safe | Get task details including progress messages | | Skill | safe | Execute a built-in or plugin skill | | ToolSearch | safe | Search and load deferred tool schemas on demand | | TeamCreate | safe | Create an agent team with named members | | TeamDelete | safe | Delete an agent team | | SendMessage | safe | Send a message to another agent in a team | | Write | write | Create/overwrite files (auto-creates parent dirs) | | Edit | write | Exact string replacement with uniqueness check | | Bash | dangerous | Execute shell commands (120s timeout, 10MB buffer, 500-line truncation) | | Agent | dangerous | Spawn sub-agents with optional worktree isolation and background execution |

Permission modes:

  • default — Safe tools auto-allowed, dangerous/write tools prompt Y/n/a
  • auto — All tools auto-allowed (no prompts), with deny rule enfor
View on GitHub
GitHub Stars171
CategoryDevelopment
Updated18h ago
Forks21

Languages

TypeScript

Security Score

95/100

Audited on Apr 7, 2026

No findings