get_code_session
Retrieve a coding session by ID to inspect user turns, files touched, and per-session summaries; page long sessions or open a turn window to read surrounding context.
Instructions
Retrieve a specific coding session by ID (a memory_search record's session_id, a list_recent_conversations code row's id): its user-spine turns (what the human asked/decided/corrected), files touched, and per-session summary. To read the turns around a record, pass its session_id as id and its turn_idx as turn: you get only turns turn-window..turn+window (window default 8, max 40; max_chars default 12000 here) with focus {turn, window, first_idx, last_idx, total_turns}; prev_start/next_start, passed as start (without turn), read the turns before/after; start reads forward from there with the default 60000 chars. Whole-session paging below is the fallback. Long sessions come in parts: each call returns the session metadata and summary plus whole turns from start up to about max_chars of turn text (default 60000), with total_turns, total_chars, returned {start, end (exclusive)} and next_start. files_touched is on the first part only (up to 200 paths; files_touched_total and files_touched_omitted give the rest's count). When next_start is not null, call get_code_session again with the same id and start=next_start until next_start is null to read every turn. The first part also lists sub_agents: the sub-agent sessions this session spawned (id, agent_type, description, started_at, ended_at, turn_count, brief = first 160 chars of the task it was given; at most 200, sub_agents_total gives the full count); open one with get_code_session id=. When this session is itself a sub-agent, parent_session_id is the id of the session that spawned it. Use it to read what was actually said; use session_summary for a short threaded overview of the same session. Results are dated records of what sessions did, not the current state of a PR or issue; check that live.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Code session ID; a unique prefix of ≥ 8 chars also works | |
| turn | No | Open the session at this turn (a memory_search record's turn_idx): only the turns within ±window of it are returned. Omit to page the whole session from start. | |
| start | No | Index of the first turn to return (default 0). Pass the previous call's next_start to continue. Ignored when turn is given (turn wins over start). | |
| window | No | With turn: how many turns either side to return (default 8, clamped to 1–40). | |
| max_chars | No | Approximate turn-text budget for this part, in characters (default 60000, or 12000 with turn; clamped to 5000–200000). A single turn larger than this is returned alone, cut, and marked truncated. |