>removedM

Resolved 💬 1 comment Opened Feb 17, 2026 by vshivram Closed Feb 18, 2026

Context

When using Claude Code agents for tasks that submit HPC/SLURM jobs, the current workflow is:

  1. Agent submits HPC job
  2. Agent writes job_id to signal file and exits
  3. External daemon monitors HPC job status
  4. When job completes, daemon spawns fresh agent to validate outputs

Potential Improvement

Instead of spawning a fresh agent, could we resume the same session that submitted the job? This would preserve:

  • Context about what was submitted
  • Any partial work/analysis done before submit
  • Reasoning about expected outputs

Questions to Explore

  1. Can claude --resume <session-id> be used programmatically?
  2. How long do sessions persist?
  3. Is there an API to check session state before resuming?
  4. Would resuming be more cost-effective than fresh context?

Current Workaround

Daemon auto-kills agent after HPC submit and respawns with explicit "HPC job X COMPLETED" prompt. Works but loses session context.

Related

This is for the workaholic autonomous task daemon: https://github.com/[user]/workaholic

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗