Add user-controlled, persistent transcript folding to Codex CLI

Open
#33,534 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

Start by reviewing the linked prototype's source, automated tests, and manual verification procedure, then compare its behavior with Codex CLI's normal view and transcript viewer. Done means reversible folding for completed messages, associated tool activity, fold-all and expand-all controls, per-thread persistence across task switching and resume, synchronized views, and no changes to transcript context or workspace output.

Written by the indexing model from the issue text.

Description

CLI enhancement session TUI

What variant of Codex are you using?

CLI

What feature would you like to see?

Add reversible, user-controlled transcript folding for any completed user message or assistant response in Codex CLI.

When an assistant response is folded, the committed tool activity associated with that response—such as web searches, commands, MCP calls, patches, and their output—should fold with it. The placeholder should retain a compact summary, including useful details such as tool-call count, related item count, line count, and character count.

The feature should:

  • be explicitly user-triggered and never automatically hide transcript content;
  • allow any completed user message or assistant response to be folded and expanded independently;
  • fold an assistant response together with its associated tool activity;
  • support fold-all and expand-all operations;
  • persist fold state separately for each thread;
  • restore the same fold state after task switching or codex resume;
  • keep the normal inline view and the transcript viewer synchronized;
  • preserve the complete transcript, model context, and workspace state.

This is a presentation-layer feature. Folding must not delete messages, remove information from the model context, or change any files produced during the task.

Why?

Long-running agent tasks often contain many searches, commands, patches, progress updates, and tool results. This information is valuable when inspecting how Codex performed the work, but it can make it difficult to reread the original requests, decisions, and final answers.

Reversible transcript folding lets users organize a long session without losing its audit trail or creating ambiguity about what the model can still see.

Working prototype

I implemented and tested a working Codex CLI prototype:

https://github.com/wdxhr3/codex-transcript-folding

The prototype currently includes:

  • Tab and Shift+Tab navigation between completed user and assistant messages, with immediate selection feedback;
  • Space to fold or expand the selected message;
  • f to fold all messages and Shift+F to expand all messages;
  • assistant-response folding that also folds its associated tool activity;
  • summaries such as Assistant response collapsed · 3 tool calls · 12 lines · 684 chars · 1 related item;
  • per-thread fold-state persistence;
  • restoration after task switching and codex resume;
  • synchronized folded state in the normal view and transcript viewer;
  • no automatic folding and no changes to model context or workspace output.

The repository contains source code, automated tests, bilingual documentation, build instructions, and a step-by-step manual verification procedure. The implementation has been built and manually verified with message folding, related tool activity, task switching, and session resume behavior.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.