You just completed a task. Now produce a structured session log.
sessions/YYYY-MM-DD-<short-desc>.osop — workflow definitionsessions/YYYY-MM-DD-<short-desc>.osoplog.yaml — execution recordCreate the sessions/ directory if it doesn't exist.
$ARGUMENTS
yaml
osop_version: "1.0"
id: "session-<short-description>"
name: "<What you did>"
description: "<1-2 sentence summary>"
version: "1.0.0"
tags: [claude-code, <relevant-tags>]
nodes:
- id: "<step-id>"
type: "<node-type>" # human, agent, mcp, cli, api, cicd, git, db, docker, infra, system, event, gateway, data, company, department
subtype: "<subtype>" # Optional: llm, explore, plan, worker, tool, test, commit, rest, etc.
name: "<Step Name>"
description: "<What this step does>"
security:
risk_level: "<low|medium|high|critical>"
edges:
- from: "<step-a>"
to: "<step-b>"
mode: "sequential" # sequential, parallel, conditional, fallback, error, spawn, etc.
yaml
osoplog_version: "1.0"
run_id: "<generate-uuid>"
workflow_id: "<matches .osop id>"
mode: "live"
status: "COMPLETED"
trigger:
type: "manual"
actor: "user"
timestamp: "<ISO timestamp>"
started_at: "<ISO timestamp>"
ended_at: "<ISO timestamp>"
duration_ms: <total ms>
runtime:
agent: "claude-code"
model: "<current model>"
node_records:
- node_id: "<step-id>"
node_type: "<type>"
attempt: 1
status: "COMPLETED"
started_at: "<ISO>"
ended_at: "<ISO>"
duration_ms: <ms>
outputs:
<what you produced>
tools_used:
- { tool: "<tool-name>", calls: <n> }
reasoning:
question: "<what was decided>"
selected: "<chosen approach>"
confidence: <0.0-1.0>
result_summary: "<1-2 sentence summary>"
ActiontypesubtypeRead/explore filesmcp``toolEdit/write filesmcp``toolShell commandscli``scriptRun testscicd``testGit operationsgit``commit / branch / prAnalyze/reasonagent``llmSearch codebasemcp``toolAsk userhuman``inputUser reviewshuman``reviewSpawn sub-agentagent``explore / plan / workerAPI callsapi``rest
If you spawned sub-agents, use parent on child nodes and spawn edge:
yaml
nodes:
- id: "coordinator"
type: "agent"
subtype: "coordinator"
- id: "explore_1"
type: "agent"
subtype: "explore"
parent: "coordinator"
edges:
- from: "coordinator"
to: "explore_1"
mode: "spawn"