{"meta":{"title":"Filing issues without breaking your flow","intro":"When something catches your attention mid-task, use Copilot CLI to file a GitHub issue with code context, linked PRs, and labels, then get back to what you were doing.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/copilot","title":"GitHub Copilot"},{"href":"/en/copilot/tutorials","title":"Tutorials"},{"href":"/en/copilot/tutorials/copilot-cookbook","title":"GitHub Copilot Cookbook"},{"href":"/en/copilot/tutorials/copilot-cookbook/document-code","title":"Document code"},{"href":"/en/copilot/tutorials/copilot-cookbook/document-code/filing-issues-without-breaking-your-flow","title":"File issues without breaking flow"}],"documentType":"article"},"body":"# Filing issues without breaking your flow\n\nWhen something catches your attention mid-task, use Copilot CLI to file a GitHub issue with code context, linked PRs, and labels, then get back to what you were doing.\n\nCopilot CLI can open GitHub issues for you from the terminal. Instead of switching to a browser and filling out an issue by hand, you describe what you want and Copilot gathers context from your repository and GitHub, then creates the issue so you can keep working.\n\n## Example scenario 1: Filing an issue from a CI failure\n\nYour CI is failing or you've spotted errors in production logs. Rather than manually tracing the stack trace back to a commit, you ask Copilot CLI to investigate and file the issue for you.\n\n### Example prompt\n\n```text copy\nThe CI workflow on main has been failing since yesterday. Look at the failing \nrun, figure out what's breaking and which commit likely introduced it, then \ncreate an issue with the stack trace, a link to the failing run, and the \nsuspected PR that caused it. Label it \"bug\" and \"regression\".\n```\n\n### Example response\n\n> \\[!NOTE] The following response is an example. Copilot Chat responses are non-deterministic, so you may get a different response from the one shown here.\n\nCopilot CLI uses its GitHub MCP tools to:\n\n1. **Fetch the failing workflow run** and extract the stack trace from the logs.\n2. **Identify the responsible code** — for example, `src/services/payment.ts:94`.\n3. **Search recent commits** touching that file and find the PR that introduced the change.\n4. **Create an issue** with all the context assembled:\n\n   ```text\n   Created issue #421: Regression: PaymentService throws TypeError after #398\n\n   What's failing:\n   The `build` job on main has failed since commit `a3f7c21`. Stack trace:\n\n   TypeError: Cannot read properties of undefined (reading 'amount') at processRefund (src/services/payment.ts:94:22)\n\n   Introduced by: PR #398 (merged 2 days ago) refactored the payment types but missed updating `processRefund` to handle the new nullable `transaction` field.\n\n   Failing run: Actions run #2847\n\n   Suggested fix: Add a null check for `transaction` before accessing `transaction.amount` on line 94.\n\n   Labels: `bug`, `regression`\n   ```\n\n## Example scenario 2: Turning TODOs into tracked work\n\nOver time, TODO and FIXME comments accumulate in a codebase with no visibility. You can ask Copilot CLI to scan for these comments, assess priority, and create issues so the work is tracked.\n\n### Example prompt\n\n```text copy\nScan this repo for TODO and FIXME comments. Group them by area, pick the 5 \nmost important ones based on the surrounding code context, and create an issue \nfor each. Include the code snippet, file location, and suggest a label.\n```\n\n### Example response\n\n> \\[!NOTE] The following response is an example. Copilot Chat responses are non-deterministic, so you may get a different response from the one shown here.\n\nCopilot CLI searches the codebase, reads the context around each comment, and prioritizes based on severity:\n\n```text\nFound 23 TODO/FIXME comments across the repo. Here are the 5 I'd prioritize:\n\nCreated issue #422: FIXME: SQL injection risk in search query builder\n- src/db/search.ts:34 — user input concatenated directly into query string\n- Label: security, priority:high\n\nCreated issue #423: TODO: Rate limiter bypassed for internal routes\n- src/middleware/rate_limit.ts:12 — comment says \"temporary bypass, remove before launch\"\n- Label: security, technical-debt\n\nCreated issue #424: FIXME: Memory leak in WebSocket handler\n- src/ws/handler.ts:87 — listeners are added on each connection but never cleaned up\n- Label: bug, performance\n\nCreated issue #425: TODO: Retry logic missing for payment webhook\n- src/webhooks/payment.ts:56 — failures silently dropped, no retry queue\n- Label: reliability, priority:medium\n\nCreated issue #426: TODO: Migrate to new auth token format\n- src/auth/token.ts:3 — comment references a closing down API version\n- Label: technical-debt\n```\n\n## Further reading\n\n* [GitHub Copilot CLI](/en/copilot/how-tos/copilot-cli)"}