v1

latestSwagger 2.02026-07-175445133.1 KB
claude

Get worktree session summary

Returns Claude Code session metadata for a specific worktree

get/v1/claude/session

Query parameters

worktree_pathstring required

Worktree path

Response

OK

currentSessionIdstring

ID of the currently active session

headerstring

Header/title of the session from the Claude history

isActiveboolean

Whether this session is currently active

lastCostnumber

Metrics (from completed sessions) Cost in USD of the last completed session

lastDurationinteger

Duration in seconds of the last session

lastSessionIdstring

ID of the most recent completed session

lastTotalInputTokensinteger

Total input tokens used in the last session

lastTotalOutputTokensinteger

Total output tokens generated in the last session

sessionEndTimestring

When the last session ended (if not active)

sessionStartTimestring

When the current session started

turnCountinteger

Number of conversation turns in the session

worktreePathstring

Path to the worktree directory

Example response

{
  "allSessions": [
    {
      "endTime": "2024-01-15T16:45:30Z",
      "lastModified": "2024-01-15T16:45:30Z",
      "sessionId": "abc123-def456-ghi789",
      "startTime": "2024-01-15T14:30:00Z"
    }
  ],
  "currentSessionId": "xyz789-ghi012",
  "header": "Fix bug in user authentication",
  "isActive": true,
  "lastCost": 0.25,
  "lastDuration": 3600,
  "lastSessionId": "abc123-def456",
  "lastTotalInputTokens": 15000,
  "lastTotalOutputTokens": 8500,
  "sessionEndTime": "2024-01-15T16:45:30Z",
  "sessionStartTime": "2024-01-15T14:30:00Z",
  "turnCount": 15,
  "worktreePath": "/workspace/my-project"
}