Files
team/memory/claude-code-rename.md
T
2026-04-19 21:47:08 +08:00

12 lines
936 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: Claude Code --name vs /rename
description: Claude Code 的 --name CLI 参数不可靠,必须用 /rename 斜杠命令持久化会话名称
type: feedback
originSessionId: b34450b8-ed29-4bd1-9d26-88636b7fa9a6
---
Claude Code v2.1.112+ 的 `--name` CLI 参数不会写入 `custom-title``agent-name` JSONL 记录,仅在内存中设置 `currentSessionTitle`,持久化依赖时序敏感的 `reAppendSessionMetadata()` 竞态条件。`/rename` 斜杠命令显式调用 `AN()` + `oP6()` 写入两条 JSONL 记录,始终可靠。
**Why:** `--name` 是 bridge/remote-control 模式专用参数,缺少完整的持久化路径。UI 显示优先级为 `agentName > customTitle > summary``--name` 两个字段都不写。
**How to apply:** 需要设置会话名称时,将 `/rename <name>` 作为 Claude Code 初始提示传入,而非 `--name`。在 runcc.sh 中:`claude "${CC_ARGS[@]}" "/rename $SESSION_NAME"`