codex_list_sessions
Lists and merges Codex sessions from local $CODEX_HOME rollout files and MCP job records, letting you filter by source, cwd, query, and limit.
Instructions
List Codex sessions by merging local $CODEX_HOME/sessions rollout files and MCP job records. Sessions in both appear as source='both' and match both local and mcp filters.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "codex_list_sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Filter by exact working directory (path-normalized). | |
| limit | No | Max sessions to return (default 20). | |
| query | No | Case-insensitive substring search across id, title, and cwd. | |
| source | No | Filter by source (default 'all'; 'both' matches both 'local' and 'mcp'). |