<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>跨会话 &#8211; mylogs.cn</title>
	<atom:link href="https://mylogs.cn/tag/%e8%b7%a8%e4%bc%9a%e8%af%9d/feed/" rel="self" type="application/rss+xml" />
	<link>https://mylogs.cn</link>
	<description>发现、记录、分享</description>
	<lastBuildDate>Sun, 09 Aug 2026 05:03:07 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Claude Code 新增跨会话消息，一个会话能喊醒另一个</title>
		<link>https://mylogs.cn/claude-code-cross-session-messaging-2/</link>
					<comments>https://mylogs.cn/claude-code-cross-session-messaging-2/#respond</comments>
		
		<dc:creator><![CDATA[steve, zhang]]></dc:creator>
		<pubDate>Sun, 09 Aug 2026 05:02:56 +0000</pubDate>
				<category><![CDATA[科技]]></category>
		<category><![CDATA[AI 编程]]></category>
		<category><![CDATA[Anthropic]]></category>
		<category><![CDATA[Claude Code]]></category>
		<category><![CDATA[人工智能]]></category>
		<category><![CDATA[命令行]]></category>
		<category><![CDATA[开发者工具]]></category>
		<category><![CDATA[跨会话]]></category>
		<guid isPermaLink="false">https://mylogs.cn/claude-code-cross-session-messaging-2/</guid>

					<description><![CDATA[如果你同时开着好几个 Claude Code 会话在跑不同的活，新版本里它们终于能互相「说话」了。根据官方文档 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">如果你同时开着好几个 Claude Code 会话在跑不同的活，新版本里它们终于能互相「说话」了。根据官方文档，跨会话消息功能需要 Claude Code v2.1.224 及以上版本，且仅在 macOS 和 Linux 上可用。当会话满足条件后，消息功能默认开启，无需额外设置。</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6a78326a5e12b&quot;}" data-wp-interactive="core/image" data-wp-key="6a78326a5e12b" class="wp-block-image size-large aligncenter wp-lightbox-container"><img fetchpriority="high" decoding="async" width="1200" height="630" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://mylogs.cn/wp-content/uploads/2026/08/8384af7a934376fbdfa8f2612e668b3c_header.webp" alt="Claude Code 新增跨会话消息，一个会话能喊醒另一个" class="wp-image-4154" style="max-width:100%;height:auto;" srcset="https://mylogs.cn/wp-content/uploads/2026/08/8384af7a934376fbdfa8f2612e668b3c_header.webp 1200w, https://mylogs.cn/wp-content/uploads/2026/08/8384af7a934376fbdfa8f2612e668b3c_header-300x158.webp 300w, https://mylogs.cn/wp-content/uploads/2026/08/8384af7a934376fbdfa8f2612e668b3c_header-1024x538.webp 1024w, https://mylogs.cn/wp-content/uploads/2026/08/8384af7a934376fbdfa8f2612e668b3c_header-768x403.webp 768w" sizes="(max-width: 1200px) 100vw, 1200px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">图片来源：Claude Code</figcaption></figure>





<p class="wp-block-paragraph">实现上，Claude 借助两个工具来完成这件事：ListAgents 用来发现当前能联系到哪些会话，SendMessage 则按名字把消息投递给其中一个。借助同一个 SendMessage，Claude 也能在同一个会话内部或团队里给子智能体发消息。官方文档主要讲的是不同独立会话之间的消息往来。</p>



<p class="wp-block-paragraph">最常见的使用场景，是一个会话手里有了另一个会话正需要的东西。比如某个会话改动了代码、引发破坏性变更，或者做出了某个决定，Claude 可以主动把要点总结后发给正在相关区域干活的会话，免去用户在多个终端之间来回复制粘贴；当多个会话在同一个代码仓库的不同工作副本上并行推进时，也能互相通报各自的进展；跑得久的迁移或测试任务，还能把状态回报给正在盯着的那个会话。此外，如果消息来自另一台机器或网页端，Claude 也能跨设备回一句。</p>



<p class="wp-block-paragraph">消息本身只是一段纯文本，而不是完整的对话历史或文件。Claude 会在工具调用之间读取消息，因此不会打断正在跑的操作；当接收方空闲时，则开一个新轮次来处理。每条到达的消息都要经过接收方的入站规则检查，最终落到三种结果之一：送达（Delivered）、暂存（Held）或拒收（Refused）。一旦送达，这条消息会像用户亲手输入的提示一样计入用量，接收方也能以同样方式回复——跨机器的一来一回除外。</p>



<p class="wp-block-paragraph">权限边界按会话各自隔离。Claude 被明确要求，绝不为另一个会话去做自身会话里被拒绝或拦下的操作，这类工作应当绕回交给你。在接收方一侧，它自身的权限提示和规则依旧对所有消息生效。你可以用 <code>/list-agents</code> 命令查看哪些会话可达，用 <code>crossSessionInbound</code> 设置来决定如何对待来自其他会话的消息：accept 直接送达、hold 先挂着等确认、refuse 直接丢弃。</p>



<p class="wp-block-paragraph">对重度使用 Claude Code 的开发者来说，这意味着并行多会话的协作终于有了内置的「对讲机」，而不必再靠人肉在终端间搬运信息。</p>



<p class="has-small-font-size wp-block-paragraph">来源：Claude Code 官方文档</p>

]]></content:encoded>
					
					<wfw:commentRss>https://mylogs.cn/claude-code-cross-session-messaging-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
