claude-code - 💡(How to fix) Fix [FEATURE] Agent tool: add resume_session parameter to respawn terminated agents [1 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#46364Fetched 2026-04-11 06:22:14
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Code Example

Agent(
    name: "dev-929",
    resume_session: "fb6dc0e5-5d6c-44c1-96e9-6c71a10ffde3",
    prompt: "CI found 246 regressions on your PR. Fix them."
  )

---

result = Agent(name: "dev-929", ...)
  # result.session_id = "fb6dc0e5-..."
  # Save for later resume
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When spawning teammate agents via the Agent tool, there's no way to resume a previously terminated agent's session. The CLI supports claude --resume <session-id>and session JSONL files persist on disk, but the Agent tool doesn't expose this.

Use case: dev agent pushes a PR, gets terminated to save RAM, CI reports regressions 15 min later. Currently the only option is spawning a fresh agent that has to re-read all context. With resume_session, the new agent would pick up exactly where the old one left off.

Proposed Solution

Add a resume_session parameter to the Agent tool that passes through to claude --resume <session-id>:

  Agent(
    name: "dev-929",
    resume_session: "fb6dc0e5-5d6c-44c1-96e9-6c71a10ffde3",
    prompt: "CI found 246 regressions on your PR. Fix them."
  )

The agent would load the terminated session's full conversation context, then process the new prompt as a continuation. The session ID could be captured from the Agent tool's return value when first spawning:

  result = Agent(name: "dev-929", ...)
  # result.session_id = "fb6dc0e5-..."
  # Save for later resume

Alternative Solutions

  • Keep agents idle instead of terminating (wastes ~350MB RAM per agent)
  • Write context summaries to files before shutdown, pass to new agent (lossy, manual)
  • Use SendMessage to wake idle agents (works but can't resume terminated ones)

Priority

High - Significant impact on productivity

Feature Category

API and model interactions

Use Case Example

  1. Team lead spawns a teammate to implement a feature
  2. teammate works for 30 min, pushes branch, opens PR, goes idle
  3. Team lead shuts down teammate to free RAM for other agents
  4. 15 min later, CI reports 246 test regressions on the PR
  5. Team lead wants to resume the teammate with full context of what it tried
  6. Currently: spawn fresh agent, re-read all files, lose debugging context
  7. With resume_session: agent picks up exactly where it left off

extent analysis

TL;DR

Add a resume_session parameter to the Agent tool to enable resuming previously terminated agent sessions.

Guidance

  • Implement the proposed solution by adding a resume_session parameter to the Agent tool, passing it through to claude --resume <session-id>.
  • Capture the session ID from the Agent tool's return value when first spawning an agent and save it for later resume.
  • Consider the alternative solutions, such as keeping agents idle or writing context summaries to files, but note their limitations (e.g., wasted RAM, lossy data).
  • Verify the fix by testing the resume_session parameter with a previously terminated agent session and checking that the new agent picks up where the old one left off.

Example

Agent(
  name: "dev-929",
  resume_session: "fb6dc0e5-5d6c-44c1-

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING