> Agent-ready spec from Diff of the Day (2026-11-28, idea 4). Give this file to your coding agent (Claude Code, Codex, Cursor) and ask it to build the P0 requirements first.

# Spec: Minimal bash-and-filesystem agent harness

## Problem Statement
Agent frameworks add layers for subagents, memory and background jobs. Philipp Schmid of Google DeepMind argued at the AI Engineer Code Summit (Nov 2026) that bash plus a filesystem already covers much of that. Building a harness with only those two tools shows how much of your current framework you still need.

## Goals
- A working agent loop with two tools: run a shell command and read or write files in a workspace.
- Memory, subagents and background work done only through files and processes.
- Three of your real tasks run on both this harness and your current setup, with results compared.

## Non-Goals
- A product or a framework for others: a learning harness.
- A sandbox that is safe for untrusted code: run it in a throwaway container or VM.
- Matching every feature of your current tool.

## User Stories
- As an engineer who builds agents, I want a harness small enough to read in one sitting so that I understand every step.
- As that engineer, I want memory kept as files the agent reads and writes so that I can inspect and edit it.
- As that engineer, I want a subagent to be just another process with its own folder so that I see what it adds.
- Edge case: as that engineer, I want long command output cut and saved to a file so that the context does not overflow.

## Requirements
### P0 (must have)
1. **Loop**: model call, tool call, result, repeat; stops on a final answer or a step limit.
   - [ ] Step limit and per-command timeout are configurable.
2. **Two tools**: `bash` (runs in the workspace, output capped and the full output saved to a file) and `files` (read, write, list inside the workspace only).
   - [ ] Given a path outside the workspace, when the files tool runs, then it refuses.
3. **Memory as files**: a `memory/` folder the agent is told to read at start and update at the end.
4. **Comparison** `results.md`: three tasks, both setups, success, steps and tokens.

### P1 (nice to have)
- Subagents as child processes with their own workspace folder and a result file.
- Background jobs started with a command and checked through a status file.

### P2 (future)
- A trace viewer that renders a run from its log file.

## Success Metrics
- Leading: the harness finishes at least two of the three tasks.
- Lagging: you remove or simplify one layer of your real setup based on the comparison.

## Open Questions
- Which model and which three tasks? (you)

## Timeline
A weekend.

## Agent Instructions
- **Suggested stack**: Python 3.12 or TypeScript on Node 22, the model provider's official SDK, no agent framework.
- **Build order**: loop with a fake model in tests → files tool with path tests → bash tool with output cap → memory folder → comparison runs → P1.
- **Safety**: run inside a container or VM with no production credentials; keep API keys in environment variables; never run as root.
- **Done when**: results.md has all three tasks filled from real runs.

## Sources
- Philipp Schmid (Google DeepMind) at AI Engineer Code Summit, via AI.Engineer on X: https://x.com/aiDotEngineer/status/2126435909843529935
