# Run code generation in the background with GitHub Copilot coding agents | GitHub Checkout

Source: https://www.youtube.com/watch?v=S1ch_6fjp5M
Recap page: https://rapidrecap.app/video/S1ch_6fjp5M
Generated: 2026-02-18T16:01:25.191+00:00

---
## Quick Overview

GitHub Copilot Coding Agents allow developers to run complex, multi-step coding tasks entirely in the background using a command-line interface (CLI) or directly within the GitHub interface, enabling features like performance benchmarking, security scanning (CodeQL), and automatically generating pull requests based on detailed prompts.

**Key Points:**
- GitHub Copilot Coding Agents enable executing complex development tasks, such as adding unit tests or optimizing code, remotely in the cloud without local processing.
- The demonstration shows an agent optimizing IATA code lookups, resulting in a 90.351% reduction in time (17.67µs down to 1.22µs average speedup).
- The agent workflow includes setting up the environment, running benchmarks, executing code changes, running security scans (CodeQL), and generating a summary/PR.
- Custom agents, like the 'Performance Optimiser' agent shown, can be created and loaded via Markdown files in a repository's '.github/agents' directory.
- The CLI command `copilot --resume:PR_kwDOhBn6lMG-8MsY` allows resuming a previously interrupted session, offering remote or local connection modes.
- The agent automatically handles tasks like running npm tests, prettier fixes, and ESLint fixes, feeding the logs back to the user.
- The custom agent for performance tasks is explicitly designed to follow a data-driven approach: benchmark first, implement changes, and benchmark again to validate improvements.

![Screenshot at 00:50: Tim Rogers demonstrates the GitHub dashboard interface where the Copilot Agents feature is accessed, showing a list of recent agent sessions and the input field for describing a new coding task.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-00-50.jpg)

**Context:** This video features Andrea Griffiths (Product Manager, GitHub) interviewing Tim Rogers (Staff Product Manager, GitHub) about the latest features of GitHub Copilot Coding Agents, specifically demonstrating how these agents can execute complex, multi-stage development workflows autonomously in the background, either locally or remotely via the CLI or the GitHub web interface.

## Detailed Analysis

The demonstration focuses on leveraging GitHub Copilot Coding Agents for automated, complex development tasks. Tim Rogers shows how to initiate an agent session directly from the GitHub dashboard or via the CLI using `copilot` commands. He first demonstrates running a performance optimization task on an IATA code decoder repository, where the agent analyzes the current bottleneck (O(n) linear scan) and implements a solution using optimized lookup structures (Maps) to achieve O(1) access, resulting in a massive performance improvement (over 90% reduction in time). The agent handles setting up the environment, running benchmarks, applying code changes, running security scans (CodeQL), and preparing a summary and draft Pull Request. Rogers also shows how to create custom agents by defining their persona and expertise in Markdown files within the `.github/agents` directory, using a 'Performance Optimiser' agent as an example. Furthermore, he illustrates resuming interrupted sessions using `copilot --resume:[session_ID]` and the choice between remote execution (logs streamed in CLI) or local execution (branch checked out locally). The overall message is that agents streamline complex development loops, ensuring code quality and security checks are integrated automatically.

### Introducing Copilot Agents

- Agents can execute multi-step tasks in the background locally or remotely
- Agents offer curated workflows like performance optimization and security scanning

### Performance Optimization Demonstration

- Agent optimized IATA lookup from O(n) linear scan to O(1) Map access, achieving 90.351% time reduction
- Agent ran benchmarks before and after changes to validate improvement

### Custom Agents

- Custom agents are defined in Markdown files in the `.github/agents` directory
- Example shown is the 'Performance Optimiser' agent, which follows a data-driven approach

### CLI Interaction and Resuming Sessions

- CLI command `copilot --resume:[ID]` allows resuming interrupted work
- User chooses between remote execution (logs streamed) or local execution (branch checked out)

### Automated Workflow Steps

- Agent automatically runs unit tests, prettier, ESLint fixes, CodeQL security scans, and summarizes work before creating a draft PR.

![Screenshot at 00:15: Andrea Griffiths and Tim Rogers introduce the segment, with the GitHub logo visible in the background.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-00-15.jpg)
![Screenshot at 00:50: Tim Rogers navigates the GitHub dashboard to access the Copilot Agents interface, showing recent sessions and the prompt input area.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-00-50.jpg)
![Screenshot at 01:37: Tim Rogers opens the model selection dropdown within the Agent interface, showing options like Claude Opus 4.5 and GPT models.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-01-37.jpg)
![Screenshot at 02:23: Tim Rogers selects GPT-5.2-Codex as the model for the task of adding comprehensive unit tests with Jest.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-02-23.jpg)
![Screenshot at 07:24: The benchmark results screen shows a massive performance improvement of 90.351% reduction in time after optimization.](https://ss.rapidrecap.app/screens/S1ch_6fjp5M/00-07-24.jpg)
