惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
F
Fortinet All Blogs
Vercel News
Vercel News
C
Check Point Blog
P
Privacy International News Feed
Know Your Adversary
Know Your Adversary
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
TaoSecurity Blog
TaoSecurity Blog
I
Intezer
T
The Exploit Database - CXSecurity.com
Security Archives - TechRepublic
Security Archives - TechRepublic
H
Hacker News: Front Page
P
Proofpoint News Feed
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
IT之家
IT之家
D
DataBreaches.Net
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
Y
Y Combinator Blog
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
Lohrmann on Cybersecurity
T
Tenable Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 最新话题
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
K
Kaspersky official blog
PCI Perspectives
PCI Perspectives
A
Arctic Wolf
Latest news
Latest news
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
雷峰网
雷峰网
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
Schneier on Security
Schneier on Security
M
MIT News - Artificial intelligence

博客园 - 三驾马车

idea gitee 更新已取消 解决方案 ByteBuffer和ByteBuf区别 Marshalling.getProvidedMarshallerFactory("serial") 参数有那些 ProtobufVarint32FrameDecoder和ProtobufDecoder区别 protobuf 的 Varint 编码规范 netty initChannel ch.pipeline().addLast 先后顺序很重要 ChannelInboundHandlerAdapter 的channelRead和channelReadComplete的区别 Unpooled.buffer()和Unpooled.copiedBuffer区别 ServerBootstrap 和Bootstrap 区别 childhandler 和 handler 区别 ChannelInitializer<SocketChannel> 的作用详解 ChannelHandlerAdapter 和 ChannelInboundHandlerAdapter 的区别 SimpleChannelInboundHandler 中的 messageReceived 和 channelRead0 ChannelHandlerAdapter 与 ChannelInboundHandler 的区别 Application run failed .ParserException: while parsing a block mapping in 'reader' openssl genrsa 自签名ssl证书 上传本地项目到新建git项目 save download pdf
Claude Code 官宣:可以在 IDEA 用了!
三驾马车 · 2026-03-26 · via 博客园 - 三驾马车

前言

近期,Claude Code 正式推出了对 JetBrains IDE的官方支持。本文将详细介绍如何在 IDEA 中配置和使用 Claude Code,以及如何通过深度集成提升日常开发效率。

环境准备

1. 安装 Claude Code CLI

首先需要在系统中安装 Claude Code 命令行工具。确保你已安装 Node.js,然后执行:

npm install-g @anthropic-ai/claude-code

安装完成后,在终端中输入 claude 验证是否安装好

安装 IntelliJ IDEA 插件

在 IDE 中集成 Claude Code 需要安装官方插件,步骤如下:

  1. 打开 IntelliJ IDEA,进入 Settings/Preference
  2. 选择 PluginsMarketplace
  3. 搜索关键词 "Claude Code"
  4. 找到官方插件后点击 Install
  5. 安装完成后重启 IDE

image

启动与基本使用

安装完成后,你可以通过多种方式启动 Claude Code:

方式一:通过工具栏图标

在 IDE 右上角会出现 Claude Code 的图标(紫色菱形图标),点击即可唤起交互面板。

image

方式二:快捷键启动

默认快捷键:

  • macOS: Command + Escape
  • Windows/Linux: Ctrl + Escape

你可以在 Settings → Keymap 中搜索 "Claude Code" 自定义快捷键。

方式三:终端直接启动

如果你更习惯使用终端,可以直接在 IDEA 内置 Terminal 中输入:

进入交互模式后,Claude Code 会自动识别当前项目上下文。

image

核心功能:差异显示

IDEA 插件最强大的功能之一是原生差异显示支持。当 Claude Code 建议修改代码时,不再只是在控制台中显示文本,而是直接在 IDE 中打开标准的 Diff 视图:

使用流程

  1. 向 Claude 提出代码修改需求,例如:> "帮我重构这个类,提取重复的字符串处理逻辑"
  2. Claude Code 分析后,会在 IDE 中显示标准的差异对比窗口
  3. 你可以:
    • 逐行查看修改内容
    • 使用 IDE 的合并工具接受或拒绝特定更改
    • 一键应用所有修改或部分采纳

image

这种集成方式比纯文本输出更加直观,特别适合复杂的重构场景。

实用开发技巧

1. 上下文感知提问

由于插件深度集成,Claude Code 会自动获取当前打开的文件、光标位置和项目结构。你可以进行精准提问:

"解释当前选中这段代码的作用"

"给这个函数添加 JavaDoc 注释"

"找出这个类中潜在的 NPE 风险"

2. 批量文件处理

结合 IDEA 的项目视图,你可以选中多个文件或文件夹,然后要求 Claude Code:

"分析选中的这几个 Service 类,看看是否有重复逻辑可以提取"

"为选中的所有实体类生成 toString() 方法"

3. 与 IDE 功能协同

  • 代码检查: 先运行 IntelliJ 的代码分析,将报错信息复制给 Claude 请求修复建议
  • 版本控制: 在 Git 工具窗口中选中有冲突的文件,让 Claude 协助解决合并冲突
  • 运行配置: 让 Claude 帮你创建或优化运行配置

快捷键自定义建议

推荐为常用操作设置专属快捷键:

总结

通过将 Claude Code 集成到 IntelliJ IDEA 中,我们获得了AI 能力与专业 IDE 的完美结合