Codex Terminal Log Capture
Capture VS Code integrated terminal command output into a local workspace log file so Codex can inspect failures without reading the terminal buffer directly.
The extension writes to:
.codex-logs/vscode-terminal.log
Privacy Model
- Capture is disabled by default.
- Logs are written only to the local workspace.
- The extension does not upload logs or call network services.
- Terminal output can contain secrets, tokens, cookies, internal URLs, user data, or production logs. Enable capture only in workspaces where local log files are acceptable.
- The log rotates at 1 MB by default to reduce accidental large reads and token usage.
Usage
- Run
Codex Terminal Logs: Enable Capture from the command palette.
- Run commands in the VS Code integrated terminal.
- Ask Codex to inspect
.codex-logs/vscode-terminal.log, or run Codex Terminal Logs: Open Log.
- Run
Codex Terminal Logs: Disable Capture when you no longer need capture.
The enable and disable commands store capture state in extension workspace state. They do not need to modify .vscode/settings.json.
The extension uses VS Code shell integration. It can capture output produced after capture is enabled and after shell integration reports a command start. It cannot recover historical terminal buffer content from before activation.
Commands
Codex Terminal Logs: Enable Capture
Codex Terminal Logs: Disable Capture
Codex Terminal Logs: Open Log
Codex Terminal Logs: Clear Log
Codex Terminal Logs: Copy Log Path
Settings
{
"codexTerminalLogs.enabled": false,
"codexTerminalLogs.logDirectory": ".codex-logs",
"codexTerminalLogs.logFile": "vscode-terminal.log",
"codexTerminalLogs.maxBytes": 1048576,
"codexTerminalLogs.stripAnsi": true
}
The codexTerminalLogs.enabled setting is optional. Prefer the enable/disable commands for normal use.
Token Control
When using Codex, inspect bounded tails or failure windows instead of reading the whole log:
wc -c .codex-logs/vscode-terminal.log
tail -n 120 .codex-logs/vscode-terminal.log
rg -n "error|failed|failure|traceback|exception|assert|失败|报错|ERROR|FAIL" .codex-logs/vscode-terminal.log
Avoid full-file reads such as:
cat .codex-logs/vscode-terminal.log
Notes
Supported shells follow VS Code shell integration support. On macOS this normally covers zsh, bash, fish, and pwsh.