Researched for Sourcegraph Cody real features. Replace the [BRACKETED] parts with your own details, copy, and paste.
1Cross-Repo Impact Analysis Before a Refactor
Act as a staff engineer. I need to rename [METHOD/CLASS] which I suspect is used across [NUMBER] microservices in our [LANGUAGE] codebase. Show me the Cody workflow: make sure Sourcegraph has indexed all [NUMBER] repos; ask Cody 'where is [METHOD] called across all repositories, and which call sites would break if I change its signature to [NEW SIGNATURE]?'; get the cross-repo reference list with file paths; then have Cody draft the migration plan ordered by dependency (leaf services first). Include how to use Context Filters to exclude [REPO TO EXCLUDE] from the search, and the verification step (run [TEST COMMAND] per affected repo) before merging.
2Onboard to a Monorepo in One Day
Act as a mentor. A [ROLE] joins on [DATE] and must understand our [LANGUAGE] monorepo ([NUMBER]k lines, [NUMBER] services) fast. Design a Cody-powered onboarding day: morning, ask Cody 'explain the architecture of [REPO]: what are the main services, how do they communicate, and where does [FEATURE] live?'; midday, 'walk me through how a request flows from [ENTRY POINT] to [DATABASE]'; afternoon, 'what are the three riskiest areas to change and why?' Include the exact follow-up questions for each answer, and a rule: the new hire must verify every Cody claim by opening the cited file before trusting it.
3Generate a Migration Script Across Repos
Act as a senior [LANGUAGE] developer. We are migrating from [OLD LIBRARY] to [NEW LIBRARY] across [NUMBER] repositories, touching roughly [NUMBER] files. Build the Cody workflow: first ask Cody to find every usage of [OLD LIBRARY] across all repos with context snippets; then have it generate the codemod-style migration script for the most common [NUMBER] patterns; then review the script pattern by pattern before running it repo by repo. Include the rollback plan ([ROLLBACK STEPS]), how to handle the [NUMBER] percent of edge cases the script cannot cover, and the test command to run after each repo ([TEST COMMAND]).
4Build Custom Prompts for Recurring Refactors
Act as a tech lead. Our team repeats the same [REFACTOR TYPE] refactor in [REPO] every sprint, and everyone does it slightly differently. Show me how to use Cody's customizable Prompts (recipes): define a prompt named [PROMPT NAME] that takes the selected code and applies our team standard ([STANDARD 1], [STANDARD 2], [STANDARD 3]); share it with the [TEAM SIZE]-person team; then measure adoption over [NUMBER] sprints. Include the exact prompt text to save, the three standards it enforces, and the review checklist for approving a teammate's new custom prompt before it becomes team canon.
5Debug With Full Codebase Context
Act as a [LANGUAGE] developer debugging [ERROR/SYMPTOM] in [PROJECT]. The stack trace points at [FILE], but the real cause is probably upstream. Walk me through the Cody debugging session: paste the error and ask 'trace this error back through the codebase; which callers pass the bad value into [FUNCTION]?'; have Cody identify the [NUMBER] most likely root causes ranked by evidence; then ask it to propose the minimal fix with the blast radius listed (files touched, tests affected). Include how to feed it the relevant test file for grounding, and the rule for when to stop trusting the AI and read the code yourself ([CONDITION]).
6Auto-Edit Workflow Without the Mess
Act as a [LANGUAGE] developer using Cody in [VS CODE/JETBRAINS]. I want to use Auto-edit (contextual completions) productively without accepting junk. Define the workflow: which file types get Auto-edit on ([FILE TYPES]) and which stay manual ([RISKY AREAS] like migrations and auth); the two-second rule (read the suggestion before accepting); and how to use Cody chat to ask 'why did you suggest [PATTERN] here?' when a completion surprises me. Include the settings to tune (context window, suggestion length) and a weekly habit: review accepted completions in [NUMBER] files and revert any that added accidental complexity.
7Document the Module Nobody Understands
Act as a technical writer. The [MODULE] module in [REPO] ([LANGUAGE], [NUMBER] lines) is critical and undocumented; the original author left in [YEAR]. Use Cody to document it: ask 'explain what [MODULE] does, its public API, and its hidden assumptions'; have Cody generate docstrings for the [NUMBER] public functions and a one-page architecture overview; then verify each claim against the code (flag anything Cody inferred without evidence). Include the review step: a domain expert ([NAME/ROLE]) fact-checks the draft in [NUMBER] minutes, and the doc gets committed next to the code at [PATH].
8Explain This Change for the Whole PR
Act as a developer opening a [NUMBER]-file PR in [REPO] that refactors [AREA]. Reviewers keep asking 'why did you change [FILE]?' Design the Cody workflow: ask Cody 'explain this change across all [NUMBER] files: what is the single intent, and why does each file need to change?'; turn the answer into the PR description with a per-file rationale table; then preempt the [NUMBER] most likely reviewer questions by answering them in the description. Include how to regenerate the explanation after review feedback changes the diff, and the template for the per-file table (file, change, reason).
9Choose the Right Model With BYOK
Act as an engineering manager. Cody supports multiple LLMs (Claude, GPT, Gemini variants) and we can bring our own keys. Design a model strategy for [TEAM NAME] ([TEAM SIZE] devs, [LANGUAGE] stack): use [MODEL A] for deep refactoring and architecture questions, [MODEL B] for fast completions and simple edits; define when a developer should switch models mid-task; and set the monthly budget guardrail ([BUDGET] per dev) with the rule for what happens when someone hits it. Include a two-week A/B test plan comparing the models on [TASK TYPE] with a simple quality score the team agrees on.
10Set Up Context Filters for a Noisy Monorepo
Act as a platform engineer. Our Sourcegraph instance indexes [NUMBER] repos including [VENDOR/GENERATED REPO] and [LEGACY REPO], and Cody keeps pulling irrelevant context from them. Configure Context Filters: exclude [REPO PATTERN 1] and [REPO PATTERN 2] from Cody's search results; verify the exclusion with a test query ('find [SYMBOL]' should return zero hits from excluded repos); then document the filter rules in [DOC LOCATION] so future repos follow the naming convention that keeps them filterable. Include the quarterly review: who checks whether new repos need adding to the filters, and the symptom that tells you filters drifted (Cody citing [EXCLUDED REPO] again).