Code Mode

Advanced analysis using custom TypeScript code executed in a secure sandbox.

Code Mode is an advanced feature that allows the Race Engineer to write and execute custom TypeScript code against your telemetry data. This enables complex analysis that goes beyond the built-in tools.

How It Works

When you ask the Race Engineer to perform complex analysis, it writes TypeScript code that:

  1. Calls brakinglab.* functions to query your data
  2. Processes and transforms the results
  3. Performs calculations and comparisons
  4. Returns formatted results

All code runs in an isolated sandbox with strict security constraints — no access to the filesystem, network, or any external resources.

Sandbox Security

The code execution environment has strict limits:

ConstraintLimit
Execution timeout10 seconds
Memory limit32 MB
Max API calls20 per execution
Network accessNone
File systemNone
External modulesNone

This means you can safely ask the Race Engineer to run any analysis — the sandbox prevents any harmful operations.

What You Can Ask For

Code mode enables advanced analysis like:

Custom Calculations

  • “What’s my average braking distance for Turn 1 across all sessions?”
  • “Calculate the standard deviation of my lap times at each track”
  • “What percentage of my laps are within 1% of my best?”

Cross-Session Analysis

  • “Compare my performance at Spa across all sessions this month”
  • “Find which track I’ve improved the most at”
  • “Rank all my track/car combinations by consistency”

Data Aggregation

  • “Summarize my total driving time and laps this season”
  • “What’s my most-driven track and car combination?”
  • “Give me statistics for each corner at Monza across all my sessions”

Complex Comparisons

  • “Compare my braking technique in dry vs wet sessions”
  • “How does my first stint compare to my last stint on average?”
  • “Find corners where I’m faster in qualifying but slower in race trim”

Example

When you ask “What’s my most consistent corner at Spa?”, the Race Engineer might:

  1. Fetch all your Spa sessions
  2. Get braking zone data for each session
  3. Calculate MRP standard deviation for each corner across all laps
  4. Rank corners by consistency (lowest deviation = most consistent)
  5. Return a formatted table with results

You see the result — not the code — unless you specifically ask to see it.

Tips

  • Be specific — The more precise your question, the better the analysis
  • Don’t worry about the code — Just describe what you want to know in plain language
  • Large analyses may take a moment — Complex queries with many sessions need multiple API calls
  • Ask for explanations — If a result is surprising, ask the Race Engineer to dig deeper

Limitations

  • The sandbox cannot access external APIs or websites
  • Each execution is independent (no persistent state between calls)
  • Very large datasets may hit the 20 API call limit — the Race Engineer will paginate or filter as needed
  • No graphical output — results are returned as text, tables, or structured data

Next Steps

  • FAQ — Common questions about the Race Engineer
  • Available Tools — See the full tool catalog