Skip to content
m4rocksPublic

About

Yet another Claude Code wrapper

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

m4code

m4code is a native desktop workspace, written in Rust with GPUI, for running coding agent sessions (Claude Code, Codex, OpenCode, and Google Antigravity) in one window on Windows, macOS, and Linux.

It's a personal project with rough edges: macOS and Linux are lightly tested, and the macOS build isn't notarized. Prebuilt binaries are on Releases. Issues and pull requests are welcome.

m4code is an independent project. It is not affiliated with, endorsed by, or sponsored by Anthropic. Claude and Claude Code are trademarks of Anthropic.

Supported agents

Every session runs in m4code's native chat view over the Agent Client Protocol (ACP). Sign-in stays with each agent. Settings → Harnesses enables or disables harnesses, selects which models appear in the picker, and configures subagent and edit permissions.

Agent Requirements Notes
Claude Code claude CLI, Node, npm Runs through the Claude Agent SDK (installed into m4code's data folder on first run) using whatever sign-in your claude has (subscription, API key, Bedrock, or Vertex). Disables claude.ai-only tools (scheduled tasks, push notifications, connectors) for m4code sessions only. Includes a Claude in Chrome toggle.
Codex Node, codex login Runs through its ACP adapter from npm (downloaded on first run).
OpenCode opencode on PATH Uses the providers configured in OpenCode.
Google Antigravity agy CLI, signed in Interactive only: see the terms note below. Opt-in for subagent use.

When upgrading from a version with multiple Claude accounts, resumed sessions use the login configured for the Claude CLI. Expired logins offer Sign in and Retry session in the conversation. Failed sessions retain their history and queued messages. A session that stops reporting progress offers Stop and Reconnect; reconnecting does not automatically repeat the last prompt.

Antigravity terms note: Google's Antigravity terms and FAQ forbid using another company's agent (such as Claude Code) with a personal Google sign-in (Free, AI Plus, Pro, or Ultra), and Google can suspend or terminate accounts that do. m4code keeps Antigravity to sessions you type in:

  • Rewind and fork are off in Antigravity sessions, and m4code doesn't compact one itself. Only Antigravity's own /compact runs, when Antigravity lists it.
  • Conversations from other models can't be handed to Antigravity. You can hand an Antigravity conversation to another model yourself, but auto-handoff and an agent's set_model can't.
  • Antigravity can't be the text generation model. A saved choice switches back to the local summary.
  • Allow subagent delegation and Allow cross-harness subagents start off for Antigravity. Turn them on at your own risk.
  • Antigravity sessions don't get start_code_session or read_code_session, so they can't start sessions or read other ones.
  • Antigravity's usage meter updates only when you press refresh.

Features

Chat and model handoff

  • Window layout: Remembers window position, size, and maximized state between launches.
  • Unified composer: Home and chat share the same composer with chips for model (across all enabled harnesses), project, effort level, permission mode, and branch or worktree. Press Alt+P (Option+P on macOS) in a chat to search models or adjust effort.
  • Permissions: Choose Read-only, Auto, or Full Access. A session configured as Read-only starts sending prompts only after the adapter confirms that mode. Auto is disabled when the adapter doesn't offer it. An Auto preference uses Full Access on those adapters and returns to Auto when a handoff reaches an adapter that supports it. Antigravity reconnects the same session when you change to or from Full Access. Wait for the current turn to finish before switching.
  • File attachments: Drop files into the composer, select them with the paperclip next to Send, or copy files in your file manager and paste them into the composer. Pasted images and image files show previews alongside removable file chips above the text field. Agents receive local file paths, and pasted images are saved in the app data folder when sent.
  • In-place harness handoff: Picking a model on another harness hands off the conversation on your next message, or when you ask an agent to switch via set_model. Sessions wait for their adapter to discover m4code's MCP tools before sending the first prompt. The workspace_context tool shows the working directory, project root, worktree, and branch. Returning to a previous harness resumes its saved provider session and sends only the intervening conversation. A failed handoff restores the original session and unsent draft.
  • Steer or queue while working: Settings → General chooses what happens when you send a message mid-turn:
    • Queue (default): waits for the turn to finish. Edit, reorder, remove, or send queued messages from above the composer. Interrupting or restarting holds the queue until you resume.
    • Steer: feeds the follow-up into the current turn on Claude Code and on other adapters that advertise live steering. If live steering is unavailable, the composer queues the follow-up in order so the current turn can finish.
    • Press Cmd/Ctrl+Enter (or Cmd/Ctrl-click Send) to swap Steer and Queue for a single message.
  • Questions and background shells: Answer agent questions with the keyboard or mouse, or type your own answer for Claude Code. Codex can ask questions while working without blocking chat. Above the composer, chips show the plan's current step, work left running in the background and queued messages. Click a chip to open its list. From there you can read a background shell's or task's output, stop it, or send, edit, reorder and remove queued messages. Ctrl+T opens the plan.
  • Chat navigation: Use the scrollbar or mouse wheel to scroll the chat. Scrolling up pauses follow mode. Use Jump to latest to catch up. Search messages and tool output with Find in session under Actions or Cmd/Ctrl+F. Consecutive read-only tools are grouped into expandable exploration summaries.
  • Chat notices: Session events use one compact bordered notice, including handoff, compaction, usage warnings, interruptions, retry status, and recovery actions. Handoff and compaction update their original notice when they finish; internal compaction summaries and provider acknowledgements stay out of the chat. Working and Worked for use separate, unboxed turn-status rows. Attached paths, Ask context, and retry instructions remain Markdown quotes in user messages.
  • Context compaction: Set the default and context threshold in Settings → General. In the right sidebar, choose On, Off, or Use global setting for the current session. While it is on, a tick on the Context meter marks the threshold. Schedules compaction at the next idle boundary once reported context reaches the configured threshold, using the adapter's native compact command while keeping the provider session. Native automatic compaction is disabled for Claude Code and OpenCode; Codex retains a native fallback noted in the status panel.
  • Consistent controls and feedback: Settings controls support Tab and keyboard activation. General and harness preferences save when Settings closes, with UI scale previewed immediately; project and skill actions apply immediately. Invalid executable paths show their validation error beside the field. Notifications stack in order so later feedback preserves earlier actions such as Undo, and GitHub errors retain their error styling.
  • Keyboard shortcuts: Supports familiar Claude Code shortcuts (Esc to stop, Esc twice to edit your last message, Shift+Tab for permission mode when idle, Up for message history, Shift+Enter for a new line). Settings → Keyboard lists every shortcut.

Workspace, Git, and editor

  • Comments: Select text in chat and use the comment icon, choose Add comment from the context menu, or press Cmd/Ctrl+Shift+M to add context to your next message. The same icon opens comments on lines in Review changes and in the editor.

  • Quoted context: Attached file and image paths, Ask question context, and retry instructions appear as ordinary Markdown quote blocks before your message, with a visible left bar.

  • Branches and worktrees: Create a branch or spin up a new worktree (from main or the current checkout) in one click from the branch chip, inspect or remove external worktrees (keeping their branches), or move a session between worktrees. m4code watches git metadata for live worktree changes, follows Claude Code's native EnterWorktree/ExitWorktree moves at turn end, returns a session to main if its worktree is deleted externally, and offers a one-click switch when an agent edits files in another worktree. The editor and shell follow once the replacement session is ready. If it fails to open, the original session stays in its current checkout. When a provider binds a native session to its old checkout, m4code carries the conversation forward into a fresh native session.

  • Welcome actions: Open the selected project in the editor or on GitHub, pull changes, or use Commit & Push before starting a session.

  • Change review and snapshots: The composer's Review changes button compares the working tree to the latest snapshot and supports hunk actions and line comments. The comment button appears beside the hovered line number, with its gutter space reserved to keep the layout stable.

  • Built-in editor (Ctrl+Shift+E): File tree, tabs, a breadcrumb of the open file's path, syntax highlighting, Git gutter marks, and LSP diagnostics, hover, completions, and go-to-definition using language servers already on your PATH. Works in active sessions and on Home, keeping each project's tabs and unsaved edits. Click the comment button beside hovered or selected lines to add @path#L12-30: comment to the composer.

  • Shell panel (Ctrl+J / `Ctrl+``): A real PTY shell in the session's folder. Agents never run in a PTY and m4code never types into the shell.

  • Sessions, sidebars, and cards:

    • Left sidebar of running and recent sessions (Cmd/Ctrl+Z reopens the last closed session), Pick up a session here to open terminal-started sessions in a folder, and background notifications when a session finishes or asks a question.
    • Right sidebar with cards for actions, the turn outline, session status, subagents, GitHub issues and pull requests, and linked sessions, plus inline visual cards agents draw in chat.
    • GitHub labels, assignees, edits, and comments update immediately while saving. Failed edits restore the previous content and retain the draft. If a comment posts but closing the item fails, retry close/reopen separately to avoid posting twice.
    • Ask Agent in the GitHub pane sends the request to the active agent if it is running in the repository. When it starts a new session, it uses the model selected in the Welcome composer.
    • Usage meters in the sidebar footer for connected harnesses with a limits adapter (Claude Code, Codex and Antigravity 5-hour/7-day limits). Antigravity's meter updates only when you press refresh. The usage dashboard link for OpenCode is shown only when its harness is enabled.
    • Configurable text generation model (Settings → General) for automatic new-session titles, Regenerate title and Commit & Push—pick any enabled model except Antigravity, or keep local summary.

Cross-agent subagents

  • Shared MCP subagent tools: Sessions across all harnesses share spawn_subagent, list_subagents, send_subagent_message, wait_subagent, and stop_subagent (targeting adapters enabled for subagent use in Settings). Children run in the parent's working folder without stealing focus, appear in the right sidebar, and fold their report back into the parent chat. Follow-ups reuse the child session, stopping a parent stops its children, and a read-only parent cannot grant edits. Sessions are conversations for the user and are created only when the user wants one. Subagents are workers the model uses to delegate work within its current session.
  • Claude Code native subagents: Claude Code can also start Codex, OpenCode, and (opt-in) Antigravity subagents directly. These plugin-run children receive the shared workspace context tool. Desktop-managed children have their own records and can use the session tools. Each streams its work in its own task view with configurable effort (max maps to Codex's xhigh; Antigravity caps at the model's highest thinking level) and supports live or queued follow-ups.
  • Cross-harness subagents: Allow cross-harness subagents (Settings → Harnesses) decides whether other harnesses can run a harness as a subagent and whether its sessions can start subagents or sessions on other harnesses, or move a conversation to them on their own, through set_model or auto-handoff. A subagent on another harness needs it on for both. It starts on for every harness except Antigravity.
  • Edit permissions: With Allow edits enabled, a subagent acts without Claude Code's permission rules. Read-only Antigravity runs in an isolated folder under m4code's data directory with a hook that permits only reading and searching (your personal Antigravity rules, skills, and MCP servers do not load there).

Skills

Settings → Skills identifies packages by repository and skill ID. A package from another author that needs the same harness folder is marked Name in use. The page lets you filter installed skills, browse or search skills.sh, installs single SKILL.md packages or entire GitHub repositories (grouped by repository, with single-skill, per-repo, and Update All controls), and symlinks enabled skills globally or per project into each active harness. When scoped to a project, it also lists skills shipped in the repository (such as .claude/skills) read-only.

What it touches

  • Local files and settings: m4code never calls the Anthropic API directly, never deletes a transcript, never logs terminal contents, and changes Claude Code's settings only when you flip a switch.
  • Git refs: In a git repository, each session keeps its 20 newest working-tree snapshots as commits under refs/m4code/. They never touch your index, branches, or stash, though git log --all shows them.
  • Network: GitHub (update checks, the GitHub pane, and installing skills), skills.sh (browsing or searching skills), npm (the Claude Agent SDK and Codex ACP adapter), OpenAI (Codex sessions and subagents), your configured OpenCode providers (OpenCode sessions and subagents), and Google (Antigravity sessions and subagents).

Development

Toast notifications can be dismissed with their close button.

Visual fixtures include just screenshot session-events for the complete chat component and notice gallery, just screenshot session and just screenshot session-done for working and finished turns, just screenshot session-no-compact for the active-session inspector and compaction marker, just screenshot github-wide for the side-by-side GitHub pane, just screenshot harnesses for harness controls, just screenshot session-scrolled for Jump to latest, and just screenshot toast for notifications. Session fixtures use an offline ACP stand-in and never send a model prompt.

Prerequisites: stable Rust, Visual Studio Build Tools on Windows (or the system headers GPUI builds against on Linux), and just.

just run    # run the app
just test   # app, bridge, and mod tests
just ci     # build, tests, and web build
just screenshot home  # render the workspace to target/screenshots/home.png

Repository layout:

  • src/ — the Rust + GPUI desktop app
  • vendor/gpui-base/ — patched copy of the editor crate (Cargo.toml documents what the patch changes and when to drop it)
  • mod/ — the Claude Code plugin loaded by each session
  • bridge/ — the Node script that runs Claude Code sessions through the Claude Agent SDK
  • web/ — the project website

See AGENTS.md for the code layout and commands. Debug builds store data in a separate folder so they can run alongside an installed release; launching a second instance against the same data folder reports that m4code is already running and exits.

To release, bump version in Cargo.toml and push a vX.Y.Z tag.

About

Yet another Claude Code wrapper

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages