Thank you for participating in the GitHub Copilot Cost Optimization What The Hack. Before you begin optimizing, you need to set up your environment to measure GitHub Copilot usage costs accurately. This challenge establishes your baseline—the “before” measurement that all subsequent challenges will compare against.
Understanding where credits go is essential to optimization. In this challenge, you’ll confirm that usage-based billing (UBB) is active, learn how to read token breakdowns in VS Code, and complete a baseline coding task to capture your starting credit spend.
The GitHub Codespaces option uses this hack’s preconfigured development container to set up the development tools and GitHub Copilot extensions needed for the challenges. If you use a local workstation instead, you will need to set up the required tools and extensions there.
The student resources include a starter codebase intentionally configured with sub-optimal GitHub Copilot settings—you’ll be optimizing these in later challenges.
GitHub Codespaces provides a cloud-hosted Visual Studio Code environment that you can access in your browser. This hack’s dev container is configured with Node.js, Python, and the GitHub Copilot extensions.
You need a GitHub account with access to GitHub Copilot and permission to use GitHub Codespaces. Codespaces compute and storage normally incur charges separately from GitHub Copilot, depending on your account’s included usage and billing settings. All personal GitHub.com accounts include a monthly quota of free usage each month. GitHub will provide users in the Free plan 120 core hours, or 60 hours of run time on a 2 core codespace, plus 15 GB of storage each month.
Dev container configuration is set to the one for this hack, then click Create Codespace.NOTE: To return to your environment later, open Your Codespaces and select your existing Codespace.
Resources.zip, the student resources package.In your chosen environment:
To complete this challenge successfully, you should be able to: