Sessions, MCP, and long-context controls are available

AI-powered coding assistant
built for developers

Work with large language models directly in your terminal. Build, debug, and ship with an execution loop that keeps you in control. Describe what you need, and MiniCode handles the tools.

Multi-language roadmap: Rust and Python versions are now available.

api.minimaxi.com
MiniCode
Terminal coding assistant with a card-style session layout.
mini-code ~/code/mini-code [session] a7c9e2b1 [provider] api.minimaxi.com [model] MiniMax-M2.7 [ctx] 42% usage+est [messages] 3 [events] 6 [skills] 13 [mcp] 1
cwd: ~/code/mini-code | extra allowed dirs: ~/code/claude-code, ~/cod...
6 events
session feed
.
assistant
Hello! 👋

I'm mini-code, your terminal coding assistant. I can help you with:
  • 🔍 Inspecting code and repositories
  • 📝 Editing files with review-before-write approvals
  • 🔨 Running commands and tracking background tasks
  • 💾 Saving, resuming, renaming, and forking sessions
  • 📉 Keeping long conversations usable with usage-aware compacting
  • 🎯 Extending workflows through local Skills and MCP tools
What would you like to work on today?
prompt
prompt Enter send | /help commands | Esc clear | Ctrl+C exit
mini-code> Ask for code, files, tasks, or MCP tools

Built with modern architectures

Model-Tool-Loop Terminal UI MCP Protocol Diff Review Local Skills Session Resume Context Accounting

Inspired by Claude Code

MiniCode is designed as an architectural reference implementation. It intentionally strips away bloated platform features to focus entirely on the core AI-developer interaction loop. It is the perfect fit if you are looking for:

A lightweight assistant

Instead of a heavy IDE platform, getting a standalone assistant focused purely on the coding workflow.

Clean terminal UI

Native tool calling, transcript scrolling, and complete command workflows without leaving the terminal.

Readable codebase

A minimal project structure extremely suitable for reading, secondary development, and private customization.

Reference architecture

For learning how modern AI agent loops (like Claude Code) are built under the hood.

Meets you where you code

A minimalist design focusing on the core tool-calling execution loop, providing safety and high extensibility.

Core execution loop

MiniCode manages a full multi-step tool execution loop (model -> tool -> model) in a single turn, providing seamless context processing without leaving the terminal.

  • Full-screen TUI with transcript scrolling
  • Separation of progress and final answers
  • Feedback injection upon rejection

You're in control

Safety shouldn't be an afterthought. MiniCode brings permission validation and code review straight into the primary execution pathway.

  • Standard Unified Diff view before writing
  • Path and command allowlist verification
  • Interception of dangerous actions

Skills & MCP

Extend capabilities endlessly. MiniCode discovers local SKILL.md instructions and seamlessly mounts stdio Model Context Protocol (MCP) servers.

Built-in Toolchain

Local file system management, command execution, and MCP helpers are centralized through a standardized tool protocol, ready to be called by the model at any time.

list_files grep_files read_file write_file edit_file patch_file modify_file run_command web_fetch web_search ask_user load_skill list_mcp_resources read_mcp_resource list_mcp_prompts get_mcp_prompt

Sessions that survive exits

Every turn is appended to a per-project JSONL session log. Resume with --resume, open the picker with /resume, rename the current thread, or fork a clean branch of work.

  • Append-only session events with parent links
  • Resume, rename, fork, compact, and expiry cleanup
  • Transcript rebuild from the stored event stream

Long-context controls

Provider usage anchors the context badge and auto-compact trigger. Snip compact safely removes middle history; context collapse summarizes spans. Huge tool results move to local storage with a preview.

  • Provider usage plus estimated tail accounting
  • Snip compact + context collapse auto-compaction
  • Large tool outputs saved outside the prompt context

Architecture

MiniCode is not a bloated platform. It's a precisely structured codebase centered around the main execution loop.

src/agent-loop.ts

The core multi-turn tool-calling loop that drives the entire asynchronous conversational logic.

src/permissions.ts

The security sentinel handling path allowlists, command reviews, and intercepting unauthorized writes.

src/mcp.ts

The external connector managing MCP client connections and wrapping remote tool functions for local execution.

src/background-tasks.ts

A minimal registry separating ephemeral foreground tools from persistent background shell tasks (like dev servers).

src/session.ts

Append-only project session storage with resume, rename, fork, compact boundaries, transcript rebuild, and expiry cleanup.

src/utils/token-estimator.ts

Provider-usage-first context accounting with local fallback and estimated tail messages after the latest usage boundary.

src/utils/tool-result-storage.ts

Large tool-output persistence that keeps a compact preview in context and stores the full output on disk.