Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JerryZLiu/Dayflow/llms.txt

Use this file to discover all available pages before exploring further.

ChatGPT and Claude providers offer the highest quality timeline narratives using frontier reasoning models through CLI-based inference.
Paid Subscription Required: This mode requires an active paid subscription to either ChatGPT Plus/Pro (20+/month)orClaudePro(20+/month) or Claude Pro (20/month). The CLI tools authenticate through your existing subscription.

Requirements

ChatGPT (via Codex CLI)

  • ChatGPT Plus (20/month)orChatGPTPro(20/month) or **ChatGPT Pro** (200/month)
  • Codex CLI installed and configured
  • Active internet connection

Claude (via Claude Code)

  • Claude Pro subscription ($20/month)
  • Claude Code CLI installed and configured
  • Active internet connection

Installing Codex CLI (ChatGPT)

1

Install Codex

Follow the installation instructions at https://github.com/openai/codex
# Example installation (check repo for latest instructions)
npm install -g @openai/codex
2

Authenticate

Run the login command and authenticate with your ChatGPT account:
codex login
Follow the prompts to sign in with your ChatGPT Plus/Pro account
3

Stay signed in

Ensure you remain authenticated. Dayflow will use your active session.
4

Verify installation

Test that Codex is working:
codex "Hello, world!"

Installing Claude Code (Claude)

1

Install Claude Code

Follow the installation instructions at https://docs.anthropic.com/en/docs/claude-code
2

Authenticate

Run the login command:
claude login
Sign in with your Claude Pro account
3

Stay signed in

Keep your session active for Dayflow to use
4

Verify installation

Test the CLI:
claude "Hello, world!"

Configuring in Dayflow

1

Open Settings

Launch Dayflow and go to Settings → AI Provider
2

Select ChatGPT or Claude

Choose ChatGPT (Codex) or Claude (Code) from the provider options
3

Verify authentication

Dayflow will check if you’re signed in to the CLI tool
4

Start processing

Begin recording and verify batches are processed successfully

How It Works

Dayflow drives the CLI tools programmatically:
private func runStreamingAndCollect(prompt: String, model: String?, reasoningEffort: String?, sessionId: String?) async throws -> (run: ChatCLIRunResult, sessionId: String?) {
    let started = Date()
    var collectedText = ""
    var capturedSessionId = sessionId

    let stream = runner.runStreaming(
        tool: tool,
        prompt: prompt,
        workingDirectory: config.workingDirectory,
        model: model,
        reasoningEffort: reasoningEffort,
        sessionId: sessionId
    )

    for try await event in stream {
        switch event {
        case .sessionStarted(let id):
            if capturedSessionId == nil {
                capturedSessionId = id
            }
        case .textDelta(let chunk):
            collectedText += chunk
        case .complete(let text):
            collectedText = text
        case .error(let message):
            throw NSError(domain: "ChatCLI", code: -4, userInfo: [...])
        }
    }

    return (run, capturedSessionId)
}

Model Selection

Dayflow uses specific models for each provider:
ProviderModelReasoning Effort
ChatGPTgpt-5.2Medium
ClaudesonnetN/A
let model: String
let effort: String?
switch tool {
case .claude:
    model = "sonnet"
    effort = nil
case .codex:
    model = "gpt-5.2"
    effort = "medium"
}

Processing Pipeline

ChatGPT/Claude uses a balanced approach: Total: 4-6 LLM calls per 15-minute batch This is more efficient than local models but requires more calls than Gemini.

Quality Benefits

Frontier Reasoning Models

ChatGPT (via GPT-5.2) and Claude (via Sonnet) provide:
  • Superior narrative quality: Better understanding of context and nuance
  • More coherent summaries: Improved coherence across activity cards
  • Better distraction detection: More accurate identification of context switches
  • Natural language: More human-like descriptions of activities

Screenshot Processing

Screenshots are automatically downscaled to ~720p to reduce token usage:
private func prepareImagesForCLI(_ imagePaths: [String]) throws -> ([String], () -> Void) {
    let tmpDir = config.workingDirectory.appendingPathComponent("tmp_images_\(UUID().uuidString)", isDirectory: true)
    try fm.createDirectory(at: tmpDir, withIntermediateDirectories: true)

    func resize(_ src: URL, into dst: URL) throws {
        guard let image = NSImage(contentsOf: src) else {
            throw NSError(...)
        }
        
        let maxHeight: Double = 720.0
        if pixelsHigh <= Int(maxHeight) {
            // No resize needed
            try fm.copyItem(at: src, to: dst)
            return
        }

        // Resize and encode as JPEG
        let scale = maxHeight / Double(pixelsHigh)
        let targetW = max(2, Int((Double(pixelsWide) * scale).rounded()))
        let targetH = Int(maxHeight)
        
        // ... resize logic ...
    }
    
    return (processed, cleanup)
}
This optimization keeps token costs manageable while maintaining enough detail for accurate analysis.

Authentication and Sessions

Dayflow maintains CLI sessions to optimize performance:

Session Management

For multi-turn interactions (like correction loops), Dayflow reuses the same session:
var sessionId: String? = nil

for attempt in 1...3 {
    let runResult = try await runStreamingAndCollect(
        prompt: actualPromptUsed,
        model: model,
        reasoningEffort: effort,
        sessionId: sessionId  // Reuse session for corrections
    )
    sessionId = runResult.sessionId
    
    // Validation and correction logic
    if !coverageValid || !durationValid {
        // Send correction prompt in same session
        actualPromptUsed = buildCardsCorrectionPrompt(validationError: combinedError)
    }
}
This allows the model to see previous attempts and corrections, improving quality.

Staying Signed In

Both Codex and Claude Code maintain authentication sessions. If Dayflow reports authentication errors:
  1. Run codex login or claude login manually
  2. Verify you’re using a paid account
  3. Check for any subscription payment issues
  4. Ensure you’re not hitting rate limits

Error Handling

Dayflow extracts and surfaces CLI error messages:
private func extractCLIError(stdout: String, stderr: String) -> String? {
    // Check stderr for ERROR: lines (Codex format)
    for line in stderr.components(separatedBy: .newlines) {
        let trimmed = line.trimmingCharacters(in: .whitespaces)
        if trimmed.hasPrefix("ERROR:") {
            return trimmed
        }
    }

    // Check stdout for API Error messages (Claude format)
    for line in stdout.components(separatedBy: .newlines) {
        let trimmed = line.trimmingCharacters(in: .whitespaces)
        if trimmed.hasPrefix("API Error:") ||
           trimmed.hasPrefix("Invalid API key") ||
           trimmed.hasPrefix("You've hit your limit") {
            return cleaned
        }
    }
    
    return nil
}
Common error messages:
  • "You've hit your usage limit" - Subscription rate limit reached
  • "Your access token could not be refreshed" - Re-authenticate with CLI
  • "The SSO session associated with this profile has expired" - Sign in again

Privacy Considerations

When using ChatGPT or Claude:
  • Data sent to cloud: Screenshots and prompts are sent to OpenAI or Anthropic
  • Review privacy policies:
  • Subscription data handling: Both providers have different terms for paid vs. free users
  • No offline mode: Requires active internet connection

Troubleshooting

CLI Not Found

If Dayflow can’t find the CLI tool:
  1. Verify installation:
    which codex  # or 'which claude'
    
  2. Ensure the CLI is in your PATH
  3. Try restarting Dayflow after installation

Authentication Errors

If you see login errors:
  1. Re-authenticate: Run codex login or claude login
  2. Check subscription: Verify your paid subscription is active
  3. Clear sessions: Try codex logout followed by codex login

Rate Limits

If you hit usage limits:
  1. ChatGPT Plus: Limited to a certain number of messages per 3 hours
  2. ChatGPT Pro: Higher limits but still capped
  3. Claude Pro: Message limits per month
  4. Wait or upgrade: Either wait for the limit to reset or upgrade your subscription

OSC Escape Sequences

Some terminal configurations inject escape sequences into output. Dayflow automatically strips these:
private func stripOSCEscapes(_ input: String) -> String {
    // Strip OSC (Operating System Command) sequences like ]1337;RemoteHost=user@host
    var result = ""
    var i = input.startIndex
    while i < input.endIndex {
        if input[i] == "]" {
            // Check for OSC signature (semicolon within first 5 chars)
            if hasSemicolon {
                // Skip the OSC sequence
                var j = next
                while j < input.endIndex {
                    let c = input[j]
                    if c.isNumber || c == ";" || c == "=" || ... {
                        j = input.index(after: j)
                    } else {
                        break
                    }
                }
                i = j
                continue
            }
        }
        result.append(input[i])
        i = input.index(after: i)
    }
    return result
}
This is usually transparent, but if you see parsing errors, check your terminal configuration.

Build docs developers (and LLMs) love