Skill in 《Harness Step 3 — Session State Management》

Skill Description

Creates init.sh (environment health check), tasks.json (structured task queue), and progress.md (append-only session log) — so any new Claude Code session recovers full working context in under 30 seconds, with no re-explanation from you.

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.

Install & Use

Install command

npx skills add simbajigege/book2skills/skills/harness-step3-session-management
OR

Direct download

Related Skills

Tool Permission System AI Skill

Design a configurable, layered permission/safety system for agent tools: one permission pipeline decides allow / ask / deny across enterprise/user/project scopes.

Harness Step 1 — Create AGENTS.md & Knowledge Base AI Skill

Scans your codebase and generates AGENTS.md (the agent's orientation file) plus a complete docs/ knowledge base skele...

Harness Step 2 — Fill docs/ with Real Content AI Skill

Deep-reads your codebase and fills every docs/ file with specific, accurate content grounded in what the code actuall...

Session Dream AI Skill

On-demand session memory distillation — extracts key decisions, eliminated approaches, new discoveries, and current b...

Agent Memory Implementation Guide AI Skill

Restructures a bloated or chaotic MEMORY.md into the 2-layer architecture Claude Code's autoDream service uses intern...

Compact Memory Implementation Guide AI Skill

A developer implementation guide for adding compact memory to an Agent built with the Anthropic API or Claude Agent S...

LangChain Tool Builder AI Skill

Build LangChain (Python) tools using Claude Code's fail-closed design pattern — unified name, schema, security, and e...

Compact with Memory AI Skill

Executes /compact correctly — generates a high-quality conversation summary that preserves reasoning, decisions, and ...

Query Loop Implementation AI Skill

Implement a production-ready LLM query loop for AI applications: tool calling, structured tool_result feedback, ReAct...

Common Stocks and Uncommon Profits AI Skill

Apply Philip Fisher's growth stock investment system to deeply evaluate any publicly traded company. Covers the full ...

The War of Art AI Skill

Apply the framework from *The War of Art* by Steven Pressfield as a structured