Browse, search, organize, and resume past Codex CLI / Claude Code sessions through the official VS Code extensions.
Latest release: 1.5.1 (2026-05-08).
Codex and Claude Code sessions can become hard to revisit once they are no longer active in the editor. Codex History Viewer keeps those local session files useful by turning them into a searchable, chat-like history browser inside VS Code.
Use it to find past prompts, reuse useful answers, inspect file changes, organize sessions with tags and notes, and hand off past sessions to the official Codex and Claude Code VS Code extensions for resume.
- Revisit past Codex CLI and Claude Code sessions that are no longer easy to access from the active editor flow
- Browse sessions in a year / month / day tree or a latest-first list
- Search across prompts, responses, tool output, tags, and notes
- View sessions in a chat-like UI with Markdown, code highlighting, math rendering, and file-change diffs
- Keep open chat tabs up to date with header-controlled auto-refresh modes
- Show supported image attachments from Codex / Claude sessions, with on-demand loading, preview, and save controls
- Organize sessions with pins, tags, notes, custom titles, saved searches, and filters
- Resume past sessions through the official Codex and Claude Code VS Code extensions
- Five views: Control, Pinned, History, Search, and Status
- Optional multi-source history support (Codex / Claude) with source-aware filtering
- History view can switch between a year/month/day tree and a latest-first flat session list
- History filters for date scope, project/CWD, source, and tags
- Configurable history date basis (
started/lastActivity) for the History tree and date-based search filtering - Optional automatic refresh for local session file changes, with debounce and automatic refresh interval controls
- One-click "Filter by Current Project" action in the History view header (toggle on/off)
- Tag filters in Pinned and Search views (separate from History filters)
- Session tooltips can show both Started and Last activity timestamps when they differ
- Session tooltips can be shown as full details, compact metadata, or the title-only tree row
- Session titles can be renamed inside this extension, with original titles available in detailed tooltips
- Open any session in a chat-like viewer (Webview) with Markdown rendering, syntax-highlighted fenced code blocks (powered by Shiki), and toolbar quick actions for pin/unpin, Markdown transcript, prompt excerpt copy, and source-aware resume (OpenAI Codex for Codex sessions, Claude Code for Claude sessions)
- Chat viewer renders inline and block equations with KaTeX-compatible math support
- Chat viewer renders supported image attachments from data/local image references, loads image data on demand, and shows a clear unavailable state for unsupported, missing, remote-only, disabled, or oversized images
- Image attachments open in an in-view preview modal with a thumbnail strip, previous/next navigation, left/right keyboard navigation, fit/original-size toggle, and save action
- Chat viewer supports tool-specific cards with a configurable display mode (
detailsOnly/compactCards) - Chat viewer defers heavy tool details and patch diff rows until Show details is enabled or a diff entry is expanded
- Chat viewer shows assistant model, token usage, and related runtime metadata for Codex / Claude sessions only when Show details is enabled
- Chat viewer can show environment snapshots and tool execution metadata when the session file contains CWD, Git, status, exit code, or duration details
- Chat viewer can softly fold long
userandassistantmessages independently, while Show details always expands them fully - Chat viewer restores to the currently viewed card when Show details is toggled, falling back to the next visible card when needed
- Chat viewer cards can be expanded individually to full width when a message, tool result, or diff needs more horizontal space
- Chat viewer shows grouped file-change cards from patch activity, with collapsible side-by-side diffs, per-hunk wrap toggles, syntax highlighting, previous/next diff navigation, and jump-to-line actions
- Chat viewer includes a right-side in-page search sidebar with match counts, result snippets, line hints for diffs, direct result navigation, and resizable overlay behavior
- Chat viewer toolbar includes quick scroll actions (first / latest rendered card) and automatically switches label buttons to icon-only mode when the header gets narrow
- Chat viewer toolbar can show an auto-refresh button per chat tab when the History auto-refresh setting is enabled. Modes are
off,on with current view preserved, andfollow latest. - Chat tab auto-refresh keeps open chat tabs up to date while VS Code is focused, including tabs that are open in the background.
- Chat tab reload and auto-refresh preserve the current view state, including scroll position, selected message, expanded cards/diffs, details visibility, diff wrap state, and in-page search state.
- Reusable chat tabs reset session-scoped Webview state when switching to a different session, avoiding stale search, preview, or image-cache state.
- Selecting a session uses a reusable chat tab, while Open in New Tab (Chat) keeps the session in its own tab
- If the same session is already open, selecting or opening it activates the existing chat tab instead of creating a duplicate
- Chat sessions can open at the top or near the last viewed message, based on the setting
- Last-viewed-message restoration uses the previous rendered message or the top when no message bubble is visible
- Chat viewer scrolling starts below the fixed toolbar
- Reload in the chat viewer preserves scroll/selection and refreshes the tab title using the active history date basis
- Follow latest auto-refresh targets the latest non-diff content card when trailing grouped diff cards are present, while the bottom scroll action targets the latest rendered card
- Workspace-relative Markdown file links open inside VS Code from both chat sessions and Markdown transcripts
- Chat tab icon switches by source (
Codex/Claude) - Chat header annotation block (tags + note), including quick actions (filter/remove/edit)
- Time zone-aware timestamps based on the VS Code extension host environment (falls back to
UTCif unavailable) - Language-aware command labels (Japanese/English) based on
codexHistoryViewer.ui.language - Full-text search across sessions (cancellable, configurable max results, optional case sensitivity)
- Incremental local search index for faster repeated searches (tracks file updates/deletions and prunes stale entries)
- Search scope follows the active History filters (date scope, project/CWD, and source)
- Search roles filter (default:
user/assistant, optionaldeveloper/tool) with configurable defaults from the Search header or Control view - Search index tool-content scope can be reduced from the compatibility default (
toolCallsAndOutputs) totoolCallsorconversationOnlyto shrink the local search index; Codexcustom_tool_callrecords are indexed as lightweight tool metadata when tool calls are enabled - Search rerun (current conditions), search pane reset, and saved search presets (run/save/delete)
- Search hits include session annotations (
tag/note) in addition to message/tool text - Advanced query syntax:
/regex/,re:...,exact:..., andAND/OR/NOT - Session titles can optionally prefer native titles from Codex / Claude metadata while preserving the generated-title default
- Session tags/notes annotations (editable from tree context menus and chat view)
- Global tag operations: bulk rename tag and bulk delete tags
- Cleanup Missing Pins action for stale pinned entries
- Promote: copy a past session into "today" without modifying the original file
- Safe deletion: moves files to the OS trash/recycle bin by default (falls back to an internal quarantine folder if trash fails)
- Multi-select support for open/pin/promote/delete
- Drag & drop pinning: drag sessions from History or Search into Pinned
- Import/Export sessions: export raw JSONL or sanitized Markdown transcripts, and import with duplicate session ID handling (skip or overwrite)
- Control view for settings, import, rebuild cache, empty trash, bulk tag maintenance, and undo
- Dedicated refresh actions for Pinned, History, and Status, plus global refresh from the Control view
- History view shows a localized loading row during initial startup and helpful empty-state guidance when no sessions are found or active filters match nothing
- Manual trash cleanup: Empty Trash clears internal trash/quarantine files and legacy cache/index generations on demand
- Undo last action (pin/unpin/promote/delete/annotation/tag operations)
- Status view metrics, including current filters/roles/tags, total tag count, cache folder size, trash file count, and copyable paths for the current project and session roots
- Open the Activity Bar and select Codex History.
- Use Control for global actions (settings/import/rebuild cache/empty trash/search defaults).
- Browse sessions under History and apply filters (date/project/source/tag) as needed.
- Select a session to open the reusable chat tab, or run Open in New Tab (Chat) to keep it in its own tab.
- Run Search... and refine with roles, query syntax, presets, and search tag filters.
- Use context menus or chat header actions to edit tags/notes and run bulk tag operations when needed.
- Resume a session through the official Codex or Claude Code extension when you want to continue the work.
The History view header uses compact icon actions:
| Action | What it does |
|---|---|
| Refresh | Reloads the History view |
| Show Latest First / Show by Date | Switches between the latest-first list and date-grouped tree |
| Filter History | Filters by date, project, source, or tags |
| Filter by Current Project | Narrows history to the active workspace |
| Source | Cycles Codex / Claude / all enabled sources |
| Clear Filters | Removes active History filters |
Most actions are available from view title buttons and tree context menus.
For the full command list with per-command descriptions, see:
codexHistoryViewer.sessionsRoot: Root folder of Codex sessions. Leave empty to use the default (~/.codex/sessions).codexHistoryViewer.claude.sessionsRoot: Root folder of Claude Code sessions. Leave empty to use the default (~/.claude/projects).codexHistoryViewer.sources.enabled: Enabled history sources. Default is["codex"]. Addclaudeto load Claude history too.codexHistoryViewer.preview.openOnSelection: Open a preview when selecting an itemcodexHistoryViewer.preview.maxMessages: Max number of user/assistant messages to include in tooltips and quick previewscodexHistoryViewer.preview.tooltipMode: How much information session tree tooltips show (full,compact, ortitleOnly)codexHistoryViewer.search.defaultRoles: Default roles used when running SearchcodexHistoryViewer.search.indexToolContent: How much tool content the search index stores (conversationOnly,toolCalls, ortoolCallsAndOutputs)codexHistoryViewer.search.caseSensitive: Whether search is case-sensitivecodexHistoryViewer.search.maxResults: Max number of search hits to collectcodexHistoryViewer.history.dateBasis: Which session date the History tree and date-based search filters use (startedorlastActivity)codexHistoryViewer.history.titleSource: How session titles are resolved (generatedornativeWhenAvailable)codexHistoryViewer.autoRefresh.enabled: Automatically refresh History and opt-in chat tabs when local session files change. Disabled by default.codexHistoryViewer.autoRefresh.debounceMs: Delay before automatic refresh after a local session file change. Multiple nearby events are merged.codexHistoryViewer.autoRefresh.minIntervalMs: Minimum automatic refresh interval. Higher values reduce refresh frequency during active writes.codexHistoryViewer.chat.openPosition: Where a chat session opens when returning to a previously viewed session (toporlastMessage)codexHistoryViewer.chat.toolDisplayMode: How tool activity appears in the chat viewer (detailsOnlyorcompactCards)codexHistoryViewer.chat.userLongMessageFolding: How longusermessages are folded in the chat viewer (off,auto, oralways)codexHistoryViewer.chat.assistantLongMessageFolding: How longassistantmessages are folded in the chat viewer (off,auto, oralways)codexHistoryViewer.images.enabled: Show supported image attachments in the chat viewercodexHistoryViewer.images.maxSizeMB: Maximum image size to load for preview and savingcodexHistoryViewer.images.thumbnailSize: Thumbnail size for image attachments (small,medium, orlarge)codexHistoryViewer.resume.openTarget: WhereResume in OpenAI Codexopens the conversation (sidebarby default, orpanel)codexHistoryViewer.delete.useTrash: When deleting, move files to the OS trash/recycle bin (recommended)codexHistoryViewer.ui.language: UI language for this extension (auto/en/ja)codexHistoryViewer.ui.alwaysShowHeaderActions: Always show view header action icons (enables VS Code settingworkbench.view.alwaysShowHeaderActions)codexHistoryViewer.debug.logging.enabled: Write diagnostic timing logs to the Codex History Viewer output channel. Disabled by default and intended for troubleshooting.
- Open Settings and add
claudeto Codex History Viewer > Sources: Enabled. - If needed, set Codex History Viewer > Claude: Sessions Root.
- If history or search results look incorrect or stale, run Control > Rebuild Cache. It recreates both the history cache and the search index after confirmation.
- If you want new or updated local sessions to appear without manual refresh, enable the History auto-refresh setting. Automatic refresh runs while the History view is visible or an auto-refresh-enabled chat tab is open, and only while the VS Code window is focused.
- Auto-refresh reacts to local session file changes. For Codex sessions, assistant output may be written to
rollout-*.jsonlonly after a response or turn is complete, so chat tabs may not update token-by-token while the answer is still streaming. - If chat tab auto-refresh still feels delayed after the session file changes, try lowering
codexHistoryViewer.autoRefresh.debounceMsand/orcodexHistoryViewer.autoRefresh.minIntervalMs. Lower values feel more live but can increase CPU and disk activity. - To prevent the cache folder from growing over time, regularly run Control > Empty Trash. Trash files are not deleted automatically, and this also removes legacy cache/index generations.
- For performance troubleshooting, enable
codexHistoryViewer.debug.logging.enabledinsettings.json, then inspect Output > Codex History Viewer. Logs include counts and timings, not session paths or message content.
- When you run
Resume in OpenAI Codexfor the first time, VS Code may show a security prompt asking whether the target extension can open the URI. - This is expected VS Code behavior for extension URI handlers (
vscode://...). - If you click Cancel, resume will not proceed. Click Open to allow the handoff.
- If you check "Do not ask me again for this extension", future resumes will not show the same prompt.
- You can manage previously authorized extension URIs from Command Palette:
Extensions: Manage Authorized Extension URIs... - If the official Codex extension stops reopening a conversation, try these VS Code commands before reloading the whole window:
Developer: Reload Webviews, thenDeveloper: Restart Extension Host, thenDeveloper: Reload Window.
- Export supports session/day/month/year selections and uses one timestamped output root per operation.
- Selecting a folder-level node exports all sessions under that node.
- Multi-select export preserves
YYYY/MM/DDhierarchy for each source session. - Import recursively scans the selected source folder for
.jsonlfiles. - Import duplicate session IDs can be handled as
skiporoverwriteat runtime.
- Changed chat auto-refresh
follow latestscrolling to prefer the latest non-diff content card when trailing grouped diff cards are last. - Fixed chat auto-refresh
follow latestscrolling when pending card-anchor restoration or later layout updates could pull the view away from the follow target. - Fixed chat last-viewed-message saving and restoring when no message bubble is visible, falling back to the previous rendered message or the top.
- Changed Codex
custom_tool_callsearch indexing to include lightweight tool metadata.
See CHANGELOG.
See SECURITY. Use the latest release whenever possible; do not install or redistribute v1.2.1 or earlier VSIX files.
This extension reads local session files and renders them inside VS Code. It does not implement any network communication and does not send session content anywhere.
If you use Copy Prompt Excerpt, this extension copies a compact session excerpt to your clipboard. Data is only sent externally if you paste it into another tool or extension.
When you open a session as a Markdown transcript, the generated transcript includes local paths (e.g., the session file path and CWD). Review before sharing.
