Skip to content

feat(claude): tell agents /tmp is node-local and controllers are jobs - #40

Merged
jayhesselberth merged 2 commits into
mainfrom
worktree-agent-tmp-and-controllers
Sep 5, 2026
Merged

feat(claude): tell agents /tmp is node-local and controllers are jobs#40
jayhesselberth merged 2 commits into
mainfrom
worktree-agent-tmp-and-controllers

Conversation

@jayhesselberth

Copy link
Copy Markdown
Member

Why

Two failures kept recurring in agent sessions:

  • An agent writes a script or input to its scratchpad directory, which lives under /tmp, then runs it through srun. The job lands on another node, where the file does not exist, and the run fails with No such file or directory.
  • A snakemake controller started in the session, or in an srun held open from it, dies with the session and takes the rest of the pipeline with it.

What

  • Briefing (sinteractive claude context) gains two paragraphs. /tmp and everything under it ($TMPDIR, the scratchpad) is that node's alone; before staging on /tmp, ask who has to read it. Whatever crosses the session/job line goes on the shared filesystem, and the briefing names the cluster's scratch: /scratch/alpine/$USER where it exists, else ~/scratch, as <scratch>/<topic>/. A workflow controller (snakemake, nextflow) is submitted with sbatch as a job of its own.
  • hpc-compute gets both rules as subsections under "Run work in its own allocation".
  • hpc-storage scopes the existing "write scratch to node-local /tmp" advice to a single allocation, and says where cross-node files go on each cluster.
  • slurm-batch gets an sbatch script for a snakemake controller, with notes on the slurm executor, --qos=long / cpu-long for long pipelines, and stopping it.
  • docs/scripting.md and the changelog follow.

Checks

cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and cargo test --workspace pass locally, run in a Slurm allocation.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMdc1VPnWGf95LCg1dJvJR

jayhesselberth and others added 2 commits September 5, 2026 06:32
Two failures kept recurring in agent sessions. An agent writes a script or
an input to its scratchpad directory, which lives under /tmp, then runs it
through srun; the job lands on another node, where the file does not exist,
and the run fails with "No such file or directory". And a snakemake
controller started in the session, or in an srun held open from it, dies
with the session and takes the rest of the pipeline with it.

The briefing now says both. /tmp and everything under it — $TMPDIR and the
scratchpad included — is that node's alone, so the rule is to ask who has
to read a file before staging it on /tmp: whatever crosses the session/job
line goes on the shared filesystem, and the briefing names the cluster's
scratch for it (/scratch/alpine/$USER where that exists, else ~/scratch).
A job's own intermediates, made and consumed inside one allocation, stay on
node-local disk, which the storage skill already recommends and now scopes
to that case. A workflow controller is submitted with sbatch as a job of
its own, bounded by nothing but its own -t.

The hpc-compute, hpc-storage and slurm-batch skills carry the same rules in
their own terms, with an sbatch script for a snakemake controller in
slurm-batch, and the scripting docs and changelog follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMdc1VPnWGf95LCg1dJvJR
The synthetic-walltime test stamped the state file with one now_epoch()
and observed it with another. When a second ticked over between the two,
the watch reported 1799 remaining instead of 1800 and the exact-value
assertion failed — as it did on CI for #40. The test now takes one clock
reading and uses it for every write and observation, so the remaining
seconds it asserts on are the ones it wrote.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMdc1VPnWGf95LCg1dJvJR
@jayhesselberth
jayhesselberth merged commit 62940f4 into main Sep 5, 2026
3 checks passed
@jayhesselberth
jayhesselberth deleted the worktree-agent-tmp-and-controllers branch September 5, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant