Chat with Jasper

Ask questions, request explanations, and get help directly in your PR comments using @jasper.

How It Works

Mention @jasper in any pull request comment to start a conversation. Jasper understands the full context of your PR including the code changes, existing comments, and conversation history.

You
@jasper What does this function do and is it safe?
Jasper

This function handles user authentication by verifying the provided token against the database. It's generally safe, but I noticed a few things to consider...

What You Can Ask

Jasper can help with a wide variety of questions about your code:

Understanding Code

  • "@jasper What does this function do?"
  • "@jasper Explain the logic in lines 42-58"
  • "@jasper Why is this approach used here?"
  • "@jasper How does this integrate with the rest of the codebase?"

Getting Suggestions

  • "@jasper How can I make this more efficient?"
  • "@jasper Is there a better way to handle this error?"
  • "@jasper Can you suggest a more readable implementation?"
  • "@jasper What edge cases am I missing?"

Debugging Help

  • "@jasper Why might this cause a null pointer exception?"
  • "@jasper What could cause this test to fail?"
  • "@jasper Is there a race condition here?"

Security Questions

  • "@jasper Is this input properly sanitized?"
  • "@jasper Could this be vulnerable to SQL injection?"
  • "@jasper Are there any security concerns with this approach?"

Chat Context

When you chat with Jasper, it has access to:

  • The PR diff - All code changes in the pull request
  • PR description - The title and body of the PR
  • Conversation history - Previous messages in the thread
  • Review comments - Existing review feedback on the PR
  • Line context - When commenting on specific lines, that context is included

Inline vs. General Comments

General PR Comments

Comment on the main PR conversation to ask general questions about the entire change:

@jasper Can you summarize what this PR does?

Inline Code Comments

Comment on specific lines of code to ask about that particular section. Jasper will focus its response on the code at that location:

// Commenting on line 45 of auth.js
@jasper Is this token validation secure?

Conversation Threads

Jasper maintains conversation context within a thread. You can have back-and-forth discussions:

You

@jasper Why is this using a nested loop?

Jasper

The nested loop is comparing each item with every other item to find duplicates. This has O(n²) complexity...

You

@jasper Can you show me a more efficient approach?

Jasper

Here's an O(n) solution using a Set: const seen = new Set()...

Tips for Better Responses

  • Be specific - "What does line 42 do?" is better than "What does this do?"
  • Provide context - "I'm trying to optimize for memory" helps Jasper tailor suggestions
  • Ask follow-ups - Don't hesitate to ask for clarification or more detail
  • Reference the code - Mention specific function names, variables, or line numbers

Pro Tip

Combine chat with slash commands for powerful workflows. Use /jasper explain for a detailed analysis, then follow up with @jasper questions about specific parts.

Credit Usage

Each chat message that receives a response consumes one review credit from your organization's balance. Conversation history is maintained without additional cost within the same thread.