Your First Debug Session
This guide walks you through debugging your first error with Splat using a real example.Create a test file with an error
Let’s create a simple Python file with a syntax error:If you try to run this directly, you’ll get a syntax error:
test.py
Notice the missing closing parenthesis on line 2 - this is intentional!
Run Splat to debug the error
Instead of running the file directly, use Splat:Splat will:
- Execute your command and capture the error
- Parse the stack trace to identify
test.py - Read the file contents
- Send the error and code to Groq’s AI for analysis
- Return a structured debug response
The first run might take a few seconds as Splat initializes. Subsequent runs are nearly instant.
Review the debug response
Splat will provide a structured response:The response includes:
- path: Full path to the file with the error
- file: Filename
- line: Exact line number
- what: Clear explanation of what went wrong
- todo: Step-by-step instructions to fix it
Understanding the Command
The basic Splat command follows this pattern:The Splat subcommand that executes your code and captures errors
The exact command you would normally use to run your application, wrapped in quotes
Examples
Using Relational Mode
For complex errors involving multiple files, use the-r flag to enable relational analysis:
- Parses imports - Analyzes
importandfromstatements in error files - Builds adjacency list - Creates a graph of file relationships
- Finds related files - Traverses the graph to find all Nth-degree dependencies
- Includes context - Sends all related files to the AI for deeper analysis
Example: Debugging with Relational Mode
Consider a FastAPI application with this structure:main.py imports from handlers.fastapi_handlers, which imports from utils.utils, and an error occurs:
Real-World Example
Let’s debug a more realistic error using the test FastAPI application from the Splat repository:Run the FastAPI app through Splat
- Random server errors in
/usersendpoint - Type validation errors in
/itemsendpoint - Missing key errors in
/processendpoint - Off-by-one errors in
/item/{item_id}update
Trigger an error
With the server running, make a request that triggers an error:This will cause a KeyError because
value2 is missing.Best Practices
Always use quotes
Wrap your command in quotes to ensure proper parsing:
Use -r for multi-file errors
Enable relational mode when errors span multiple files:
Check .gitignore
Ensure sensitive files are excluded via
.gitignore before using SplatReview AI suggestions
Always review AI recommendations before applying fixes - understanding the error helps prevent future issues
Common Issues
Splat doesn't capture the error
Splat doesn't capture the error
Some issues to check:
- Make sure your command is wrapped in quotes
- Verify the command works when run directly (without Splat)
- Check that your virtual environment is activated
- Ensure you’re in the correct directory
API rate limit errors
API rate limit errors
If you hit Groq’s rate limits:
- Wait a few seconds between requests
- Consider upgrading your Groq API plan for higher limits
- Use relational mode selectively - it sends more data per request
Files not found in relational mode
Files not found in relational mode
If the
-r flag doesn’t find related files:- Ensure imports use relative or absolute paths correctly
- Check that imported modules are in the same project root
- Verify your project structure follows standard Python conventions
Splat works but shows unknown errors
Splat works but shows unknown errors
Known limitations (from README):
- Splat doesn’t conform to formatting configurations when suggesting code
- Sub-module entry points not originating in the root directory may have issues
- Try running from your project root directory
Next Steps
Now that you’ve completed your first debug session, explore more:How Splat Works
Deep dive into Splat’s error tracing and context gathering
Configuration
Customize Splat’s behavior and AI model settings
Advanced Features
Learn about file writer agents and advanced debugging modes
Examples
See real-world debugging scenarios and solutions