---
yatl_version: 1
title: Implement temp directory structure for output
id: r5tbh396
created: 2026-01-18T21:40:10.343943Z
updated: 2026-01-27T02:08:42.712531Z
author: Brian McCallister
priority: high
tags:
- foundation
---

Create output directory structure:

```
$output_dir/
├── $host1/
│   ├── command      # Script: ssh $host1 $cmd (for replay/debug)
│   ├── out.log      # Captured stdout/stderr
│   ├── meta.json    # Timing, exit status, start/end times
│   └── status       # Simple file: "running", "success", "failed"
├── $host2/
│   └── ...
└── .keep            # If present, don't delete on exit
```

Use tempfile crate for temp directory management. Directory should be cleaned up on exit unless --keep flag or .keep file exists.

---
# Log: 2026-01-18T21:40:10Z Brian McCallister

Created task.

---
# Log: 2026-01-27T02:08:42Z Brian McCallister

Closed: Implemented in spike - temp dir with host subdirs and tmux.sock
