Claude Code Mini — Development skill for Claude Code
Async Python implementation of the Claude Code agent harness — real Bash/Read/Glob/Grep tools, three-tier caching, multi-stage compaction, allow/ask/deny permissions, Pre/PostToolUse hooks, slash comm.
How to install Claude Code Mini
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open zyziyun/claude-code-mini and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Mini does
Async Python implementation of the Claude Code agent harness — real Bash/Read/Glob/Grep tools, three-tier caching, multi-stage compaction, allow/ask/deny permissions, Pre/PostToolUse hooks, slash commands, subagent isolation. OpenAI + Anthropic + Ollama. ~1.9K LOC, 14 commits.
Alternatives in Development
- Check 1: Cache Exists? — CLAUDE_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}" CACHE_EXISTS=$(ls -d "$CLAUDE_DIR/plugins/cache/claude-hud" 2 10.9k ★
- Semble — Fast and Accurate Code Search for Agents 6.1k ★
- Agent Skill — A Claude Code plugin marketplace containing the ast-grep skill for powerful structural code search using Abstr 851 ★
README
claude-code-mini
An async Python implementation of the Claude Code agent harness. ~1,890 lines, 14 commits, every subsystem readable in one sitting.
[](https://www.python.org/downloads/) [](#license) [](#tests--benchmarks)
Anthropic's leaked source revealed that **~98.4% of Claude Code is harness**, ~1.6% is model interaction. `claude-code-mini` is the smallest faithful reproduction of that ratio: agent loop, real filesystem tools, prompt/semantic/exact caching, multi-stage context compaction, allow/ask/deny permissions, Pre/PostToolUse hooks, slash commands, and subprocess subagents — all async, all in `src/claude_code_mini/`.
You can run it as a daily-driver REPL on your laptop. You can also `git log` your way through 14 commits and watch the architecture get built one feature at a time.
uv sync
cp .env.example .env # add an API key, or skip if using Ollama
uv run ccm --tools real --yolo
claude-code-mini (provider=openai, model=gpt-4o-mini, tools=real)
[1] > what's the biggest python file under src and why?
The biggest file is src/claude_code_mini/harness.py at 244 lines; it owns
the 7-step request cascade (cache → context → LLM → permission → hook →
tool → format → cache writeback) plus the microcompact integration.
[2] > /cost
calls=4 in=8316 out=184 cached_read=1024 cost=$0.00136
[3] > /exit
Why this exists
Walking an interviewer through your own ~1.9 KLOC reproduction of the Claude Code architecture is a level of credibility no leetcode loop produces. Three audiences:
- AI/ML infra engineers who want a working reference for prompt caching, context compaction, permission engines, and hook protocols — without reading 512K LOC of TypeScript.
- Learners who want to read agent-harness internals end-to-end. Each of
Related Skills
Smart Approve.py
PreToolUse (Bash) Decompose compound bash commands (&&, \ \ , ;, \ , $()) into sub-commands and check each aga
Jev Brig
A Claude Code hook that judges Bash commands against a session policy level, and answers allow/ask/deny with a
Claude Perm Sim
Claude Code permission rule simulator: load the merged allow, ask and deny settings, show which rule decides a
Claude MCP Allow
Generate least-privilege Claude Code permission rules for MCP tools from their live annotations: readOnlyHint
StackRadar
StackRadar: free local dev dashboard + network firewall. Find every repo, run command & open port, catch leake
Agent Policy
One command policy for coding agents (Claude Code and Codex): severity-tiered allow/ask/deny rules, a shared g
Related Agents
Permissions Manager
Manage tool permission rules. Use when user says 'allow', 'deny', or 'ask' for a command, wants to modify perm
Permission Analyst
Recommends allow/deny permission rules from denial telemetry and policy via PromptWise. Use to reduce permissi
Semble Search
Code search agent for exploring any codebase. Use for finding code by intent, locating implementations, unders