Skip to content

feat: Session Replay & Templates #5083

@Aki-07

Description

@Aki-07

What feature would you like to see?

Status: RFC (Request for Comments)
Proposer: @Aki-07
Target: Codex CLI v0.3.0+

Problem Statement

Current State:
Every Codex session is ephemeral. When developers find a successful workflow (e.g., "set up React + TypeScript + Tailwind"), they cannot easily:

  • Reproduce it across projects
  • Share it with team members
  • Version control the workflow
  • Apply it with different parameters

Pain Points:

  • Developers repeatedly type similar prompts across projects
  • Successful patterns are lost after the session ends
  • No way to create "standard playbooks" for common tasks
  • Onboarding new developers requires manual guidance

Overview

This feature would allow developers to:

  1. Record a successful Codex session (prompts, commands, file diffs, responses).
  2. Convert it into a reusable, parameterized template (YAML-based).
  3. Replay it anytime using codex replay <template-name>.
  4. Share templates via Git, enabling collaborative and version-controlled workflows.
  5. Discover community or official templates via a built-in template marketplace.

Why it matters

Currently, every Codex session is transient, developers can’t easily reproduce or share a working flow.
This feature would:

  1. Improve reproducibility (no more retyping successful prompts).
  2. Boost team collaboration (shared org templates via Git).
  3. Simplify onboarding (run codex replay org/setup-react-app).
  4. Encourage community-driven patterns (React setup, Auth, CI/CD, etc.).
  5. In short, it elevates Codex from a conversational tool to a reproducible automation assistant.

Metrics

User Impact:

  • 50% reduction in time for repetitive tasks
  • 3x increase in workflow reuse across projects
  • Easier team onboarding (shared templates)
  • Community template library growth

Technical Metrics:

  • Template execution success rate > 90%
  • Replay performance within 10% of original session
  • Zero security incidents from template execution

Key Components (high-level)

  1. Recorder: Logs prompts, commands, file diffs, and outputs.
  2. Template Engine: Converts sessions into editable templates with parameters.
  3. Replay CLI: Deterministic execution with preconditions, approvals, rollback.
  4. Registry/Marketplace: Git-based registry for installing and sharing templates.

Implementation Plan

I’ve already drafted a detailed build plan and schema design for this feature including CLI structure, template YAML spec, security policy, and roadmap
Happy to contribute this implementation end-to-end once approved.

Additional information

Example CLI workflow:

codex record start
# Developer interacts with Codex
codex record stop --out session.jsonl
codex template init --from session.jsonl
codex replay react-app-setup --set project_name=my-app

Duplicate Check & Relationship to Existing Issues

While #4932 touches the surface of reusable “task templates,” this RFC introduces a broader, higher-level system enabling developers to record, parameterize, replay, and share entire Codex sessions, not just single prompts or scripts.
Therefore, this is not a duplicate, but an evolution of that concept into a structured replay and workflow automation framework for Codex CLI + IDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions