Skip to content
MendCodePublic

About

A coding agent for the terminal: one daemon keeps your sessions, any terminal attaches. Native engine or Claude Code, Codex, ACP and pi behind one screen.

Topics

Resources

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

MendCode

CI Release License: MIT

A coding agent for the terminal. One daemon keeps your sessions; any number of terminals attach to them. It runs its own native engine with the models you connect, or drives Claude Code, Codex, ACP agents and pi behind the same screen. It indexes your code into a graph so the model reads less, packs long conversations instead of forgetting them, and reviews your pull requests.

Install

macOS and Linux:

curl -fsSL https://github.com/MendCode/MendCode/releases/latest/download/install.sh | sh

Windows (PowerShell 5.1 or newer):

irm https://github.com/MendCode/MendCode/releases/latest/download/install.ps1 | iex

Then run mendcode. The first launch walks you through /setup (models, permissions) and /connect (credentials). Claude Code, Codex and the other external engines need their own install and login.

The binary goes to ~/.local/bin/mendcode (%LOCALAPPDATA%\Programs\mendcode on Windows). The installer checks the binary's SHA256 and, when cosign is installed, the signature of the release workflow; MENDCODE_REQUIRE_SIGNATURE=1 refuses to install without that signature. Download and read the script first if you prefer: it is attached to every release.

Channels

Channel What it is Install
stable Tested releases, vX.Y.Z the commands above
beta The next release before it ships, vX.Y.Z-beta.N; a newer stable when there is one ... | sh -s -- --channel beta
nightly Built from main every day it changes, vX.Y.Z-nightly.YYYYMMDD.RUN; a newer beta or stable when there is one ... | sh -s -- --channel nightly

On Windows set $env:MENDCODE_CHANNEL = 'beta' (or nightly) before the irm line. One exact release: MENDCODE_VERSION=v0.0.1 sh install.sh. A starting tier for the first launch: --tier minimalist|balanced|full (default balanced, tiers).

Update, switch, roll back

mendcode upgrade                     # newest release of your channel
mendcode upgrade --channel nightly   # switch channel (remembered); --channel stable goes back
mendcode upgrade --check             # only say whether there is a newer one
mendcode upgrade --rollback          # back to the previous binary

mendcode update is the same command. The footer says when a newer release of your channel is out. upgrade replaces only the binary; your sessions stay in the data directory (upgrade).

Uninstall

mendcode uninstall lists exactly what it would remove and asks first; --keep-data and --keep-config keep your sessions or your settings (uninstall).

Status

Version 0.x: expect changes between releases, and back up your data before upgrading.

  • Verified on macOS (Apple silicon): the measurements below and the script-workflow sandbox were run there. The Linux and Windows binaries are built and smoke-tested by the release pipeline; the Linux sandbox profile for script workflows has not run on real Linux machines yet, and Windows has no script host and no daemon smoke test (workflows, releases).
  • Tested against fake transports, not real accounts: Claude Code, Codex, ACP and pi as engines, the GitHub automation, the Telegram bridge and MCP OAuth (GitHub, channels, MCP OAuth).
  • Your data: --dir, else MENDCODE_V2_DIR, else ~/.mendcode-v2. To back it up, quit every terminal, run mendcode daemon stop and copy the whole directory (the database with its -wal and -shm files, blobs/, and keys/, which the encrypted secrets need) (storage, secrets).

Build from source

With Bun (CI pins 1.3.13) and the pinned pnpm 11.17.0 (package.json):

pnpm install --frozen-lockfile --config.minimumReleaseAge=10080
bun apps/cli/src/entry.ts --dir "$(mktemp -d)"   # disposable data; reuse a --dir to keep sessions
bun run build                                    # dist/mendcode-next for this machine (--target, --outfile)

sh scripts/install-dev.sh installs a mendcode-next wrapper in ~/.local/bin that runs the checkout. Releases: pushing a v* tag runs release.yml, which runs the whole test gate, builds the five binaries (macOS and Linux x64/arm64, Windows x64), signs them with keyless cosign, attests them and attaches an SBOM; nightly.yml tags main once a day when it changed. There is no Apple notarization or Windows code signing yet (releases). See CONTRIBUTING.md to send a change.

Replaceable views

Every terminal surface is drawn through one of 22 view slots, and the built-in look uses the same contract (views):

  • Transcript: message.user, message.assistant, message.reasoning, tool.card, tool.row, compaction.card, turn.status.
  • Prompt area: approval, question, prompt.frame, bar.
  • Chrome: topbar, footer, notice, home, sessions.sidebar, panel.widget, slash.menu.
  • Pages and overlays: page, page.status, overlay.

Not replaceable: the prompt editor, the tasks and scratchpad dock, and the live compaction panel (their frame and surroundings are slots). Page bodies reach a view already drawn: a view restyles the rows, there is no typed model per page. Views are synchronous and data-only, keys and approvals stay with the terminal, and a view that throws or runs over 4 ms is replaced by the built-in. Views run in the terminal process with your permissions and are not sandboxed; installing one is trusting its author. Project views need a trusted project; remote and --safe-mode terminals load none. Start with mendcode-next view scaffold <slot>.

Script workflows

A script workflow is a short JavaScript program that decides at run time which agents to start; static JSON plans work as before (workflows, examples). Tier: balanced and full.

  • API: agent, parallel, pipeline, check, ask, merge, memo, phase, log, sleep, args, with a literal export const meta for name, phases, budget and completion contract. Start with /workflows run, workflow run or the workflow_script tool, which asks before every start.
  • Journal and resume: every call is journaled. After a daemon restart or resume, finished calls replay from the journal and are not run again; tested by killing a real daemon mid-run.
  • Budgets: agents, tokens, usd, minutes. A cap pauses the run; workflow budget raises it and resume continues.
  • Per agent: engine, model and effort are checked before any session starts. Engines other than native need the full tier and an exact model.
  • merge: combines the branches of worktree agents on an integration branch for review; nothing is merged into your checkout without an explicit apply approval.
  • Isolation: the script runs in a separate OS-sandboxed process with a stripped scope, a watchdog and a memory limit, never in the daemon. Verified on macOS (Seatbelt); the Linux bubblewrap profile is not yet verified; Windows has no script host.

Markdown renderer

The full message renderer (balanced and full views) draws code blocks with a language header and a copy button (click, or ctrl+x Y for the block nearest the middle of the screen), four table styles (box, rules, grid, minimal), four heading styles (banner, bold, underline, uppercase), > [!NOTE]-style callouts, task lists and footnotes. 28 colour slots can be overridden one by one with markdownColors or a theme file. markdownCopyHints (auto, code, all, off) chooses which blocks show a visible copy. Limits: right-to-left text is reordered per paragraph, heading, list item and quote, not with full bidi (no isolates or embeddings, no Arabic shaping), and tables and code stay left-to-right. The minimal view and the markdown and plain renderers keep the classic look. See markdown design and customization.

Process modes

processMode (--process, MENDCODE_PROCESS) is auto by default in every tier (same as solo): the terminal hosts the daemon in its own process and hands it to a detached daemon when something needs one, such as a second terminal or standing work. daemon keeps the terminal and the daemon as two processes. The trade-off, as the design states it: less RAM, a hard-killed terminal interrupts its running turn, slower first frame. Measured with the real CLI in a pseudo-terminal, empty session: 124 MB against 167 MB (see measurements), first frame 194 ms against 105 ms with a daemon already running (load 2.4 to 2.7). Run bun scripts/perf.ts --mode daemon,solo to repeat it (performance).

Terminal details

  • Memory notices: each memory write is one muted transcript row (Memory saved · project · "…") with a /memory undo hint, or a one-line toast when the write is not in the visible transcript. /memory undo deletes the newest memory this session saved, and again the one before; edits and removals are not undone (memory).
  • Prompt history: up and down arrows recall sent messages, commands, ! shell lines and discarded drafts, per project; alt+r or /prompt-history searches them by kind. Text that leaves the prompt unsent (12 or more characters, or several lines) is kept as a draft (editor).
  • Slash menu layouts: tabs (default), groups, columns, flat; minimalist defaults to flat (customization).
  • Right panel: /panel opens the pulse cards; presets are pulse, crew, ledger, focus, full and galaxy (full tier only). Balanced and full tiers (panel).
  • Empty sessions: a new chat reuses the project's empty session, so there is at most one per project (sessions).

Tiers

Use /tier minimalist, /tier balanced or /tier full. Minimalist selects compact presentation and a minimal prompt; balanced selects comfortable presentation and a focused prompt; full selects the full prompt. Tiers are separate from setup presets.

Included means the tier enables the feature, subject to its own controls. Opt-in means the tier permits it but an explicit switch/action is still required. Kernel features are independent of tiers, with their own disabling controls and safe-mode restrictions. /tier <feature> on|off|default overrides non-kernel features; --safe-mode remains a ceiling. With no tier selected, legacy defaults apply.

Generated from tier-data.ts, including every manifest feature. Print the block with bun scripts/readme-tiers.ts; verify with bun scripts/readme-tiers.ts --check or bun test scripts/readme-tiers.test.ts.

Feature Minimalist Balanced Full Own switch / action
Slash menu layouts (slash_menu) Kernel Kernel Kernel /customize · slashMenu · slashCommands (minimalist lists 20 commands, flat)
Extensions (extensions) Kernel Kernel Kernel MENDCODE_EXTENSIONS=0 · --pure
Installed packages (packages) Kernel Kernel Kernel disabledPackages · /marketplace
Package chat tools (package_tools) — Included Included features.package_tools
Shell hooks (hooks) Kernel Kernel Kernel MENDCODE_HOOKS=0
MCP servers (mcp) — — Included mcp.json
Code graph tools (codegraph) — Included Included MENDCODE_CODEGRAPH=0
Sub-agents (task) (subagents) — Included Included tools.task
Script workflows (script_workflows) — Included Included tools.workflow_script
Adaptive reasoning (JEV) (jev) — — Included experimental.reasoning_auto
Pet companion (pets) — — Included pet
Experimental pet generator (pet_generator) — — Opt-in /pet new (explicit confirmation)
Voice dictation (voice) — — Opt-in voice.enabled
Computer control (computer) — Opt-in Opt-in /tier computer on (macOS; off until then)
Headless browser (browser) — — Opt-in MENDCODE_BROWSER=1
Code Mode (code_mode) — — Opt-in experimental.code_mode
Snip stale output (snip) — — Opt-in experimental.snip
Worktree tool (worktree_tool) — — Opt-in experimental.worktree_tool
Auto-resume at usage limit (usage_resume) Included Included Included /limit cancel
Thread tools (threads) — Included Included experimental.thread_tools
PR watch (pr_watch) — Opt-in Opt-in experimental.pr_watch
PR reviewer (pr_review) — Opt-in Opt-in experimental.pr_review
Command output filters (output_filters) — Included Included tool_output.filters
Context forecast (forecast) — Included Included /footer +forecast
pi engine (RPC) (pi) — — Opt-in pi.json · /tier pi on
Thread MCP bridge (thread_mcp) — — Opt-in /tier thread_mcp on claude|codex|acp:<name>
ACP registry (acp_registry) — — Included /tier acp_registry on
Lossless storage compaction (storage_compact) Opt-in Opt-in Opt-in storage --compact --offline --dir DATA
Suggested review order (review_order) — Included Included /changes · o preview · O apply
Session lifecycle (session_meta) — Included Included /tier session_meta on
Fan-out comparison (fanout) — — Included /tier fanout on
Pre-limit checkpoint (limit_checkpoint) — Included Included /tier limit_checkpoint off
Graph orientation and impact (graph_context) — Opt-in Opt-in /tier graph_context on (off until then: the model calls the graph tools itself)
Focused session handoff (handoff) — Included Included /handoff <goal>
Instruction includes (instruction_includes) — Included Included @relative/path in AGENTS.md
Package capability preview (package_capabilities) — Included Included /marketplace preview
Caveman prose style (caveman) — Opt-in Opt-in /output-style caveman
PDF and repository fetch (webfetch_modes) — Opt-in Opt-in webfetch mode
Deferred MCP tools (tool_discovery) — — Included experimental.tool_discovery
Official package kit (official_packages) — Opt-in Opt-in Explicit local catalog install
Durable orchestration receipts (orchestration_receipts) Kernel Kernel Kernel clientRequestId on thread mutations
Metric experiments (autoresearch) — — Opt-in On-demand metric-experiment skill
Explicit web routes (web_routing) — Opt-in Opt-in On-demand explicit-web skill
Session panel cards (panel) — Opt-in Opt-in /panel
Session galaxy (panel_orbit) — — Opt-in /panel galaxy
Panel model tokens (panel_models) — Opt-in Opt-in /panel ledger
File viewer (click a path) (file_viewer) — Included Included /customize · pathClick · /open
Memory consent and management (memory_ux) Kernel Kernel Kernel memoryEnabled · memoryRequireApproval · /memory
One process per terminal (solo) (single_process) Kernel Kernel Kernel /customize · processMode · --process (auto in every tier: one process while one terminal is open, less RAM; a second client moves the daemon to its own process; solo keeps it in the terminal; daemon keeps the separate process)
Lean tool catalogue (lean_tools) Included Included Included /tier lean_tools off
Auxiliary tools in every request (aux_tools) — Opt-in Opt-in /tier aux_tools on
MendCode tools inside Claude Code (harness_tools) — Included Included /tier harness_tools on
Plan and goal tools in every request (plan_tools) — — Opt-in /tier plan_tools on
glob and grep in every request (find_tools) Included Included Included /tier find_tools off
Screen settings tool in every request (ui_tool) — Included Included /tier ui_tool on
Orientation block in the first message (orientation) — Included Included /tier orientation off
Git page (review, commit, worktrees) (git_hub) — Included Included /git · git.defaultTab
Git page push and pull request (git_actions) — Opt-in Opt-in experimental.git_actions
Quota refresh probe (quota_refresh) Opt-in Opt-in Opt-in /customize · quotaRefresh (off until a provider is listed; each probe spends some of the quota it measures)
Compact while idle (idle_compact) — — Included /tier idle_compact off · /settings · idle compact
1h cache after long waits (wait_cache) — — Included /tier wait_cache off · /settings · cache ttl
Notice before a compaction (compact_notice) — Included Included /tier compact_notice off · /settings · compact notice
Project backlog (backlog) — — Included /tier backlog off · /backlog · /panel widget backlog
Sub-agent worktrees (task_worktree) — — Included /tier task_worktree off · task isolation: "worktree"
Sub-agent forks (parent's cached context) (task_fork) — — Opt-in /tier task_fork on · task fork: true
Sub-agents on a cheaper model (cheap_subagents) — Included Included /tier cheap_subagents off · /model roles · subagent
Claude Code compacts at MendCode's point (claude_compact) — Included Included /tier claude_compact off · compactAtTokens
Cache countdown (footer) (cache_countdown) — — Opt-in /footer +warm
One tree: sessions sharing a checkout (one_tree) — Included Included /tier one_tree off

Measurements

Measured 2026-10-04 on a MacBook Pro (Mac16,8), Apple M4 Pro, 24 GB RAM, macOS 27.0 (26A428), Bun 1.3.13, arm64; source revision 631d5ab. Synthetic offline workloads, temporary stores and HOME, no real providers or other coding tools.

Measure Result Method
Compiled CLI help startup 99.4 ms Median of five launches, compiledTarget + measureCliStartup from perf.ts
Bytes per session, 60-session batch 206,165 Rounded batch total / 60 after checkpoint, compression and sharing
Bytes for 2,000 sessions 345,800,704 (329.8 MiB) Database + WAL + blobs after checkpoint; 172,900 bytes/session rounded
Daemon RSS, idle / with a client attached 98 MB / 104–129 MB bun scripts/perf.ts at revision 3066087, compiled daemon, 0 / 1,000 / 10,000 messages
Client RSS, idle / after scrolling and streaming 63–71 MB / 107–133 MB Same run, compiled client
First frame 96 ms / 142 ms / 186 ms Same run as the two-process RSS rows (revision 3066087, daemon mode), 0 / 1,000 / 10,000 messages
Scroll frame p95 2.5 ms / 4.7 ms / 3.3 ms Same run
Streaming frame p95 3.6 ms / 7.5 ms / 5.4 ms Same run
Opt-in one process (processMode: auto or solo, selected by the minimalist tier; the default is two processes), RSS idle / after use 113 / 148 MB (0 messages), 133 / 216 MB (10,000) bun scripts/perf.ts --mode daemon,solo on 2026-10-05, load average 5.5 (shared machine, not repeated on an idle one); the same run in two processes, daemon + client: 142 / 195 MB and 148 / 249 MB; real CLI in a pseudo-terminal, 0 messages: 124 MB solo against 167 MB in two processes. Design
Opt-in one process, frame p95, scroll / stream 4.5 to 8.4 ms / 5.6 to 9.1 ms Same run as the one-process RSS row
Opt-in one process, first frame 180 ms / 196 ms / 210 ms Same run as the one-process RSS row, 0 / 1,000 / 10,000 messages (performance)

Disk command: MEND_DISK_REPORT=1 bun test packages/store/test/disk-budget.test.ts (5 passed). Each synthetic session has eight turns, three tool calls/turn, streamed text, model history and file snapshots. Batch sizes share different amounts of data; these are not predictions for arbitrary transcripts or Git worktrees. The disk test enforces 210 KiB/session for the small batch and 350 MiB for 2,000 sessions. See storage.

Performance documents bun scripts/perf.ts: compiled client and daemon, faux engine, 0/1,000/10,000 messages, RSS, startup and frame p95. The budget rules and tests fail on regression. Numbers vary with machine load; no historical or competitor measurements are presented here.

Engines

Engine Transport / requirements Reference
Native Built-in model loop; configured providers Providers
Claude Code Installed, logged-in claude; stream-json Claude Code
Codex Installed, logged-in codex; app-server Engine tests, thread bridge
ACP Explicitly configured external ACP agent ACP
pi Installed, logged-in pi; RPC; opt-in, full-tier permission pi

External engines retain their own authentication and tool loops. Fake transports establish offline adapter coverage, not live account interoperability.

Embedding

mendcode app-server --dir DATA --cwd PROJECT exposes local JSONL JSON-RPC (mendcode-app-server@1): threads, turns, events and approval requests. A typed client is exported by @mendcode/client/app-server. Headless run --format json, the daemon socket and opt-in HTTP adapter are alternatives. See embedding and its client example.

Security model

  • The daemon applies permission modes and approval rules before tools execute (permissions).
  • OS sandboxing is opt-in and off by default; approval alone is not confinement (sandbox).
  • Remote/peer access is scoped; local-data commands and host execution settings have local-only guards (remote, audit).
  • Recognized pasted secrets become markers with encrypted values; detection does not certify arbitrary text or external-engine files (secrets, audit).
  • The thread MCP bridge is opt-in per engine, project-scoped and short-lived, with normal approvals and no user-config rewrites (thread MCP).

Docs and development

Commands · Customization · Views · Workflows · Memory · Compaction · Worktrees · Packages · Usage limits · Upgrade · Uninstall · Migrating from the legacy MendCode

bun test scripts/readme-tiers.test.ts apps/cli/test/footprint.test.ts apps/cli/test/tui-automation.test.ts
./node_modules/.bin/tsc -p tsconfig.base.json --noEmit

MIT: LICENSE. Dependency notices: THIRD_PARTY.md.

About

A coding agent for the terminal: one daemon keeps your sessions, any terminal attaches. Native engine or Claude Code, Codex, ACP and pi behind one screen.

Topics

Resources

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages