How to make your agent aware of codebases and documentation
AI coding agents work best when they understand the context of your project. This guide shows you how to give your agent access to codebases and documentation, making it more helpful and accurate.Make your agent aware of your open codebase
When your agent understands your current codebase, it can provide more relevant suggestions and answers.Let your agent explore the codebase using tools
Your agent can use built-in tools to navigate and understand your code:- File exploration tools: The agent can read files, search for patterns, and understand project structure
- Code search: Use search to find relevant code snippets
- Git integration: Access commit history and understand code evolution
Create rules to help the agent understand your codebase
Rules guide your agent’s behavior and understanding. Place markdown files in.continue/rules
in your project to provide context:
Place rules files at different levels of your project hierarchy to scope when they trigger
Make your agent aware of other codebases
Sometimes you need your agent to understand code beyond your current project.Public codebases
For open-source projects and public repositories, you have several options:Rules with hyperlinks
Create rules that point to external codebases:GitHub and GitLab CLIs
Enablegh
or glab
CLI access for your agent to interact with repositories.
Add rules to guide CLI usage:
DeepWiki MCP
DeepWiki MCP lets your agent explore any public GitHub repository. Once configured, your agent can explore repositories like:- “Explore the React repository structure”
- “Find how authentication is implemented in NextAuth.js”
Internal codebases
For private and internal repositories, you need additional setup:Custom MCP servers
Create an MCP server that has access to your internal repositories.Custom code RAG
For faster retrieval and lower costs with very large internal codebases, consider implementing a custom code RAG system. This is an advanced approach that requires more setup but can provide performance benefits at scale.Make your agent aware of relevant documentation
Documentation provides crucial context for your agent to understand APIs, frameworks, and best practices.Public documentation
Rules with documentation links
Guide your agent to relevant documentation:Context7 MCP
Context7 MCP enables your agent to search and retrieve information from public documentation: Your agent can then answer questions like:- “How do I use React hooks?”
- “What’s the syntax for Tailwind CSS animations?”
Internal documentation
For private documentation and wikis:Rules with internal links
Create rules that reference internal resources:Custom MCP servers for docs
Create an MCP server that accesses your internal documentation.Migrating from deprecated context providers
If you were previously using the@Codebase
or @Docs
context providers, here’s how to migrate to the new approach:
Migrating from @Codebase
The@Codebase
context provider has been deprecated. Instead:
- Use built-in tools: Your agent can now use file exploration and search tools to understand your codebase
- Add rules: Create
.continue/rules
files to provide context about your project structure - Use MCP servers: For external codebases, use DeepWiki MCP or custom MCP servers
Migrating from @Docs
The@Docs
context provider has been deprecated. Instead:
- Use Context7 MCP: For public documentation, Context7 MCP provides similar functionality
- Add documentation links in rules: Create rules that reference documentation URLs
- Use custom MCP servers: For internal documentation, create an MCP server with access to your docs
Next steps
- Learn more about MCP servers
- Explore rules configuration
- Set up custom assistants with specific knowledge domains