Skip to main content
When you tell your agent “save this session with GitWhy,” the agent generates a structured markdown document using this template, then saves it with git why save or the gitwhy_save MCP tool.

Full template

Section reference

Metadata fields

The metadata block immediately after the title is required:
  • Context ID — assigned by the CLI on save. The agent writes a placeholder (ctx_ prefix); the CLI replaces it with the real ID.
  • Date — ISO 8601 timestamp. The agent writes the current time; the CLI validates and normalizes it.
  • Saved by — the developer’s GitHub username or name.
  • Agent — the agent name and model, in the format agent-name (model-version).

Validation

When you run git why save, the CLI validates that these required sections are present:
  • ## Prompt
  • ## What Was Done
  • ## Reasoning
  • ## Files
If any are missing, the save fails with a message identifying which sections to add.

See also