Getting cody to understand it's own references / @-mentions

I was asking Cody how to speed up a new session startup,( with respect to ensuring it has the base context for my project). Cody suggested using a template, here’s part of it:


Hi Cody, new session.

**Project Focus:** [e.g., All Activity Tab]

**1. Current Progress:**

- Checklist: @docs/[feature_name]\_progress.md

- We are currently working on/about to start: [Brief description of the next step from checklist/plan]

**2. Key Documents for this Feature:**

- PRD: @docs/contacts/allActivityTab/prd.md (Main focus: Section [X.Y] if applicable)

- Implementation Plan: @docs/contacts/allActivityTab/implementation.md (Main focus: Section [A.B] if applicable)

**3. Core Codebase Files (for general reference, if unchanged):**

- Agile Working Agreement: @docs/agileWorkingAgreement.md

- Conventions: @docs/Conventions.md

- Date Handling: @docs/date-handling.md

- Schema: @prisma/schema.prisma

- Enums: @lib/enums.ts

- Errors: @lib/errors.ts

But when I copy and paste this into the new conversation, none of the @-mentions are interpreted as actual mentions/content. Is there a way of creating something like this where the references work correctly (i.e. their content becomes part of the context)?

Thanks.

This is a good idea, but the @ mentions will not automatically transformed into mentions objects. You can use the Prompt Library for that. Have a look at Prompts - Sourcegraph docs here and try it out in the Sourcegraph Prompt Library.

Here you can mention files or automatically your opened tabs.

This helps a lot if you have the same prompt. What else you can do is to generate in your Prompt Library only the file references as template and including your prompt manually if that changes throughout the project.

Try to experiment a little bit to get a feel for.

1 Like

Many thanks for your kind reply.

I’ve had a look at the documentation you recommended, and I was particularly interested in the https://sourcegraph.com/docs/cody/capabilities/prompts#specific-and-dynamic-context - when I enter the @ symbol on Prompts - Sourcegraph (which I got to via VS Code), I don’t get the expected drop down. I have a Pro membership, should this feature be available to me?

Thanks again!

Hey @richardroscoe I investigated about that issue and is indeed a bug in the Prompt Library. I already informed the team and they will look further to fix it.

Sorry for the inconvenience.