agent: Add "open claude code" command#46530
agent: Add "open claude code" command#46530jtaub wants to merge 1 commit intozed-industries:mainfrom
Conversation
Adds a new command `agent: open claude code` that directly opens Claude Code in the agent panel without going through the onboarding modal. Behavior: - Opens Claude Code in the agent panel - Reuses existing Claude Code thread if one is already open - Creates a new thread if switching from a different agent type Includes unit tests for both scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
himudigonda
left a comment
There was a problem hiding this comment.
Thanks so much for this PR, @jtaub! I was actually working on a very similar implementation myself, but your code is much more complete, so I’ll be scraping my local branch in favor of yours. I think this would be a great addition and I'd love to see the team merge this!
|
I don't think hard baking claude code into the zed actions is an ideal approach, if this were to be done it would make far more sense to make it part of the extension system, then extensions could register their commands, another option would be to register all agents zed native + all ACP as |
|
I think I agree. I was torn between adding actions for all of the supported agents, and keeping this PR as small and focused as possible. |
|
Hey, thank you for working on this! I can see the use case for it; however, I think this change only makes sense if we add actions for all available agents, including extensions and custom ones. The problem with that is that our action system and command palette do not allow 'dynamic' actions. You either need to define a concrete type beforehand (as you've done here for Claude-Code), or the actions need to take a parameter. The former does not work for extensions and custom agents, as they are dynamic. The latter does not work, as actions that take parameters do not show up in the command palette. For now, I'll close this, but here are my suggestions on how you can achieve almost the same functionality with key bindings:
{
"context": "AgentPanel",
"bindings": {
"keybinding-here": [ // (e.g. cmd-k cmd-c)
"agent::NewExternalAgentThread",
{ "agent": "claude_code" },
],
},
},Which then let's you spawn a new claude session via the keybinding, whenever you are inside the agent panel. You can also change the In case user demand grows for this feature we can think about how we can solve the problems i mentioned above. |
Hello Zed team!
I primarily use Claude Code and found myself wishing there was an easier way to navigate to Claude Code from within Zed, so I thought I would try my hand at implementing this (with some help from Claude Code, of course).
The change is small, but I'm a Rust newbie with only a few weeks of experience. I have also never programmed in gpui or contributed to Zed before (besides a simple keymap change). Any feedback at all would be appreciated.
Adds a new command
agent: open claude code.Behavior:
Includes unit tests for both scenarios.
Release Notes:
agent: open claude codeaction to quickly navigate to Claude Code in the agent panel.