Documentation
Performance and Security/Offline Usage

Offline Usage

ThinkCode provides robust offline capabilities, allowing you to continue your development work even when you don't have internet connectivity. This guide explains how to configure, use, and troubleshoot ThinkCode's offline features.

Offline Capabilities Overview

ThinkCode supports the following functionality in offline mode:

FeatureOffline SupportNotes
Code Editing✅ FullAll editing capabilities available
Syntax Highlighting✅ FullRequires language extensions to be pre-installed
Code Navigation✅ FullAll navigation features work offline
Search & Replace✅ FullAll search capabilities work locally
Git Operations⚠️ LimitedLocal operations only (commit, branch, etc.)
Extensions⚠️ LimitedPre-installed extensions only
AI Features⚠️ LimitedRequires local AI models
Debugging⚠️ LimitedLanguage-dependent, some debuggers need online resources
Package Management❌ UnavailableRequires internet for package downloads

Preparing for Offline Use

Enabling Offline Mode

Enable offline mode in settings:

{
  "thinkcode.offlineMode": {
    "enabled": true,
    "autoDetect": true, // Automatically detect when offline
    "showIndicator": true // Show offline indicator in status bar
  }
}

Alternatively, toggle offline mode via:

  1. Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type "ThinkCode: Toggle Offline Mode"

Downloading Required Resources

Before going offline, ensure you've downloaded necessary resources:

Extensions

Pre-install required extensions:

  1. Open Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
  2. Search and install all extensions you'll need offline
  3. Ensure they're fully activated at least once while online

Local AI Models

For AI feature support offline:

{
  "thinkcode.ai.offline": {
    "enabled": true,
    "downloadLocalModels": true,
    "modelSize": "medium", // Options: "small", "medium", "large"
    "features": {
      "completion": true,
      "chat": true,
      "documentation": true,
      "codeAnalysis": true
    }
  }
}

Download AI models:

  1. Command Palette
  2. Type "ThinkCode: Download AI Models for Offline Use"
  3. Select which models to download

Workspace Resources

Cache workspace resources for offline use:

{
  "thinkcode.offline.workspaceCache": {
    "enabled": true,
    "includeExternalDependencies": true, // Cache external libraries
    "maxSizeGB": 5, // Maximum cache size
    "includedPatterns": [
      "**/*.{js,ts,jsx,tsx,css,html,json}"
    ],
    "excludedPatterns": [
      "**/node_modules/**",
      "**/dist/**",
      "**/.git/**"
    ]
  }
}

Language Tools

Cache language tools:

{
  "thinkcode.offline.languageTools": {
    "preDownload": true, // Download language servers
    "languages": ["javascript", "typescript", "html", "css", "json"] // Specific languages to support
  }
}

Documentation

Cache documentation:

{
  "thinkcode.offline.documentation": {
    "enabled": true,
    "downloadSources": ["mdn", "typescript"], // Documentation sources
    "maxSizeMB": 500
  }
}

Offline Synchronization

Prepare synchronization for when you return online:

{
  "thinkcode.offline.sync": {
    "enabled": true,
    "syncOnReconnect": true, // Sync when internet connection returns
    "syncPriority": ["git", "extensions", "settings"], // Sync priority
    "conflictResolution": "askUser" // Options: "askUser", "localWins", "remoteWins"
  }
}

Using ThinkCode Offline

Starting in Offline Mode

ThinkCode can start in offline mode even without internet:

  1. Launch ThinkCode normally
  2. If internet is unavailable, ThinkCode will automatically enter offline mode
  3. A notification will appear indicating offline status
  4. An offline indicator will show in the status bar

Offline Mode Indicator

The offline mode indicator provides status information:

  • Solid Gray: Offline mode, all cached resources available
  • Yellow: Offline mode, some resources unavailable
  • Red: Offline mode with critical resources missing

Click the indicator for offline options menu:

  • Toggle offline mode
  • View missing resources
  • Configure offline settings
  • Check network status

Offline Feature Usage

Code Editing

All standard editing features work offline without modification.

Git Operations

Offline Git capabilities:

  • Available: Commit, branch, stage, view history (local), diff, stash
  • Unavailable: Push, pull, clone, fetch

Configure offline Git:

{
  "thinkcode.git.offline": {
    "allowCommits": true,
    "queueSyncOperations": true, // Queue operations for when online
    "conflictStrategy": "manual" // Options: "manual", "local", "remote"
  }
}

AI Features

Using AI features offline:

  1. Ensure local models are downloaded
  2. Access AI features as normal
  3. Note that responses may be less sophisticated than online

AI limitations in offline mode:

  • Smaller language models
  • No access to recent internet information
  • Limited response generation capabilities
  • Higher resource consumption

Debugging

Offline debugging limitations:

  • Some debuggers require online access for configuration
  • Pre-configure debuggers while online
  • Some language-specific features may be unavailable

Offline Project Management

Working with Dependencies

Managing dependencies offline:

  1. Pre-cache Dependencies:

    • Run ThinkCode: Cache Project Dependencies for Offline Use
    • This downloads and caches required packages
  2. Offline Package Viewer:

    • View already downloaded packages
    • See dependency status (cached/not cached)
  3. Package Reference:

    • Cached documentation for popular packages
    • Offline API references

Multi-Project Workflow

Working with multiple projects offline:

  1. Workspace Collections:

    • Create workspace collections before going offline
    • Switch between projects while offline
  2. Project Templates:

    • Cache project templates for offline use
    • Create new projects from templates while offline
{
  "thinkcode.offline.projects": {
    "cacheTemplates": true,
    "templateCategories": ["web", "node", "python"],
    "maxCachedTemplates": 10
  }
}

File Sharing in Offline Environments

For teams working together offline:

  1. Local Network Sharing:
    • Share projects over local network without internet
    • Enable in settings:
{
  "thinkcode.offline.localNetworkSharing": {
    "enabled": true,
    "discoveryProtocol": "mdns", // Options: "mdns", "broadcast", "manual"
    "shareScope": "workspace", // What to share
    "security": {
      "requireAuthentication": true,
      "allowedUsers": ["team-members"]
    }
  }
}
  1. Export/Import Workflow:
    • Export project snapshots with dependencies
    • Import on another ThinkCode instance
    • Command: ThinkCode: Export Offline Project Package

Offline Development Scenarios

Travel Mode

Optimize for development while traveling:

{
  "thinkcode.offline.travelMode": {
    "enabled": false, // Toggle as needed
    "optimizeBattery": true, // Reduce power consumption
    "reduceResourceUsage": true, // Limit resource-intensive features
    "compactStorage": true, // Minimize disk usage
    "essentialFeaturesOnly": false // Disable non-essential features
  }
}

Enable Travel Mode:

  1. Command Palette
  2. Type "ThinkCode: Enable Travel Mode"

Air-Gapped Environments

For completely isolated environments:

{
  "thinkcode.offline.airGap": {
    "enabled": false, // Enable for air-gapped environments
    "disableAllNetworking": true, // Completely disable all network features
    "disableTelemetry": true, // Disable all telemetry
    "enhancedSecurity": true // Additional security for sensitive environments
  }
}

Unreliable Connectivity

For environments with intermittent connections:

{
  "thinkcode.offline.unreliableConnection": {
    "enabled": true,
    "aggressiveCaching": true, // Cache more aggressively
    "optimisticOperations": true, // Continue operations assuming they'll succeed
    "backgroundSyncAttempts": {
      "enabled": true,
      "interval": 300, // Seconds between attempts
      "maxAttempts": 10 // Maximum retry attempts
    }
  }
}

Returning Online

Reconnection Process

When internet connectivity returns:

  1. ThinkCode detects network availability
  2. The offline indicator turns into a sync button
  3. Click to begin synchronization (or it happens automatically if configured)
  4. Synchronization process:
    • Push local Git changes
    • Sync settings
    • Update extensions
    • Refresh AI models
    • Download pending dependencies

Conflict Resolution

Handling conflicts during synchronization:

  1. Git Conflicts:

    • Standard Git conflict resolution UI opens
    • Choose between local and remote changes
  2. Settings Conflicts:

    • Conflict resolution dialog shows differences
    • Choose to keep local, remote, or merge settings
  3. Extension Conflicts:

    • Notification for extension updates
    • Choose to update or keep current versions

Offline Management Tools

Offline Status Dashboard

View your offline readiness:

  1. Command Palette
  2. Type "ThinkCode: Show Offline Status"
  3. Dashboard shows:
    • Ready offline features
    • Limited offline features
    • Unavailable features
    • Cached resources status
    • Storage usage

Storage Management

Manage offline storage:

{
  "thinkcode.offline.storage": {
    "maxSizeGB": 10, // Maximum storage for offline resources
    "autoCleanup": true, // Automatically clean old resources
    "cleanupThreshold": 80, // Percentage full before cleanup
    "prioritization": {
      "workspace": "high",
      "extensions": "medium",
      "documentation": "low",
      "aiModels": "medium"
    }
  }
}

Manage offline storage manually:

  1. Command Palette
  2. Type "ThinkCode: Manage Offline Storage"
  3. View and clean up storage categories

Troubleshooting Offline Mode

Common Offline Issues

IssuePossible CausesSolutions
Missing FeaturesResources not cachedRun cache commands while online
AI Not WorkingModels not downloadedDownload compact models while online
Extension ErrorsExtensions requiring online resourcesInstall offline-compatible extensions
Git ErrorsGit operations requiring remoteUse local Git operations only
High Resource UsageLocal AI models need more resourcesAdjust resource settings for offline mode
Sync ConflictsChanges made online and offlineUse conflict resolution tools

Diagnostic Tools

Diagnose offline issues:

  1. Command Palette
  2. Type "ThinkCode: Run Offline Diagnostics"
  3. Review issues and recommendations

Recovery Mode

If offline mode encounters problems:

  1. Command Palette
  2. Type "ThinkCode: Offline Recovery Mode"
  3. Options:
    • Restore from last known good state
    • Reset offline cache
    • Verify offline resources

Enterprise Offline Configuration

For organization-wide offline settings:

{
  "thinkcode.enterprise.offline": {
    "enforceOfflineCapability": true, // Ensure all workstations can work offline
    "requiredOfflineResources": {
      "aiModels": ["small"],
      "extensions": ["org.essentials"],
      "languages": ["javascript", "typescript", "java", "python"]
    },
    "deploymentPackage": {
      "enabled": true,
      "packageUrl": "https://internal-server.company.com/thinkcode-offline-package.zip",
      "autoUpdate": false
    }
  }
}

Further Resources