Terminal-Native AI Coding Assistant
中文 | English
UCode is a terminal-native AI coding assistant. It can read and write code, run commands, manage Git, and use a persistent memory system to keep a deep understanding of your project across sessions. It supports connecting to any mainstream LLM provider API.
- Bun 1.3+
git clone https://github.com/AllernChen/U-Code.git
cd U-Code
bun install
bun devbun run build:local
# Binary output: packages/opencode/dist/ucode-<platform>/bin/ucode| Agent | Description |
|---|---|
| build | Default. Full tool permissions for development |
| plan | Read-only analysis mode for code exploration and solution design |
| compose | Orchestration mode for specs-driven development and skill-driven workflows |
Press Tab to switch between primary agents. Subagents are created by the system as needed.
Cross-session memory powered by SQLite FTS5 full-text search:
- Project memory (
MEMORY.md) — persistent project knowledge, rules, and architecture decisions - Session checkpoint (
checkpoint.md) — structured state snapshots maintained automatically by the checkpoint-writer subagent - Scratch notes (
notes.md) — temporary note area for agents - Task progress (
tasks/<id>/progress.md) — per-task logs
- Automatic checkpoints — decides when to save session state based on the model context window
- Context reconstruction — when context approaches the limit, rebuilds it from the latest checkpoint, project memory, task progress, and retained recent messages so the agent can continue the current task
- Budgeted injection — uses a token budget to control how much checkpoint, memory, and notes content enters context, with importance ranking
- Adjustable compaction point —
/context-limit(orcompaction.max_context) makes a model compact earlier than its own window, per model
A tree-shaped task system (T1, T1.1, T1.2, …) that integrates automatically with the checkpoint system, so task progress is preserved when sessions resume.
The primary agent can create subagents on demand. Subagents share the current session context and can work in parallel, with lifecycle tracking, cancellation, and background execution.
The /goal command sets a stopping condition for a session. When the agent tries to stop, an independent judge model evaluates the conversation to decide whether the condition is truly satisfied — preventing premature "optimistic stops" during autonomous work.
Compose is UCode's structured workflow for specs-driven development, orchestrating the full lifecycle from spec to shipped code. Invoke via the /compose-next skill on the build agent.
Workflows are deterministic JavaScript scripts that orchestrate multiple agents in a sandboxed runtime. UCode ships with built-in workflows:
| Workflow | Description |
|---|---|
compose |
Full development pipeline with auto-parallelization into isolated git worktrees |
deep-research |
Multi-source deep research report generator with parallel sub-agents |
fact-check |
Adversarial fact verification with 3-juror cross-checking |
research-experiment |
Autonomous optimization loop for mechanically verifiable metrics |
Custom workflows: Place a .js file in .ucode/workflows/ to define your own.
UCode bundles skills for generating PDFs, writing academic papers, searching arXiv, frontend design, data analytics, and more. Type / in the TUI to browse available skills or invoke directly with /<skill-name>.
UCode uses JSON/JSONC config files. On first launch, it guides you through provider configuration.
| File | Project-level | Global |
|---|---|---|
| Main config | .ucode/ucode.jsonc |
~/.config/ucode/ucode.jsonc |
| TUI config | .ucode/tui.json |
~/.config/ucode/tui.json |
Set
UCODE_HOMEto override all data/config directories.
Put user-wide settings in ~/.config/ucode/ucode.jsonc, or project-only settings in .ucode/ucode.jsonc. Because apiKey is stored as plaintext, keep the file readable only by your user and never commit it.
See CONTRIBUTING.md for development setup and guidelines.
MIT
{ "model": "custom/MODEL_NAME", "provider": { "custom": { "name": "Custom", "npm": "@ai-sdk/openai-compatible", "only_configured_models": true, "models": { "MODEL_NAME": { "name": "MODEL_NAME" } }, "options": { "baseURL": "BASE_URL", "apiKey": "API_KEY" } } } }