# Claude Code

This guide walks you through setting up Mobb Tracy with Claude Code to track AI-generated code in your pull requests.

## Prerequisites

Before you begin, make sure you have:

* Claude Code installed on your machine
* A GitHub repository where you'll be making pull requests
* A Mobb account (sign up at <https://app.mobb.ai>)
* Node.js and npm installed (for running npx commands)

## Installation

### Step 1: Install Mobb Tracy for Claude Code

1. Open your terminal or command prompt
2. Run the following command to install and configure Mobb Tracy:

   ```bash
   npx --yes mobbdev@latest claude-code-install-hook
   ```
3. The command will prompt you to log in to your Mobb account. Follow the authentication process.
4. After successful authentication, manually update your Claude settings file located at `~/.claude/settings.json` to complete the setup.
5. Tracy will now begin securely collecting AI interaction data from Claude Code.

### Step 2: Set Up GitHub App Integration

1. Visit the Mobb platform: <https://app.mobb.ai>
2. Click the robot icon on the left sidebar: ![](data:image/png;base64,R0lGODdhIAAcAHcAACH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACwAAAAAIAAcAIcdHh8UFRYTFBYZGhsaGxwYGRoSExQPEBEaHB0ZGxwEBQYREhQREhMXGBkcHR4bHB0VFhcODxAMDQ4TFBUUFRcSExUTExQcHB0SExMeHyAfHyAfICEhIiMiIyQgISIjJCUlJickJCUiIiMlJSYmJyg2Nzg6OzwgIiMrKy0kJCYnKCkuMDAoKCovMDAvMDE7PD0oKSokJSc+P0BaWlxKS0tAQUJGR0hJSktDREVaW1tMTU5LTE1ISUpdXl5UVVZdXV5XV1hcXF1cXV1ERUZWV1dNTk9CQ0ReX2BxcnJjZGRnZ2hqamtpampoaGlpaWp3eHlmZ2hkZGV2d3d/gIGcnJ2cnZ2dnp6enp6dnZ6dnZ2am5uIiYqKi4uZmpqOj4+VlZaDhISNjo6AgYGlpqavsLCurq+mp6e6urqkpaWhoaKqqquvr6+wsLHPz8/V1dXU1NTFxcXAwMHQ0dHExMXP0NDAwMDR0dHa29vc3NzLzMzW1tbLy8vExcbW1tf+/v7n5+jn5+fm5ubo6Ojs7Ozn5uf9/f36+vr4+Pjv7/D7+/v///8BAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMI/wA5CBxIsKDBgwgTKlzIsKHDhxA5dAAQQIDFAR0iHiQgYwyZMmZmDNBosACNNm7e+IEDYAPJgR42EAhg4EAcOQAQZNjpAWKHBAU+gAghQsMcOkRHgPgwAKPDATXO/AFENZAiRVSpCqpjo0DDDB3sDKJSxcoVLFmqZLliJYsWQndIAGBYoIYiJAoM6DWwgMFeAwqSKLrRgC4OP0oCdHDgdWCBBx0g5FCko/DCCCUKLQkAoMQOlxwy8DABAEIPRTUkKPRwwscWP0wmTOACCIWDDCnwdDFA4YciL0A69DwIQEUeQ4qaTDDw5dAKBwBYIELDO4iiRHpaPEjowcURP04CBIx4skcFgAwf+ICZAEGIIiguhic08EJzAA8dYAz3AOODB9OKDMGAYYpEwYAHGTywwYIbPACABxUQoUgRlik0QH1hWPDABRx2yOEDGIihiBGNKSRTGor08YYbLLbI4oqKqKFgQ3NJQcYaZeSoY45rsDFFDHM11EEGEFBg5JFIGslZRi816eSTUEYppUEBAQA7)
3. Select Configure GitHub App in the top-right corner.
4. Choose the repositories where you want to enable Tracy (or select All repositories).
5. That’s it! Tracy will now annotate your pull requests automatically.

### Step 3: Seeing Tracy in Action

1. Open Claude Code in a repository where Tracy is enabled.
2. Make changes to the code - using Claude's AI assistance, manual edits, or both.
3. Commit the changes and create a pull request.
4. If any part of the code was AI-generated, Tracy will post a PR comment letting you know that AI code analysis is ready with some more insights:\\

   <figure><img src="/files/ZWZqNS6H9MS1mEzbDIF4" alt=""><figcaption></figcaption></figure>
5. Click the link in the comment to open Tracy's detailed view:

   <figure><img src="/files/IAuNvy9SAOn6MR8LLcUa" alt=""><figcaption></figcaption></figure>
6. Select any AI-generated line to see:
   * The prompts used to generate that line
   * The full conversation context behind it

This gives you complete transparency into how AI contributed to your code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mobb.ai/mobb-user-docs/getting-started/mobb-tracy/claude-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
