
How Do Context Blocks Work?
You can add context providers to assistants usingcontext
blocks. Explore available context blocks in the hub.
Built-in Context Providers
You can add any built-in context-providers in your config file as shown below:@File Context Provider – Reference Files in Your Workspace
Reference any file in your current workspace. config.yaml@Code Context Provider – Reference Functions and Classes
Reference specific functions or classes from throughout your project. config.yaml@Git Diff Context Provider – Reference Branch Changes
Reference all of the changes you’ve made to your current branch. This is useful if you want to summarize what you’ve done or ask for a general review of your work before committing. config.yaml@Current File Context Provider – Reference the Active File
Reference the currently open file. config.yaml@Terminal Context Provider – Reference Last Terminal Command and Output
Reference the last command you ran in your IDE’s terminal and its output. config.yaml@Docs Context Provider – Reference Documentation Site Content
Reference the contents from any documentation site. config.yaml@Docs
context provider.
To use it, you need to add a documentation site to your config file. See the docs page for more information.
@Open Context Provider – Reference All Open Files or Pinned Files
Reference the contents of all of your open files. SetonlyPinned
to true
to only reference pinned files.
config.yaml
@Web Context Provider – Reference Relevant Web Pages
Reference relevant pages from across the web, automatically determined from your input. Optionally, setn
to limit the number of results returned (default 6).
config.yaml
@Codebase Context Provider – Reference Relevant Codebase Snippets
Reference the most relevant snippets from your codebase. config.yaml@Folder Context Provider – Reference Code from a Specific Folder
Uses the same retrieval mechanism as@Codebase
, but only on a single folder.
config.yaml
@Search Context Provider – Reference Code Search Results
Reference the results of codebase search, just like the results you would get from VS Code search. config.yaml@Url Context Provider – Reference Content from a URL
Reference the markdown converted contents of a given URL. config.yaml@Clipboard Context Provider – Reference Clipboard Items
Reference recent clipboard items config.yaml@Tree Context Provider – Reference Workspace File Structure
Reference the structure of your current workspace. config.yaml@Problems Context Provider – Reference Problems in the Current File
Get Problems from the current file. config.yaml@Debugger Context Provider – Reference Debugger Local Variables
Reference the contents of the local variables in the debugger. Currently only available in VS Code. config.yaml@Repository Map Context Provider – Reference Codebase Outline and Signatures
Reference the outline of your codebase. By default, signatures are included along with file in the repo map.includeSignatures
params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled.
config.yaml
Entire codebase
, or specify a subfolder to generate the repository map from.
This context provider is inspired by Aider’s repository map.