Open Source · Self-Evolving · Always On

The AI Agent That Rewrites Itself

zCode CLI X is an autonomous coding agent with persistent memory, 15+ tools, and a self-improvement loop that gets smarter with every session.

⭐ Star on Gitea See It in Action ↓
15+
Built-in Tools
6
Skills
3
Agent Roles
Self-Learning
Capabilities
Built for Autonomous Intelligence
Every component is designed for self-sufficiency — from code generation to deployment, from learning to evolving.
🧠

Persistent Self-Learning Memory

Memories across gotchas, patterns, preferences, discoveries, and lessons. Auto-injected into every session. The agent literally gets smarter over time.

🔬

Curiosity Engine

Async analysis pass runs after every response, detecting errors, user corrections, and new patterns — with zero latency impact on conversations.

🛡️

Self-Evolving Code

Read, patch, and improve its own source code with automatic backups and rollback. Rate-limited to prevent runaway modification loops.

Intelligence Router

Unified agentic loop handles streaming and non-streaming through the same path. Tool calls accumulate across SSE deltas for seamless execution.

🤖

Multi-Agent System

Code Reviewer, System Architect, DevOps Engineer — specialized agent roles with focused prompts and scoped tool access.

💬

Telegram-Native

Runs 24/7 as a Telegram bot with webhook + WebSocket. Voice I/O, image analysis, real-time streaming — lives where you already chat.

Live Demo
See zCode CLI X Think
A real interaction showing how the agent learns, reasons, and evolves in real time.
zcode-cli-x — session
Build me a REST API for user management
zCode CLI X is thinking...
→ Using tool: bash { command: "mkdir -p api/routes" }
→ Using tool: file_write { path: "api/routes/users.ts" }
→ Using tool: file_write { path: "api/server.ts" }
→ Using tool: bash { command: "npm install express" }
Created api/server.ts with Express + TypeScript
Created api/routes/users.ts with full CRUD
Installed dependencies
Running lint check — all clean
🧠 Memory: Saved pattern — "REST API scaffold with Express + TS"
System Design
Intelligence at Every Layer
A three-tier architecture — Interface, Intelligence, and Infrastructure — each with independent capabilities and clean separation.
💬
Telegram Bot
Webhook + WebSocket
⌨️
CLI Mode
Terminal Interface
🧠
chatWithAI() Loop
Intelligence Router
🛠️
15+ Tools
Bash · File · Git · Web
+
📚
Skills Engine
Review · Fix · Test
+
🤖
Agent Roles
Coder · Architect · DevOps
🧬
Z.AI GLM-5.1
Coding PaaS API
+
💾
Memory Store
JSON + Priority Eviction
Self-Evolution
Code That Improves Itself
The most powerful feature — and the most carefully guarded. The agent modifies its own source with full safety mechanisms.
1

🔍 Continuous Learning

Async curiosity engine scans for patterns, errors, and discoveries — saving to persistent memory that survives restarts and redeployments.

// Auto-learned memories trigger: error + fix → save("gotcha") trigger: user correction → save("lesson") trigger: novel solution → save("discovery")
2

🧬 Self-Patching

Self-evolve tool allows reading and modifying its own TypeScript source — with automatic file-level backups and git push on success.

// Safety mechanisms rate_limit: 1 patch / 60 seconds backup: auto() → .self-evolve-backups/ on_failure: rollback() on_success: git push()
3

🔄 Memory Persistence

500 memories with priority-based eviction. Lessons and gotchas are kept longest. The same insight is never stored twice.

// Memory lifecycle capacity: 500 entries dedup: access_count++ if exists evict: discovery → preference → pattern → lesson → gotcha
Technology
Built With Proven Tools
No gimmicks. Every technology choice is battle-tested and production-ready.
🟦
TypeScript
Type-Safe Core
🟢
Node.js
Runtime
🧬
Z.AI GLM-5.1
LLM Engine
📨
Telegram API
Interface
🔗
Gitea
Source Control
🐧
Linux VPS
Deployment
⚙️
systemd
Process Manager
🔐
RTK
Token Optimization

Ready to Build With Self-Evolving AI?

zCode CLI X is open source, self-hosted, and always improving. Clone it, deploy it, watch it evolve.

⭐ Star on Gitea Explore Features ↑