Magenta.nvim
A tool-use-focused LLM plugin for neovim.
Install / Use
/learn @dlants/Magenta.nvimREADME
magenta.nvim
___ ___
/' __` __`\
/\ \/\ \/\ \
\ \_\ \_\ \_\
\/_/\/_/\/_/
magenta is for agentic flow
Magenta provides transparent tools to empower AI workflows in neovim. It allows fluid shifting of control between the developer and the AI, from AI automation and agent-led feature planning and development.
Developed by dlants.me: I was tempted by other editors due to lack of high-quality agentic coding support in neovim. I missed neovim a lot, though, so I decided to go back and implement my own. I now happily code in neovim using magenta, and find that it's just as good as cursor, windsurf, ampcode & claude code.
I sometimes write about AI, neovim and magenta specifically:
🔍 Also check out pkb: A CLI for building a local knowledge base with LLM-based context augmentation and embeddings for semantic search. Can be used as a claude skill.
Note: I mostly develop using the Anthropic provider, so Claude Opus is recommended. I decided to drop support for other providers for now, since I am more interested in exploring the features space. If another provider becomes significantly better or cheaper, I'll probably add it.
📖 Documentation: Run :help magenta.nvim in Neovim for complete documentation.
Demos
Features
- Multi-threading support, forks and compaction
- Sub-agents for parallel task processing
- Web search server_tool_use with citations
- MCP (Model Context Protocol) tools
- Smart context tracking with automatic diffing
- Claude skills
- Progressive disclosure for large files and bash outputs
- Prompt caching
- Dev containers for isolated agent work (Docker)
Dev Containers
Magenta can spawn Docker sub-agents that work in isolated containers on their own branch. This enables safe, unsupervised parallel work — the agent can edit files, run tests, and make commits without touching your local setup.
Add a container section to .magenta/options.json:
{
"container": {
"dockerfile": "docker/Dockerfile",
"workspacePath": "/workspace"
}
}
The Dockerfile should install your project's toolchain and dependencies,
using Docker layer caching to keep rebuilds fast. See :help magenta-dev-containers for details.
Roadmap
- Local code embedding & indexing for semantic code search
Updates
<details> <summary>Recent updates (click to expand)</summary>Mar 2026
- Dev containers: spawn Docker sub-agents that work on isolated branches in containers. Dockerfile-based, no bind mounts, Docker layer caching for fast startup.
Feb 2026
- Type-checking now uses
tsgo(TypeScript native Go compiler from@typescript/native-preview) for ~5x faster checks. - Refactored tool architecture: separated tool execution from rendering, extracted shared capabilities (permissions, file I/O, shell) into a
capabilities/layer. This decouples tools from neovim, moving towards being able to run it via server/client architecture, and dev container support. - Auto-compaction with chunked incremental summarization and accurate token counting via
countTokensAPI. - Introduced the edit description language (edl) tool, which subsumes the insert and replace tools.
- Introduced explore subagent, blocking subagents for better token economy and exploration speed.
- I decided to drop next edit prediciton and inline edits. I think I'm going to pivot this in a slightly different direction - for more power around unsupervised agent mode and managing teams of agents.
Jan 2026
- Major provider refactor: messages now stored in native format, eliminating lossy round-trip conversions and improving cache reliability
- Reworked
@fork: it now clones the thread. Can now fork while streaming or pending tool use, and continue the original thread afterward - Bash command output now streams to temp files (
/tmp/magenta/threads/...) with abbreviated results sent to the model - New
@compactcommand for manual thread compaction - Tree-sitter minimap: large files now show structural overview (functions, classes) instead of just first 100 lines
- Improved abort handling: cleaner tool lifecycle management
- README split into
:help magentadocumentation - Breaking: Dropped support for non-Anthropic providers (openai, bedrock, ollama, copilot). I don't use them and maintaining them slowed me down in exploring new features. The new provider architecture is simpler - contributions to re-add providers welcome!
Dec 2025
- Enhanced command permissions system with argument validation and path checking
- Improved file discovery with
rgandfdsupport
Nov 2025
- System reminders for persistent context
- Skills support (
.claude/skillsdirectory)
Aug 2025
- PDF page-by-page reading
- Claude Max OAuth authentication
- Configurable chime volume
@forkfor thread forking with context retention
Jul 2025
-
Input buffer completions with nvim-cmp
-
Thinking/reasoning support
-
Remote MCP support (HTTP/SSE)
-
Fast models and
@fastmodifier -
spawn_foreachfor parallel sub-agents
Jun 2025
- Sub-agents for parallel task delegation
- Image and PDF support
- Copilot provider
May 2025
- Thread compaction/forking
- Smart context diffing
- Streaming tool previews
- Web search and citations
Earlier
</details>Installation
Requirements: Node.js v24+ (node --version), nvim-cmp
Recommended: fd and ripgrep for better file discovery
Using lazy.nvim
{
"dlants/magenta.nvim",
lazy = false,
build = "npm ci --production",
opts = {},
},
Using vim-plug
local vim = vim
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug('dlants/magenta.nvim', {
['do'] = 'npm ci --production',
})
vim.call('plug#end')
require('magenta').setup({})
Configuration
For complete configuration documentation, run :help magenta-config in Neovim.
Quick Setup
require('magenta').setup({
profiles = {
{
name = "claude-sonnet",
provider = "anthropic",
model = "claude-sonnet-4-5",
fastModel = "claude-haiku-4-5",
apiKeyEnvVar = "ANTHROPIC_API_KEY"
}
}
})
Supported Providers
- anthropic - Claude models via Anthropic SDK
See :help magenta-providers for detailed provider configuration.
Note: Other providers (openai, bedrock, ollama, copilot) were removed in Jan 2026. The new provider architecture is simpler - contributions welcome!
Project Settings
Create .magenta/options.json for project-specific configuration:
{
"profiles": [...],
"autoContext": ["README.md", "docs/*.md"],
"skillsPaths": [".claude/skills"],
"mcpServers": { ... }
}
See :help magenta-project-settings for details.
Usage
| Keymap | Description |
| ------------ | ---------------------------- |
| <leader>mt | Toggle chat sidebar |
| <leader>mf | Pick files to add to context |
| <leader>mn | Create new thread |
Input commands: @fork, @file:, @diff:, @diag, @buf, @qf, @fast
For complete documentation:
:help magenta-commands- All commands and keymaps:help magenta-input-commands- Input buffer @ commands:help magenta-tools- Tools and sub-agents:help magenta-mcp- MCP server configuration
Why it's cool
- The Edit Description Language is a small DSL that allows the agent to be more flexible and expressive about how it mutates files. This speeds up coding tasks dramatically as the agent can express the edits in a lot fewer tokens, since it doesn't have to re-type nearly identical content to what's already in the file twice!
- It uses the new rpc-pased remote plugin setup. This means more flexible plugin development (can easily use both lua and typescript), and no need for
:UpdateRemotePlugins! (h/t wallpants). - The state of the plugin is managed via an elm-inspired architecture (The Elm Architecture or TEA) code. I think this makes it fairly easy to understand and lays out a clear pattern for extending the feature set, as well as eases testing. It also unlocks some cool future features (like the ability to persist a structured chat state into a file).
- I spent a considerable amount of time figuring out a full end-to-end testing setup. Combined with typescript's async/await, it makes writing tests fairly easy and readable. The plugin is already fairly well-tested code.
- In order to use TEA, I had to build a VDOM-like system for rendering text into a buffer. This makes writing view code declarative. code [example defining a tool view](https://github.com/dlants/magenta.nvim/blob/main
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR



