claude-code - 💡(How to fix) Fix Agent name lost when session continues from context compaction [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48753Fetched 2026-04-16 06:51:56
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

When a Claude Code session runs out of context and is continued into a new session (context compaction), the agent name assigned via the rename feature disappears. The name is no longer displayed on the right side of the screen.

Root Cause

When a Claude Code session runs out of context and is continued into a new session (context compaction), the agent name assigned via the rename feature disappears. The name is no longer displayed on the right side of the screen.

RAW_BUFFERClick to expand / collapse

Description

When a Claude Code session runs out of context and is continued into a new session (context compaction), the agent name assigned via the rename feature disappears. The name is no longer displayed on the right side of the screen.

Steps to reproduce

  1. Start a Claude Code session
  2. Rename the agent using the rename feature
  3. Verify the name displays on the right side of the screen
  4. Continue working until the session runs out of context and is auto-continued
  5. The agent name is gone — no longer displayed

Expected behavior

The agent name should persist across context compaction / session continuation.

Actual behavior

The name is lost and not carried over to the continued session.

Environment

  • Claude Code v1.x (CLI)
  • macOS Darwin 24.6.0

extent analysis

TL;DR

The agent name assigned via the rename feature may need to be persisted across sessions to prevent loss during context compaction.

Guidance

  • Verify if the rename feature stores the agent name in a session-specific or global configuration to understand why it's lost during context compaction.
  • Check if there's an existing mechanism to save agent names across sessions, such as a configuration file or database.
  • Investigate the context compaction process to see if it resets or clears any stored agent information.
  • Consider adding a feature to automatically save and restore agent names during session continuation.

Example

No code snippet can be provided without more information about the internal workings of the Claude Code session management.

Notes

The solution may depend on the internal implementation of the Claude Code rename feature and session management. Without access to the codebase or more detailed documentation, it's difficult to provide a specific fix.

Recommendation

Apply a workaround, such as manually saving and restoring agent names during session continuation, until a more permanent solution can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The agent name should persist across context compaction / session continuation.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING