/code-exploration:nvim-debug-setupfrom code-exploration
Set up a project-local Neovim debugger for stepping through a program, using nvim-dap and Delve for Go. Produces a debug target in an untracked .nvim.lua, breakpoints placed from a code tour by searchable anchors instead of line numbers, a quickfix list of the tour, and program output shown in dap-ui. Can also adjust the user's global Neovim config for the dap-ui panels and for trusted project files. Use when the user wants to step through code in Neovim, mentions nvim-dap, delve or debugging in the editor, wants breakpoints for learning a codebase, or hands over a tour.json from the explore-codebase skill.
Ships in code-exploration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn a list of interesting places in a codebase into a debugger the user can
start with one key: a launch target, a breakpoint at every stop, and a quickfix
list that tells the story in order. Everything project specific lives in an
untracked .nvim.lua, so the repository and the user's global configuration stay
as they are unless the user asks for more.
The Go and Delve path is tested end to end. Other languages need the adapter and launch block swapped, see the last section.
A tour, normally the tour.json that the explore-codebase skill exports. It
can also be written by hand:
{ "title": "...", "stops": [ { "file": "src/app.go", "find": "func main(", "nth": 1, "note": "1. Entry point" } ] }
file is repo relative and find is a substring of one line, so edits to the
code do not move the breakpoints. nth picks the match when it is ambiguous.
How to run the program locally: the package, the arguments, any environment variables, the working directory. Ask when the repo does not make it obvious.
Check the prerequisites by looking, not assuming.
nvim --version.nvim-dap and nvim-dap-ui, under the plugin manager's directory.
nvim-dap-go is optional.dlv version.exrc enabled in the user's config, which is what loads .nvim.lua..nvim.lua. Never overwrite one without asking.Install nothing. If something is missing, say what, and propose the install through whatever the repo or the user prescribes for tools, for example mise.
Write the target. Copy assets/nvim.lua to .nvim.lua
at the repository root, because the tour anchors are repo relative. Edit only
the cfg block at the top: the name, the tour path, the build directory, the
package, the arguments and the environment. Add /.nvim.lua to
.git/info/exclude.
Prove it headless. Follow references/verification.md and run references/headless-session.lua. Keep going until the session stops at the first tour line. State which parts were only checked headless, because nothing here has been seen on screen.
Tell the user how to use it.
:luafile .nvim.lua in a running one. Run :trust
once, since Neovim asks before loading a project-local file.<name>: run, and step with the usual keys.:CodeTour lists the stops in order. :CodeTourBreakpoints sets the
breakpoints again after they were cleared.live = false in cfg. The
protocol and its limits are in the explore-codebase skill's
references/live-debugging.md. Variable values pass through the server, so
do not debug real production data with it on.Offer the global configuration changes only when they matter. If the user hits one of these symptoms, or asks for the change, read references/global-nvim-config.md first.
:trust prompt appears for every project the user owns.These edit the user's own configuration. Show the change, apply it only after a yes, and never commit it.
Each of these cost time once.
/tmp on macOS, or an
inherited $PWD that is not resolved, breaks it silently. The template
resolves symlinks and pins PWD for the build. Suspect this whenever the build
works and the program runs to the end without stopping.dlv process, so Neovim never sees it. The template sets
outputMode = "remote". Delve also never launches the program through
runInTerminal, so the dap-ui Console buffer is only fed by the on_output
hook in the template, which falls back to the REPL.env out when it is empty.nvim-dap-go replaces dap.configurations.go.
The template uses its own adapter name and a configuration provider, which
survive that.pcall and skips it with a warning, and the
tests run with -n.bufload skips filetype detection, so
the template runs filetype detect on every file it loads for a breakpoint.-gcflags=all=-N -l and
-ldflags=-compressdwarf=false, and without -trimpath.find that no longer matches skips that stop with a
warning. Fix the tour, not the Lua.curl.
A cfg.server that differs from the server's port fails without a message.go directive in a demo module's
go.mod makes mise pick a Go version for that directory, which can be too old
for delve. Leave it out of throwaway test modules.The structure carries over: an adapter registered under an own name, a
configuration provider instead of dap.configurations.<ft>, breakpoints placed
from anchors, and output routed to dap-ui. Replace the adapter table, the
build() function and the launch configuration in the template for the language
at hand and keep the rest. That has not been tested here, so read the adapter's
own documentation and run the headless verification before presenting the result.
| Path | What it is |
|---|---|
assets/nvim.lua | The project-local debug target to copy to .nvim.lua. |
assets/dap-panels.lua | A tested lazy.nvim spec that keeps files out of the dap-ui panels. |
references/verification.md | Headless recipes for the target, the layout and the mappings. |
references/headless-session.lua | Builds, launches and waits for the first stop. |
scripts/selftest_live.py | End to end test of the live bridge against a real delve session. |
references/global-nvim-config.md | Optional changes to the user's own Neovim configuration. |
assets/dap-panels.lua (opens in a new tab)assets/nvim.lua (opens in a new tab)references/global-nvim-config.md (opens in a new tab)references/headless-session.lua (opens in a new tab)references/verification.md (opens in a new tab)scripts/__pycache__/selftest_live.cpython-313.pyc (opens in a new tab)scripts/selftest_live.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cedi/agent-plugins --plugin code-exploration2 skills in this plugin
Other plugins' skills for the same job