tribecodetribecode
    DocsPricingLogin
    Documentation

    Documentation

    • Getting Started
    • CLI Commands
    • TRIBE API UsageBeta
    • MUSENew
    • CIRCUITNew
    • Self-Hosting
    • API Reference
    • Analytics Dashboard
    • Privacy & Security
    • Troubleshooting

    tribecode CLI Commands

    Complete reference for tribecode CLI commands. Learn how to manage telemetry collection, view analytics, and control your AI coding assistant monitoring.

    Overview

    tribecode provides simple command-line tools for managing telemetry collection from AI coding assistants like Claude Code. All commands follow a consistent pattern and provide clear feedback.

    Installation

    First, install the tribecode CLI:

    npx @_xtribe/cli
    

    This installs the tribe command with tribecode functionality included.

    Authentication

    Before using tribecode commands, you need to authenticate:

    # Authenticate with GitHub OAuth
    tribe login
    
    # Check authentication status
    tribe auth-status
    
    # View account information
    tribe account-info
    
    # Remove stored credentials
    tribe logout
    

    tribecode Commands

    All tribecode commands are accessed via the tribe CLI:

    | Command | Description | Example | |---------|-------------|---------| | tribe enable | Start collecting analytics | - | | tribe disable | Stop collection | - | | tribe status | Check collection status | - | | tribe logs | View collector logs | --tail 50 |


    tribe enable

    Description: Start telemetry collection from Claude Code and other AI tools.

    Prerequisites:

    • OAuth authentication required (tribe login)
    • Claude Code CLI must be installed and used at least once

    Usage:

    tribe enable
    

    Expected Output:

    πŸš€ Starting tutor telemetry collector...
    βœ… tribecode collector started (PID: 12345)
    πŸ“‹ Logs: /Users/username/.tribe/tutor/collector.log
    

    What Happens:

    1. Verifies OAuth authentication
    2. Checks for existing collector process
    3. Starts background daemon for telemetry collection
    4. Begins monitoring Claude Code logs in ~/.claude/projects/
    5. Starts buffered transmission to analytics server

    Troubleshooting:

    • "OAuth authentication required": Run tribe login first
    • "No Claude logs found": Use Claude Code CLI to generate some logs
    • "tribecode collector binary not found": Reinstall with npx @_xtribe/cli --force

    tribe disable

    Description: Stop telemetry collection and terminate the collector daemon.

    Usage:

    tribe disable
    

    Expected Output:

    πŸ›‘ Stopping tutor collector (PID: 12345)...
    βœ… tribecode collector stopped
    

    What Happens:

    1. Finds running collector process
    2. Sends graceful shutdown signal (SIGTERM)
    3. Removes PID file
    4. Stops all telemetry collection

    Note: This does not delete collected data or remove authentication.


    tribe status

    Description: Check the current status of telemetry collection and authentication.

    Usage:

    tribe status
    

    Expected Output:

    πŸ” tribecode Status
    ==========================
    πŸ” OAuth: βœ… Authenticated
    πŸ‘€ User: [email protected]
    πŸ“Š Collector: βœ… Running
    πŸ”§ PID: 12345
    ⏱️  Uptime: 2h30m
    πŸ“ˆ Recent: 147 events collected
    

    Status Fields:

    • OAuth: Shows authentication status and user email
    • Collector: Shows if daemon is running with PID and uptime
    • Recent: Shows count of recently collected events

    Possible States:

    • OAuth: βœ… Authenticated | ❌ Not authenticated
    • Collector: βœ… Running | ❌ Stopped

    tribe logs

    Description: View collector logs to monitor telemetry collection activity.

    Usage:

    # View all logs
    tribe logs
    
    # View last 50 lines
    tribe logs --tail 50
    
    # Follow logs in real-time
    tribe logs --follow
    

    Available Flags:

    • --tail N: Show last N lines (default: 50)
    • --follow: Follow logs in real-time
    • --verbose: Show detailed debug information

    Sample Log Output:

    2025-10-02 14:30:15 [INFO] tribecode collector started
    2025-10-02 14:30:16 [INFO] Discovered 3 Claude projects
    2025-10-02 14:30:17 [INFO] Processing 12 new events
    2025-10-02 14:30:22 [INFO] Transmitted batch of 12 events
    2025-10-02 14:30:45 [INFO] Health check: 147 total events collected
    

    Log Locations:

    • Collector Logs: ~/.tribe/tutor/collector.log
    • Auth Logs: ~/.tribe/tutor/auth.json
    • State File: ~/.tribe/tutor/state.json

    Tribal Knowledge Commands

    Search your coding history, recall past sessions, and extract specific content. These commands turn your development history into searchable tribal knowledge.

    tribe search

    Description: Search across all your coding sessions for specific patterns, errors, or implementations.

    Usage:

    tribe search "authentication middleware"
    tribe search "docker compose" --project myapp
    tribe search "API error" --time-range 7d
    

    Options:

    • --limit N: Limit number of results (default: 10)
    • --project NAME: Filter to specific project
    • --time-range 7d: Limit to time range (7d, 30d, etc.)
    • --tool "Claude Code": Filter by AI tool
    • --format json: Output as JSON

    Example Output:

    πŸ” Found 2 sessions matching "authentication middleware":
    
    1. myapp [c5aa183a] Claude Code
       πŸ“… 6:06 PM
       β†’ ...implementing JWT authentication middleware for the API...
       β†’ ...OAuth authentication patterns and credential management...
    
    2. backend [30efbc4e] Claude Code
       πŸ“… 5:53 PM
       β†’ ...Review system - focus on OAuth authentication...
    

    tribe recall

    Description: Get a detailed summary of a specific coding session, including files touched, commands run, and tools used.

    Usage:

    tribe recall c5aa183a
    tribe recall c5aa183a --format json
    

    Example Output:

    πŸ“‹ Session Recall: c5aa183a-715
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    πŸ“ Project:  myapp
    πŸ› οΈ  Tool:     Claude Code
    ⏱️  Duration: 21 min (6:06 PM β†’ 6:27 PM)
    πŸ“Š Events:   125 events, 5.0K tokens
    
    βœ… Summary:
       β€’ Worked on 12 files (.ts, .tsx, .json)
       β€’ Executed 5 shell commands
       β€’ Used tools: Bash (66x), Edit (7x), Read (60x)
       β€’ Key areas: api, auth, security
    

    tribe extract

    Description: Extract specific content types from a session: code snippets, shell commands, or file changes.

    Usage:

    tribe extract c5aa183a --type commands
    tribe extract c5aa183a --type files
    tribe extract c5aa183a --type code --limit 5
    

    Content Types:

    • --type code: Extract code snippets (default)
    • --type commands: Extract shell commands
    • --type files: List files modified
    • --type edits: Extract file edits

    Example Output:

    πŸ’» Extracted 3 commands from session c5aa183a:
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    [1] $ npm test
    
    [2] $ npm run build
    
    [3] $ git status --short
    

    tribe query

    Description: Query sessions, insights, or raw events with flexible filtering options.

    Usage:

    tribe query sessions
    tribe query sessions --all --time-range 30d
    tribe query insights --limit 5
    tribe query events --session c5aa183a
    

    Query Types:

    • tribe query sessions: List coding sessions
    • tribe query insights: View AI-generated insights
    • tribe query events --session ID: View raw events

    Options:

    • --all: Show all projects (not just current)
    • --time-range 7d: Filter by time range
    • --limit N: Limit results
    • --format json: Output as JSON

    Example Output:

    πŸ“‹ Found 3 sessions (showing 2):
    
    1. myapp [c5aa183a] Claude Code
       97 events Β· 1h 13m Β· 6.4K tokens
       5:14 PM β†’ 6:27 PM
    
    2. backend [30efbc4e] Claude Code
       729 events Β· 1h 13m Β· 47K tokens
       5:14 PM β†’ 6:26 PM
    

    Using TRIBE with AI Coding Agents

    Your AI coding agents (Claude Code, Cursor, Codex, etc.) can use the TRIBE CLI directly to search your coding history and leverage tribal knowledge while working on your codebase.

    Example Prompts for Your AI Agent

    Tell your AI coding assistant to use TRIBE commands:

    • Finding past implementations: "Use tribe search to find how we handled authentication before"
    • Debugging similar errors: "Search tribe for similar errors we've seen and how they were fixed"
    • Reviewing recent work: "Use tribe query sessions to see what we worked on this week"
    • Finding patterns: "Search tribe for API endpoint patterns in this project"

    Agent-Specific Usage

    | Agent | How to Use TRIBE | |-------|------------------| | Claude Code | Claude can run tribe search directly via bash | | Cursor | Use terminal within Cursor to run tribe commands | | GitHub Copilot | Pipe tribe output to context files: tribe recall abc123 > context.md | | Any Agent | Use --format json for structured output |

    Pro tip: Your coding agents can search tribal knowledge to avoid re-solving problems you've already solved. Stop reinventing the wheel - search tribe first.


    Common Usage Patterns

    First-Time Setup

    # 1. Install tribecode CLI
    npx @_xtribe/cli
    
    # 2. Authenticate
    tribe login
    
    # 3. Start collecting telemetry
    tribe enable
    
    # 4. Verify everything is working
    tribe status
    

    Daily Usage

    # Check if collector is running
    tribe status
    
    # View recent activity
    tribe logs --tail 20
    
    # View analytics dashboard
    open https://tribecode.ai/tribe/analytics
    

    Troubleshooting

    # Check authentication
    tribe auth-status
    
    # View collector status
    tribe status
    
    # Check logs for errors
    tribe logs --tail 100
    
    # Restart collector
    tribe disable
    tribe enable
    

    Stopping Collection

    # Temporarily stop collection
    tribe disable
    
    # Check that it stopped
    tribe status
    
    # Restart when needed
    tribe enable
    

    Configuration

    Environment Variables

    You can customize collector behavior with environment variables:

    # Set custom server URL
    export TRIBE_TUTOR_SERVER=https://tutor.company.com
    
    # Set team ID for multi-tenant setup
    export TRIBE_TEAM_ID=engineering
    
    # Enable verbose logging
    export TUTOR_COLLECTOR_FLAGS="-verbose -buffer 100"
    

    Configuration Files

    • Auth: ~/.tribe/tutor/auth.json - OAuth tokens and user info
    • State: ~/.tribe/tutor/state.json - Last processed log positions
    • Logs: ~/.tribe/tutor/collector.log - Collector activity logs

    Advanced Usage

    Scripting with JSON Output

    Some commands support JSON output for scripting:

    # Get status as JSON
    tribe status --output json
    
    # Example output:
    {
      "authenticated": true,
      "user": "[email protected]",
      "collector_running": true,
      "pid": 12345,
      "uptime_seconds": 9000,
      "recent_events": 147
    }
    

    Integration with CI/CD

    # Check if authentication is valid
    if tribe auth-status --quiet; then
      echo "Authenticated, starting collector"
      tribe enable
    else
      echo "Not authenticated, skipping telemetry"
    fi
    

    Team Management

    # Set team ID for shared analytics
    export TRIBE_TEAM_ID=frontend-team
    tribe enable
    
    # Each team member uses same team ID
    # Analytics will be aggregated by team
    

    Error Handling

    Common error messages and solutions:

    "OAuth authentication required"

    Cause: Not authenticated or token expired Solution: Run tribe login to re-authenticate

    "tribecode collector binary not found"

    Cause: Installation incomplete or corrupted Solution: Reinstall with npx @_xtribe/cli --force

    "No Claude logs found"

    Cause: Claude Code CLI hasn't been used yet Solution: Use Claude Code CLI first to generate logs

    "Permission denied"

    Cause: Incorrect file permissions on collector binary Solution: Fix permissions or reinstall CLI

    "Server connection failed"

    Cause: Network issues or server unavailable Solution: Check internet connection and retry

    Next Steps

    Once you have tribecode commands working:

    1. View Analytics: Open https://tribecode.ai/tribe/analytics
    2. Explore Dashboard: Learn about usage patterns and insights
    3. Team Setup: Configure shared analytics for your team
    4. Troubleshooting: Check our troubleshooting guide for common issues

    Support

    If you encounter issues with CLI commands:

    1. Check tribe status for current state
    2. Review tribe logs for error messages
    3. Verify authentication with tribe auth-status
    4. Consult the troubleshooting guide
    5. Join our community Discord for help
    tribecodetribecode

    Not another agentβ€”a telemetry vault + API you can trust.

    Product

    • Pricing
    • Support

    Developers

    • Documentation
    • API Reference
    • GitHub

    Β© 2026 tribecode. All rights reserved.

    Privacy PolicyTerms of Service