Skip to content

Commit 9b8f2d7

Browse files
Deploy: auto published by siyuan-plugin-publisher 135151d
1 parent d255986 commit 9b8f2d7

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

2025/10/12/Cluade使用体验/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<meta property="og:description" content="这里开始写你的文章内容…">
2828
<meta property="og:locale" content="zh_CN">
2929
<meta property="article:published_time" content="2025-10-12T03:00:49.000Z">
30-
<meta property="article:modified_time" content="2025-10-12T07:25:27.235Z">
30+
<meta property="article:modified_time" content="2025-10-12T07:45:59.463Z">
3131
<meta property="article:author" content="一课一练">
3232
<meta property="article:tag" content="AI工具">
3333
<meta property="article:tag" content="大模型">
@@ -217,7 +217,7 @@ <h1 class="post-title" itemprop="name headline">
217217
<span class="post-meta-item-text">发表于</span>
218218

219219

220-
<time title="创建时间:2025-10-12 11:00:49 / 修改时间:15:25:27" itemprop="dateCreated datePublished" datetime="2025-10-12T11:00:49+08:00">2025-10-12</time>
220+
<time title="创建时间:2025-10-12 11:00:49 / 修改时间:15:45:59" itemprop="dateCreated datePublished" datetime="2025-10-12T11:00:49+08:00">2025-10-12</time>
221221
</span>
222222
<span class="post-meta-item">
223223
<span class="post-meta-item-icon">

about/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<meta property="og:description" content="关于我这里是关于页面,你可以在这里介绍自己。 个人简介 姓名:你的名字 职业:程序员 兴趣:编程、羽毛球 联系方式 Email: [email protected] GitHub: https:&#x2F;&#x2F;github.com&#x2F;wangxi-lab 关于本站本站使用 Hexo 构建,托管在 GitHub Pages。">
2828
<meta property="og:locale" content="zh_CN">
2929
<meta property="article:published_time" content="2025-10-12T03:24:38.000Z">
30-
<meta property="article:modified_time" content="2025-10-12T07:25:27.235Z">
30+
<meta property="article:modified_time" content="2025-10-12T07:45:59.463Z">
3131
<meta property="article:author" content="一课一练">
3232
<meta name="twitter:card" content="summary">
3333

@@ -203,7 +203,7 @@ <h3 id="个人简介"><a href="#个人简介" class="headerlink" title="个人
203203
<li>兴趣:编程、羽毛球</li>
204204
</ul>
205205
<h3 id="联系方式"><a href="#联系方式" class="headerlink" title="联系方式"></a>联系方式</h3><ul>
206-
<li>Email: <a href="mailto:&#x77;&#120;&#x5f;&#x79;&#x6f;&#117;&#120;&#x40;&#49;&#54;&#x33;&#46;&#99;&#x6f;&#x6d;">[email protected]</a></li>
206+
<li>Email: <a href="mailto:&#x77;&#120;&#x5f;&#121;&#111;&#x75;&#120;&#64;&#x31;&#x36;&#51;&#x2e;&#99;&#111;&#x6d;">[email protected]</a></li>
207207
<li>GitHub: <a target="_blank" rel="noopener" href="https://github.com/wangxi-lab">https://github.com/wangxi-lab</a></li>
208208
</ul>
209209
<h3 id="关于本站"><a href="#关于本站" class="headerlink" title="关于本站"></a>关于本站</h3><p>本站使用 Hexo 构建,托管在 GitHub Pages。</p>

categories/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<meta property="og:description" content="AI, blog">
2828
<meta property="og:locale" content="zh_CN">
2929
<meta property="article:published_time" content="2025-10-12T03:24:30.000Z">
30-
<meta property="article:modified_time" content="2025-10-12T07:25:27.235Z">
30+
<meta property="article:modified_time" content="2025-10-12T07:45:59.463Z">
3131
<meta property="article:author" content="一课一练">
3232
<meta name="twitter:card" content="summary">
3333

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ pre code {
12201220
vertical-align: middle;
12211221
}
12221222
.links-of-author a::before {
1223-
background: #ffff2d;
1223+
background: #13c609;
12241224
display: inline-block;
12251225
margin-right: 3px;
12261226
transform: translateY(-2px);

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ <h2 class="post-title" itemprop="name headline">
212212
<span class="post-meta-item-text">发表于</span>
213213

214214

215-
<time title="创建时间:2025-10-12 11:00:49 / 修改时间:15:25:27" itemprop="dateCreated datePublished" datetime="2025-10-12T11:00:49+08:00">2025-10-12</time>
215+
<time title="创建时间:2025-10-12 11:00:49 / 修改时间:15:45:59" itemprop="dateCreated datePublished" datetime="2025-10-12T11:00:49+08:00">2025-10-12</time>
216216
</span>
217217
<span class="post-meta-item">
218218
<span class="post-meta-item-icon">
@@ -344,7 +344,7 @@ <h2 class="post-title" itemprop="name headline">
344344

345345

346346
<div class="post-body" itemprop="articleBody">
347-
<p><img src="http://127.0.0.1:56173/assets/pixabay-9862220-20251007172103-zskm3z8.png" alt="image"></p>
347+
<p><img src="https://s2.loli.net/2025/10/12/OYLZkXeRxbH56N8.jpg" alt="image"></p>
348348
<h1 id="Claude-Code-最佳实践(官方)"><a href="#Claude-Code-最佳实践(官方)" class="headerlink" title="Claude Code 最佳实践(官方)"></a>Claude Code 最佳实践(官方)</h1><p>今年 4 月,Anthropic 正式发布了 <strong>Claude Code</strong> —— 一个专为代理式编程(agentic coding)设计的命令行工具。</p>
349349
<p>作为 Anthropic 内部研究项目的成果,Claude Code 为工程师和研究人员提供了一种更原生的方式,将 Claude 集成到日常编程工作流中。</p>
350350
<p>这篇来自 Anthropic 工程团队的技术文档<sup>[1]</sup> 推荐给对大家,它系统总结了内外部工程师在各种代码库、编程语言和开发环境中使用 Claude Code 的有效模式。</p>
@@ -389,7 +389,7 @@ <h3 id="a-创建-CLAUDE-md-文件"><a href="#a-创建-CLAUDE-md-文件" class="h
389389
<h3 id="b-调优你的-CLAUDE-md-文件"><a href="#b-调优你的-CLAUDE-md-文件" class="headerlink" title="b. 调优你的 CLAUDE.md 文件"></a>b. 调优你的 <code>CLAUDE.md</code> 文件</h3><p>你的 <code>CLAUDE.md</code> 文件会成为 Claude 提示的一部分,因此应该像任何频繁使用的提示一样进行优化。一个常见的错误是添加大量内容而没有迭代其有效性。花时间进行实验,确定什么能从模型中产生最佳的指令遵循效果。</p>
390390
<p>你可以手动向 <code>CLAUDE.md</code>​ 添加内容,或者按 <code>#</code>​ 键给 Claude 一个指令,它会自动将其合并到相关的 <code>CLAUDE.md</code>​ 中。许多工程师在编码时频繁使用 <code>#</code>​ 来记录命令、文件和风格指南,然后在提交中包含 <code>CLAUDE.md</code> 的更改,以便团队成员也能受益。</p>
391391
<p>在 Anthropic,我们偶尔会用 prompt improver<sup>[4]</sup> 来优化 <code>CLAUDE.md</code> 文件,并经常调整指令(例如,用 “IMPORTANT” 或 “YOU MUST” 来强调)以提高遵循度。</p>
392-
<p><img src="http://127.0.0.1:56173/assets/image-20251012152401-sp3giew.png" alt="image"></p>
392+
<p><img src="https://s2.loli.net/2025/10/12/XGBspfo6k1gzHqQ.png" alt="image"></p>
393393
<p></p>
394394
<h3 id="c-管理-Claude-的工具白名单"><a href="#c-管理-Claude-的工具白名单" class="headerlink" title="c. 管理 Claude 的工具白名单"></a>c. 管理 Claude 的工具白名单</h3><p>默认情况下,Claude Code 对任何可能修改你系统的操作都会请求许可:文件写入、许多 bash 命令、MCP 工具等。我们设计 Claude Code 时采用了这种刻意保守的方法,以优先考虑安全性。你可以自定义白名单,以允许你知道是安全的其他工具,或者允许那些易于撤销的潜在不安全工具(例如,文件编辑、<code>git commit</code>)。</p>
395395
<p>有四种方式来管理允许的工具:</p>
@@ -465,7 +465,7 @@ <h3 id="c-编写代码、截图结果、迭代"><a href="#c-编写代码、截
465465
<li><strong>当你满意时,让 Claude 提交</strong></li>
466466
</ol>
467467
<p>像人类一样,Claude 的输出通过迭代往往会显著改善。虽然第一个版本可能不错,但经过2-3次迭代后,它通常会看起来好得多。给 Claude 工具来看它的输出,以获得最佳结果。</p>
468-
<p><img src="http://127.0.0.1:56173/assets/image-20251012152414-nwyzvsg.png" alt="image"></p>
468+
<p><img src="https://s2.loli.net/2025/10/12/Y8iIaEbTOLj53MB.png" alt="image"></p>
469469
<h3 id="d-安全的-YOLO-模式"><a href="#d-安全的-YOLO-模式" class="headerlink" title="d. 安全的 YOLO 模式"></a>d. 安全的 YOLO 模式</h3><p>你可以使用 <code>claude --dangerously-skip-permissions</code> 来绕过所有权限检查,让 Claude 不间断地工作直到完成,而不是监督它。这对于修复 lint 错误或生成样板代码等工作流非常有效。</p>
470470
<p>让 Claude 运行任意命令是有风险的,可能导致数据丢失、系统损坏,甚至数据泄露(例如,通过提示注入攻击)。为了最小化这些风险,请在没有互联网访问的容器中使用 <code>--dangerously-skip-permissions</code>​。你可以参考这个使用 Docker Dev Containers 的参考实现​<sup>[7]</sup></p>
471471
<h3 id="e-代码库问答"><a href="#e-代码库问答" class="headerlink" title="e. 代码库问答"></a>e. 代码库问答</h3><p>在熟悉一个新的代码库时,使用 Claude Code 进行学习和探索。你可以向 Claude 提出与你在结对编程时会问项目中其他工程师的同类问题。Claude 可以智能地搜索代码库来回答一般性问题,例如:</p>

post/claude-code-best-practices-official-qedrk.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<meta property="og:site_name" content="一课一练的博客">
2727
<meta property="og:description" content="Claude Code 最佳实践(官方)今年 4 月,Anthropic 正式发布了 Claude Code —— 一个专为代理式编程(agentic coding)设计的命令行工具。 作为 Anthropic 内部研究项目的成果,Claude Code 为工程师和研究人员提供了一种更原生的方式,将 Claude 集成到日常编程工作流中。 这篇来自 Anthropic 工程团队的技术文档[1]">
2828
<meta property="og:locale" content="zh_CN">
29-
<meta property="og:image" content="http://127.0.0.1:56173/assets/pixabay-9862220-20251007172103-zskm3z8.png">
30-
<meta property="og:image" content="http://127.0.0.1:56173/assets/image-20251012152401-sp3giew.png">
31-
<meta property="og:image" content="http://127.0.0.1:56173/assets/image-20251012152414-nwyzvsg.png">
29+
<meta property="og:image" content="https://s2.loli.net/2025/10/12/OYLZkXeRxbH56N8.jpg">
30+
<meta property="og:image" content="https://s2.loli.net/2025/10/12/XGBspfo6k1gzHqQ.png">
31+
<meta property="og:image" content="https://s2.loli.net/2025/10/12/Y8iIaEbTOLj53MB.png">
3232
<meta property="og:image" content="https://mmbiz.qpic.cn/sz_mmbiz_jpg/2niaYkVLHpnGJpw7IUaC686ibWdgEBbSiaINCGsEfm2bbYFLWnibRP1yqY5ib5YawfSq1cjhZrRA2l1ibkVVJmlwrp8w/640?wx_fmt=other&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=2">
3333
<meta property="og:image" content="https://mmbiz.qpic.cn/sz_mmbiz_png/2niaYkVLHpnGJpw7IUaC686ibWdgEBbSiaIaCdwEw5gaFBV1RibOjIQ2Leo2DZRR8gPYcWzaOKh0P7RuLv3QFcElMA/640?wx_fmt=png&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=3">
3434
<meta property="og:image" content="https://mmbiz.qpic.cn/sz_mmbiz_jpg/2niaYkVLHpnGJpw7IUaC686ibWdgEBbSiaIeib9O3cCczOKdANqY2NZadUISUAedDN5GsParo27eL5T8tKRVO9Xulg/640?wx_fmt=other&from=appmsg&tp=webp&wxfrom=5&wx_lazy=1#imgIndex=4">
@@ -38,7 +38,7 @@
3838
<meta property="article:modified_time" content="2025-10-12T06:26:56.000Z">
3939
<meta property="article:author" content="一课一练">
4040
<meta name="twitter:card" content="summary">
41-
<meta name="twitter:image" content="http://127.0.0.1:56173/assets/pixabay-9862220-20251007172103-zskm3z8.png">
41+
<meta name="twitter:image" content="https://s2.loli.net/2025/10/12/OYLZkXeRxbH56N8.jpg">
4242

4343

4444
<link rel="canonical" href="https://wangxi-lab.github.io/post/claude-code-best-practices-official-qedrk">
@@ -265,7 +265,7 @@ <h1 class="post-title" itemprop="name headline">
265265

266266

267267

268-
<div class="post-body" itemprop="articleBody"><p><img src="http://127.0.0.1:56173/assets/pixabay-9862220-20251007172103-zskm3z8.png" alt="image"></p>
268+
<div class="post-body" itemprop="articleBody"><p><img src="https://s2.loli.net/2025/10/12/OYLZkXeRxbH56N8.jpg" alt="image"></p>
269269
<h1 id="Claude-Code-最佳实践(官方)"><a href="#Claude-Code-最佳实践(官方)" class="headerlink" title="Claude Code 最佳实践(官方)"></a>Claude Code 最佳实践(官方)</h1><p>今年 4 月,Anthropic 正式发布了 <strong>Claude Code</strong> —— 一个专为代理式编程(agentic coding)设计的命令行工具。</p>
270270
<p>作为 Anthropic 内部研究项目的成果,Claude Code 为工程师和研究人员提供了一种更原生的方式,将 Claude 集成到日常编程工作流中。</p>
271271
<p>这篇来自 Anthropic 工程团队的技术文档<sup>[1]</sup> 推荐给对大家,它系统总结了内外部工程师在各种代码库、编程语言和开发环境中使用 Claude Code 的有效模式。</p>
@@ -310,7 +310,7 @@ <h3 id="a-创建-CLAUDE-md-文件"><a href="#a-创建-CLAUDE-md-文件" class="h
310310
<h3 id="b-调优你的-CLAUDE-md-文件"><a href="#b-调优你的-CLAUDE-md-文件" class="headerlink" title="b. 调优你的 CLAUDE.md 文件"></a>b. 调优你的 <code>CLAUDE.md</code> 文件</h3><p>你的 <code>CLAUDE.md</code> 文件会成为 Claude 提示的一部分,因此应该像任何频繁使用的提示一样进行优化。一个常见的错误是添加大量内容而没有迭代其有效性。花时间进行实验,确定什么能从模型中产生最佳的指令遵循效果。</p>
311311
<p>你可以手动向 <code>CLAUDE.md</code>​ 添加内容,或者按 <code>#</code>​ 键给 Claude 一个指令,它会自动将其合并到相关的 <code>CLAUDE.md</code>​ 中。许多工程师在编码时频繁使用 <code>#</code>​ 来记录命令、文件和风格指南,然后在提交中包含 <code>CLAUDE.md</code> 的更改,以便团队成员也能受益。</p>
312312
<p>在 Anthropic,我们偶尔会用 prompt improver<sup>[4]</sup> 来优化 <code>CLAUDE.md</code> 文件,并经常调整指令(例如,用 “IMPORTANT” 或 “YOU MUST” 来强调)以提高遵循度。</p>
313-
<p><img src="http://127.0.0.1:56173/assets/image-20251012152401-sp3giew.png" alt="image"></p>
313+
<p><img src="https://s2.loli.net/2025/10/12/XGBspfo6k1gzHqQ.png" alt="image"></p>
314314
<p></p>
315315
<h3 id="c-管理-Claude-的工具白名单"><a href="#c-管理-Claude-的工具白名单" class="headerlink" title="c. 管理 Claude 的工具白名单"></a>c. 管理 Claude 的工具白名单</h3><p>默认情况下,Claude Code 对任何可能修改你系统的操作都会请求许可:文件写入、许多 bash 命令、MCP 工具等。我们设计 Claude Code 时采用了这种刻意保守的方法,以优先考虑安全性。你可以自定义白名单,以允许你知道是安全的其他工具,或者允许那些易于撤销的潜在不安全工具(例如,文件编辑、<code>git commit</code>)。</p>
316316
<p>有四种方式来管理允许的工具:</p>
@@ -386,7 +386,7 @@ <h3 id="c-编写代码、截图结果、迭代"><a href="#c-编写代码、截
386386
<li><strong>当你满意时,让 Claude 提交</strong></li>
387387
</ol>
388388
<p>像人类一样,Claude 的输出通过迭代往往会显著改善。虽然第一个版本可能不错,但经过2-3次迭代后,它通常会看起来好得多。给 Claude 工具来看它的输出,以获得最佳结果。</p>
389-
<p><img src="http://127.0.0.1:56173/assets/image-20251012152414-nwyzvsg.png" alt="image"></p>
389+
<p><img src="https://s2.loli.net/2025/10/12/Y8iIaEbTOLj53MB.png" alt="image"></p>
390390
<h3 id="d-安全的-YOLO-模式"><a href="#d-安全的-YOLO-模式" class="headerlink" title="d. 安全的 YOLO 模式"></a>d. 安全的 YOLO 模式</h3><p>你可以使用 <code>claude --dangerously-skip-permissions</code> 来绕过所有权限检查,让 Claude 不间断地工作直到完成,而不是监督它。这对于修复 lint 错误或生成样板代码等工作流非常有效。</p>
391391
<p>让 Claude 运行任意命令是有风险的,可能导致数据丢失、系统损坏,甚至数据泄露(例如,通过提示注入攻击)。为了最小化这些风险,请在没有互联网访问的容器中使用 <code>--dangerously-skip-permissions</code>​。你可以参考这个使用 Docker Dev Containers 的参考实现​<sup>[7]</sup></p>
392392
<h3 id="e-代码库问答"><a href="#e-代码库问答" class="headerlink" title="e. 代码库问答"></a>e. 代码库问答</h3><p>在熟悉一个新的代码库时,使用 Claude Code 进行学习和探索。你可以向 Claude 提出与你在结对编程时会问项目中其他工程师的同类问题。Claude 可以智能地搜索代码库来回答一般性问题,例如:</p>

tags/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<meta property="og:description" content="AI, blog">
2828
<meta property="og:locale" content="zh_CN">
2929
<meta property="article:published_time" content="2025-10-12T03:24:23.000Z">
30-
<meta property="article:modified_time" content="2025-10-12T07:25:27.236Z">
30+
<meta property="article:modified_time" content="2025-10-12T07:45:59.464Z">
3131
<meta property="article:author" content="一课一练">
3232
<meta name="twitter:card" content="summary">
3333

0 commit comments

Comments
 (0)