Loading ACP sessions from disk

Inspect GtLACPClaudeCodeSessionStore GtLACPExternalSessionStore << #GtLACPClaudeCodeSessionStore slots: {}; tag: 'Session discovery'; package: 'Gt4Llm-ACP' or GtLACPCodexSessionStore GtLACPExternalSessionStore << #GtLACPCodexSessionStore slots: {}; tag: 'Session discovery'; package: 'Gt4Llm-ACP' to browse saved sessions.

claudeStore := GtLACPClaudeCodeSessionStore new read.
claudeStore
  
codexStore := GtLACPCodexSessionStore new read.
codexStore
  

Inspect a stored session and click Load session to open its ACP chat, or send GtLACPStoredSession>>#load load ^ self loadConfigureClient: [ :client | ] . Its type selects the matching client:

The default storage roots are ~/.claude and ~/.codex. Set CLAUDE_CONFIG_DIR or CODEX_HOME in GT's environment to use another location.

Replace the ID below to load a Claude Code session with GtLACPExternalSessionStore>>#loadSession:configureClient: loadSession: anId configureClient: aBlock ^ (self sessionWithId: anId) loadConfigureClient: aBlock . The store finds the project directory and creates the matching client:

sessionId := 'your-session-id'.
session := claudeStore
    loadSession: sessionId
    configureClient: [ :client |
        client configuration requestTimeout: 180 ].
session
  

For Codex, use codexStore in the same expression. Send GtLACPExternalSessionStore>>#read read sessions removeAll. issues removeAll. rootDirectory isDirectory ifFalse: [ self issueFor: rootDirectory line: nil description: 'Storage directory is absent'. ^ self ]. [ self readSessions ] on: Error do: [ :error | self issueFor: rootDirectory line: nil description: error messageText ]. ^ self again to refresh the list.

When only the ID is known, traverse both stores using GtLACPExternalSessionStore>>#sessionWithId:ifPresent: sessionWithId: anId ifPresent: aBlock ^ self sessionWithId: anId ifPresent: aBlock ifAbsent: [ nil ] :

sessionId := 'your-session-id'.
session := nil.
stores := {
    GtLACPClaudeCodeSessionStore new read.
    GtLACPCodexSessionStore new read }.

stores do: [ :store |
    store
        sessionWithId: sessionId
        ifPresent: [ :storedSession |
            session := store
                loadSession: storedSession sessionId
                configureClient: [ :client |
                    client configuration requestTimeout: 180 ] ] ].

session
  

Inspect Read problems if a session is missing. Loading requires a known project directory that still exists and an adapter that supports resuming the session.

To continue a closed GtLACPSession GtLACPObject << #GtLACPSession slots: { #client . #connection . #directory . #remoteSessionId . #state . #turns . #updates . #modes . #configOptions . #promptText . #announcer . #summarizersRegistry . #subagents . #parentSubagent . #interSessionMessages . #conversationTitle . #availableCommands . #chatViewModel . #systemPrompt }; sharedVariables: { #McpServer }; tag: 'Core'; package: 'Gt4Llm-ACP' , use GtLACPSession>>#reopen reopen self requireRootSession. ^ self state reopen . This keeps the existing conversation objects and requires an agent that supports resuming without history replay: