Skill.md
Harness Step 3 — Session State Management
Claude Code sessions are stateless by design. When a session ends, the agent forgets everything — what was being worked on, what was discovered, what's blocked and why. The typical workaround is to re-explain context at the start of every session. This skill replaces that workaround with a proper solution: state lives in files, not in agent memory.
The Three Files
init.sh — Environment health check
Run at the start of every session. Verifies dependencies are installed, config files exist, and the app's core modules load cleanly. Catches environment drift in seconds before it wastes a session.
tasks.json — Structured task queue
Each task has: id, title, description, status, priority, verify (an executable completion check), requires_eval (whether independent review is needed before marking done), and optionally blocked_by. Agents don't guess what to do next — they read the queue.
progress.md — Append-only session log
After each session, one entry is prepended. The next session reads the top 20 lines to know exactly where things stand. History is never deleted — it forms a traceable work log.
Session Startup Protocol (added to AGENTS.md)
1. bash init.sh → verify environment
2. git log --oneline -10 → see recent history
3. head -20 progress.md → see where we left off
4. read tasks.json → pick highest-priority pending task
The verify Field
Every task's verify field must be executable steps — not vague descriptions. Test: could a completely uninformed person follow this verify and independently determine whether the task is done? If no, make it more specific.
When to Use
- After completing Harness Steps 1 and 2, to close the loop on agent continuity
- Long-running projects with multiple work sessions
- Any project where you find yourself re-explaining context at the start of Claude sessions
Limitations
tasks.json is a queue, not an executor — tasks don't run automatically. Blocked tasks should document their blocked_by reason in enough detail that the next session can jump directly to the prerequisite without re-investigating.