Skip to content

agent: Add "open claude code" command#46530

Closed
jtaub wants to merge 1 commit intozed-industries:mainfrom
jtaub:add-open-claude-code-command
Closed

agent: Add "open claude code" command#46530
jtaub wants to merge 1 commit intozed-industries:mainfrom
jtaub:add-open-claude-code-command

Conversation

@jtaub
Copy link
Copy Markdown
Contributor

@jtaub jtaub commented Jan 10, 2026

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.

image

Adds a new command agent: open claude code.

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.

Release Notes:

  • Added agent: open claude code action to quickly navigate to Claude Code in the agent panel.

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>
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 10, 2026
@SomeoneToIgnore SomeoneToIgnore added the area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features label Jan 10, 2026
Copy link
Copy Markdown

@himudigonda himudigonda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@versecafe
Copy link
Copy Markdown
Contributor

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 agent: open <name>

@jtaub
Copy link
Copy Markdown
Contributor Author

jtaub commented Jan 13, 2026

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.

@bennetbo
Copy link
Copy Markdown
Member

bennetbo commented Jan 21, 2026

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:

  • Use workspace: toggle right dock (cmd-?) to activate the agent panel (Or whichever side you have your agent panel on)
  • Define a custom keybinding like this:
 {
    "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 context to Workspace if you want it to work from any panel.

In case user demand grows for this feature we can think about how we can solve the problems i mentioned above.

@bennetbo bennetbo closed this Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants