Group Code User Guide
Navigate and organize your codebase by functionality across files and languages. Tag related code sections with special comments and browse them through a unified tree view — without changing any file structure.
See Group Code in action
A 1-minute 25-second walkthrough of adding groups, navigating across files, searching, favorites, renaming, and getting started with Copilot.
Read the video transcript
Finding a feature shouldn't mean searching through dozens of files. Meet Group Code, the Visual Studio Code extension that organizes your codebase by what it does.
Start with a simple comment. Add an @group annotation above your code, give it a name, and describe its purpose. Use the greater-than separator to create a hierarchy, like Checkout, then Payments.
Your groups appear in the sidebar. Related code can live in TypeScript, SQL, or HTML, while still belonging to the same feature. Expand a feature to explore all of its source files.
Click a group to jump straight to its code. Search to narrow the list, and favorite the groups you use most.
Need to reorganize? Rename a parent group, and its child annotations follow. Your edits stay available for review and undo.
For a faster starting point, the Copilot integration can suggest group annotations. Review the proposed changes, then save when you're ready.
Group Code keeps its index up to date as eligible files change, and respects your workspace's ignore rules.
Turn a collection of files into a map of your features. Find Group Code in the Visual Studio Code Marketplace.
Table of Contents
- Watch the Demo
- Overview
- Installation
- Quick Start
- Comment Syntax
- Hierarchical Groups
- Tree Views
- Navigation
- Favorites
- Rename Groups
- Quick Add Group
- Smart Autocomplete
- Hover Cards
- Filter & Search
- Chat Participant (@groupcode)
- AI Generate Groups
- AI Suggest
- Language Model Tool
- Workspace Scanning
- Analysis Tools
- Settings
- Status Bar
- Keyboard Shortcuts
- Language Support
Overview
Group Code is a VS Code extension that lets you annotate code sections
with @group comments, then instantly browse and jump to all annotated sections
from a dedicated sidebar. It creates a logical map of your entire codebase organized by
feature or functionality — not by file or folder structure.
Instead of hunting through dozens of files to find all code related to "Authentication",
you tag each piece with // @group Authentication, and the extension surfaces
them all in one tree view. Click any entry to jump directly to that line.
Parent > Child > Grandchild syntax up to any depth.Installation
From the VS Code Marketplace
-
Open Extensions
Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac) to open the Extensions sidebar.
-
Search for Group Code
Type
Group Codein the search box. Look for the publisherthechandanbhagat. -
Install
Click the Install button. The extension activates immediately — no restart required.
-
Open a workspace
Open any folder in VS Code. The Group Code icon (compass) appears in the Activity Bar on the left.
From Open VSX Registry
Visit open-vsx.org to install on VSCodium or any Open VSX-compatible editor.
Requirements: VS Code 1.99.1 or higher with a filesystem workspace. Browser-only and virtual workspaces are unsupported. AI features additionally require an available language model, such as GitHub Copilot with an active subscription.
Quick Start
Get up and running in under two minutes.
-
Open a code file
Open any source file in your workspace (e.g., a TypeScript, Python, or JavaScript file).
-
Add your first @group comment
Above any function or block, type a comment using the
@groupsyntax (see Comment Syntax for all formats). -
Watch the sidebar update
The Group Code Explorer in the Activity Bar updates automatically within half a second of your edit — no manual refresh needed.
-
Click to navigate
Click any item in the tree view to jump to that code location in the editor.
// A basic @group comment in TypeScript
// @group Authentication : Handles user login and token validation
export function login(email: string, password: string) {
// ...
}
// @group Authentication
export function validateToken(token: string) {
// ...
}
Comment Syntax
Group Code detects @group annotations inside comments. The extension
automatically picks the right comment style for each file type.
Format
<comment-prefix> @group <GroupName> : <description>
The description is optional. Both parts are used in hover cards and tree labels.
Examples by Language
| Language(s) | Comment Format | Example |
|---|---|---|
| JS / TS / Java / C# / C++ / Go / Rust / Swift / Kotlin | // |
// @group Auth : Login handler |
| Python / Ruby / Shell / YAML / Makefile | # |
# @group DatabaseOps : Query builder |
| HTML / XML / SVG | <!-- --> |
<!-- @group Layout : Header section --> |
| CSS / SCSS / Less | /* */ or // |
// @group Theme : Color variables |
| SQL | -- |
-- @group Reporting : Monthly summary |
| PHP | // |
// @group API : User endpoint |
With Tags
Append optional hashtag-style tags after the description for additional categorization:
// @group Authentication : User login handler #auth #security #api
Tip: Place the @group comment on the line immediately above the function, class, or block it belongs to. This makes hover cards and tree entries as precise as possible.
@group comments in the editor and their corresponding entries in the explorer.Hierarchical Groups
Use the > separator to create nested group hierarchies of any depth.
The tree view displays these as folders with collapsible children.
Syntax
// @group Parent > Child > Grandchild : Description
Examples
// Two-level
// @group Auth > Login : Handles credential validation
// Three-level
// @group Auth > Login > Validation : Email and password checks
// @group Auth > Login > API : Login API call
// Four-level
// @group Features > Dashboard > Widgets > Charts : Sales chart
How the Tree Looks
Parent groups use a stacked-layers icon. The tree preserves the functionality hierarchy and lists clickable source entries directly beneath each group:
Auth
Login
Validation (2 groups)
validateEmail.ts
validatePassword.ts
API (1 group)
loginUser.ts
Signup
Form Handling (1 group)
Best Practices
- Use consistent casing —
Auth > Loginandauth > loginare treated as the same group. - Keep hierarchy levels to 3–4 max for readability.
- Use noun phrases for parent nodes (
Auth,Database) and verb/action phrases for leaves (Validation,Query).
Avoid mixed separators: Use only > as the hierarchy separator. Underscores or dashes in group names are treated as part of the name, not as hierarchy dividers.
Tree Views
Group Code provides two views of the same functionality hierarchy. Both views are kept in sync — a filter applied in one applies to both.
| View | Location | Description |
|---|---|---|
| Group Code | Group Code Activity Bar panel | Primary view. Groups organized by hierarchy. This is the main navigation view. |
| Group Code (Explorer) | VS Code Explorer sidebar panel | Mirror of the main Group Code view, embedded in the standard Explorer. |
Switching Views
Click the Group Code icon (compass) in the Activity Bar to open the dedicated panel.
The same functionality hierarchy is also available in the Group Code panel at the bottom of the standard VS Code Explorer.
In either view, expand a group and click a source entry directly beneath it to jump to its @group annotation.
Tree View Toolbar
Each tree view has a toolbar with the following buttons:
| Button | Action |
|---|---|
| Search (magnifier icon) | Open the filter input box to search groups by name |
| Clear filter (X icon) | Clear the active filter and show all groups |
| Refresh (circular arrows) | Rescan the workspace and rebuild the tree |
| Settings (gear icon) | Open the Group Code Settings panel |
Navigation
Clicking any group entry in the tree view opens the corresponding file and scrolls to that exact line number.
Single-Click Navigation
Click any leaf node (file entry) in the tree view. VS Code opens the file and positions the cursor at the @group comment line.
Keyboard Navigation
Press Ctrl+Shift+G (or Cmd+Shift+G on Mac) to open a quick-pick list of all groups. Type to filter and press Enter to jump.
Command Palette
Open the Command Palette (Ctrl+Shift+P) and run:
Group Code: Show Code Groups— opens the quick-pick navigatorGroup Code: Navigate to Code Group— same as above, via command alias
Favorites
Mark any group as a favorite to distinguish it visually and keep frequently-used groups easily identifiable. Favorites persist across VS Code sessions in your OS user profile (not in the workspace), so they never cause Git conflicts.
How to Favorite a Group
- Hover over a group node in the tree view — a star icon appears inline.
- Click the star icon to toggle the favorite state.
- Or right-click the group and choose Toggle Favorite from the context menu.
Visual Indicator
Favorite groups show a filled star icon next to their name in the tree view. Un-favoriting a group removes the star.
Favorites are stored per-user in the OS profile directory (~/.groupcode/), not inside the workspace folder. This means they are personal and never committed to Git.
Rename Groups
Rename a group directly from the tree view. The rename updates all @group comments
across every file in the workspace that references that group name.
How to Rename
- In the tree view, select a group node and press F2.
- Or right-click the group and choose Rename Group.
- Type the new name in the inline input and press Enter to confirm or Escape to cancel.
Rename performs a workspace-wide text replacement of the group name inside @group comments. This modifies files on disk. Make sure your changes are committed before renaming.
Quick Add Group
The Quick Add Group feature lets you annotate any code selection with a
@group comment through a guided UI — without manually typing the comment syntax.
How to Use
-
Select code in the editor
Highlight any function, class, block, or line you want to tag.
-
Right-click and choose "Add to Group..."
The option appears near the top of the context menu under "Group Code".
-
Choose Manual or AI-powered mode
Select Manual to type the group name yourself, or AI-powered to let GitHub Copilot analyze the selected code and suggest a name and description.
-
Fill in the details
Enter the group name (or pick an existing one from the list), an optional description, and optional tags. Click OK. The comment is inserted above your selection automatically.
Manual Flow
The manual mode walks you through three prompts:
- Group name — Choose an existing group from the quick-pick list or create a new one. Hierarchy is supported: type
Parent > Child. - Description (optional) — A short description appended after the colon.
- Tags (optional) — Space-separated tags appended as
#tag1 #tag2.
AI-Powered Flow
Requires GitHub Copilot. The extension sends the selected code to the language model and proposes a group name and description. You can review and edit both before confirming.
Keyboard Shortcut
You can also trigger Quick Add Group with Ctrl+Alt+K (or Cmd+Alt+K on Mac) when the editor is focused.
Smart Autocomplete
The extension registers a completion provider that triggers inside comment lines.
As you type @group, VS Code shows intelligent suggestions.
Trigger Characters
| Trigger | What Appears |
|---|---|
@ |
Suggests the group keyword to complete to @group |
After @group |
Lists all existing group names from the workspace, sorted by usage frequency |
After > in a group name |
Suggests valid child nodes based on existing hierarchy paths |
Hierarchy Autocomplete
When continuing a hierarchy path, the completion provider shows only the children of the already-typed parent, preventing typos and ensuring consistency.
// Type: // @group Auth >
// Completions show: Login, Signup, OAuth ...
// @group Auth > Login >
// Completions show: Validation, API, Session ...
Autocomplete only activates inside comment lines. It will not fire inside string literals or regular code, preventing false triggers.
Hover Cards New in v1.8.0
Hovering over any @group annotation shows a rich floating card with
detailed information about the group — without leaving the current file.
What is Shown
- Hierarchy Breadcrumb — The full path like
Auth › Login › Validation - Description — The inline description from the comment, or the first indexed description
- Usage Statistics — Number of files and total occurrences in the workspace
- File Listing — Up to 6 filenames where this group appears (with overflow count)
- Sub-groups — Direct child groups listed for parent-level annotations
How to Trigger
Move your cursor over the @group keyword on any comment line. The hover card appears automatically. It only activates on comment lines — not on regular code.
Filter & Search
Both functionality hierarchy views share a synchronized filter. Filtering either view updates both simultaneously.
Using the Filter
-
Click the Search (magnifier) icon
In the tree view toolbar, click the magnifier icon to open the search input box.
-
Type your filter text
The tree view updates in real time as you type. Matches are case-insensitive and search across group names, file types, and descriptions.
-
Clear the filter
Click the Clear Filter (X) icon in the toolbar to reset and show all groups.
What Gets Searched
- Group name (including hierarchy path)
- File extension / language type
- Description text
You can also open the filter by running the command Group Code: Search Groups from the Command Palette (Ctrl+Shift+P).
Chat Participant — @groupcode
AI
Group Code registers a GitHub Copilot Chat participant named @groupcode.
Open any Copilot Chat window and prefix your message with @groupcode to
interact with your code groups using natural language.
Requires GitHub Copilot with Chat support. The participant is sticky — once selected in chat, it remains active for subsequent messages.
Available Commands
@groupcode /generate— Generate @group comments for the current file (adds missing ones; preserves existing)@groupcode /generate update— Regenerate all groups in the current file (replaces existing; prompts for confirmation)@groupcode /generate workspace— Generate groups for all files in the entire workspace@groupcode /scan— Scan the active file and return a summary of groups found@groupcode /scan workspace— Scan all workspace files and return a full group summary@groupcode /suggest— Analyze selected code and suggest a group name + description@groupcode /list— List all code groups in the workspace@groupcode /find <name>— Search for groups matching a name (supports hierarchy queries likeAuth > Login)@groupcode /navigate <name>— Jump to a specific group in the editor@groupcode /refresh— Rescan all files and refresh the tree view@groupcode /refactor— Analyze groups for refactoring opportunities@groupcode /duplicates— Find duplicate or semantically similar group names@groupcode /orphaned— Find groups that may be outdated or unused@groupcode help— Show a summary of all available commands
Natural Language
You can also use plain English. The participant understands intent without slash commands:
@groupcode show me all groups in this workspace
@groupcode find anything related to authentication
@groupcode generate comment groups for this file
@groupcode analyze my groups for duplicates
AI Generate Groups
AI
The Generate feature analyzes your code with GitHub Copilot and automatically
inserts @group comments where none exist. It runs in two modes:
| Mode | Behavior | How to Run |
|---|---|---|
| Safe Mode | Adds missing groups only. Never modifies or removes existing @group comments. | @groupcode /generate |
| Update Mode | Regenerates all groups — replaces existing ones. Asks for confirmation first. | @groupcode /generate update |
| Workspace | Runs safe-mode generation on every file in the workspace. | @groupcode /generate workspace |
What the AI Does
Generated changes remain in edited documents for review and Undo. Save the documents to keep them. Requests that fail, are cancelled, or refer to a changed document cannot replace its source.
- Reads the entire file content and identifies logical code sections (functions, classes, blocks).
- Infers a meaningful group name and short description for each section.
- Inserts a correctly formatted
@groupcomment above each section. - Respects the file's comment syntax (e.g.,
#for Python,//for TypeScript).
Run @groupcode /generate on a new file to instantly document its structure. Then refine the generated group names to match your project's naming conventions.
AI Suggest
AI Unlike Generate (which processes an entire file), Suggest focuses on your currently selected code and returns a targeted group recommendation.
How to Use
-
Select code in the editor
Highlight any code section you want to tag.
-
Right-click and choose "Suggest Code Group with AI"
Or run the command
Group Code: Suggest Code Group with AIfrom the Command Palette. You can also use@groupcode /suggestin the Chat panel. -
Review the suggestion
The AI returns a proposed group name and description. Accept, edit, or dismiss it.
-
Comment is inserted
If accepted, the
@groupcomment is automatically placed above the selection.
Language Model Tool
AI
Group Code registers a Language Model Tool named groupcode_generate.
This tool is available to GitHub Copilot Edit and any agent that supports VS Code's language
model tools API.
When Copilot invokes this tool, it can:
- Analyze code structure and identify logical groupings
- Generate complete code with
@groupcomments inserted at the right positions - Suggest group names and descriptions for specific code snippets
You do not need to call this tool manually — Copilot uses it automatically when you open a file and ask Copilot to help organize or annotate your code.
The language model tool requires VS Code 1.99.1 or newer and an available language model.
Workspace Scanning
Group Code scans your workspace files to build and maintain the group index. Scanning happens automatically on startup and after file changes, but you can also trigger it manually.
Automatic Scanning
- On extension activation — scans the entire workspace.
- On file save — re-scans the saved file only.
- On document change (debounced 500ms) — updates live when you type
@groupin any comment.
Manual Scanning
| Action | How | What it does |
|---|---|---|
| Refresh | Click Refresh button in tree view toolbar, or run Group Code: Refresh Code Groups |
Re-scans the entire workspace and rebuilds the tree |
| Rescan Workspace | Run Group Code: Rescan Entire Workspace from the Command Palette |
Clears all cached data (including the .groupcode/ directory) and performs a full cold scan. Asks for confirmation first. |
| Scan via Chat | @groupcode /scan (current file) or @groupcode /scan workspace |
Scans and returns a summary in the Chat window |
Git-Aware Filtering
The scanner respects .gitignore patterns and automatically skips common directories
such as node_modules, dist, out, .git,
build, and coverage. This keeps the scan fast and focused on source files.
Cache Location
Group data is persisted in a .groupcode/ directory at the root of the workspace.
This directory is managed automatically and does not need to be edited manually.
Add it to your .gitignore if you do not want to commit it.
Analysis Tools
Several advanced commands help you maintain group quality across large codebases. Run them from the Command Palette (Ctrl+Shift+P).
| Command | Description |
|---|---|
Group Code: Analyze Group Naming Patterns |
Reports naming inconsistencies — detects mixed casing, abbreviation styles, and divergent naming conventions across your groups. |
Group Code: Find Duplicate/Similar Groups |
Scans for semantically similar group names (e.g., "Auth" vs "Authentication") and consolidation suggestions. |
Group Code: Find Orphaned Groups |
Identifies group names referenced in comments but no longer present in the live codebase, or groups in deleted files. |
Group Code: Analyze Code Group Refactoring |
Provides restructuring suggestions — groups that could be merged, split, or reorganized into better hierarchies. |
Group Code: Convert Flat Groups to Hierarchies |
Analyzes flat group names and suggests equivalent hierarchical representations. Applies the conversions if you confirm. |
Group Code: Remove All Code Group Comments |
Strips all @group comments from workspace files. Use with caution — this modifies files on disk. A confirmation prompt is shown. |
Remove All Groups is a destructive operation. Always commit or stash your changes before running it.
Settings
Open the Group Code Settings panel with the gear icon in the tree view toolbar, or run
Group Code: Open Settings from the Command Palette.
Settings Panel Options
| Setting | Description |
|---|---|
| Preferred AI Model | Select which GitHub Copilot language model to use for generation and suggestions. The list is populated from the models available in your Copilot subscription. |
| Refresh Models | Reload the available model list from Copilot. The list is cached for 24 hours to improve performance. |
| Open Settings File | Open the raw .groupcode/settings.json file for manual editing. |
| Clear All Groups | Remove all @group comments from the workspace. Equivalent to the Remove All Code Group Comments command. |
Settings Storage
Settings are stored in <workspace-root>/.groupcode/settings.json. This is a workspace-scoped file — different settings per project are fully supported.
Set Preferred AI Model (Quick)
Run Group Code: Set Preferred AI Model from the Command Palette to pick a model without opening the full settings panel.
Status Bar Integration
A Group Code item appears in the VS Code status bar at the bottom of the window. Clicking it opens the quick-pick group navigator — the same as pressing Ctrl+Shift+G.
The status bar item shows the total number of code groups found in the workspace, giving you a quick at-a-glance count.
Keyboard Shortcuts
| Shortcut | Mac | Action |
|---|---|---|
| Ctrl+Shift+G | Cmd+Shift+G | Show Code Groups (quick-pick navigator) |
| Ctrl+Alt+K | Cmd+Alt+K | Add Code Group Dialog (opens the Add Group dialog for the current cursor position) |
| F2 | F2 | Rename Group (when a group node is focused in the tree view) |
You can rebind any of these shortcuts from File > Preferences > Keyboard Shortcuts by searching for "Group Code".
Language Support
Group Code works with 40+ languages. The @group syntax is injected into the grammar of all supported file types, providing syntax highlighting in the editor.
Even for unsupported file types, the extension still detects @group comments
and indexes them — it falls back to // @group style comment detection.
Group Code v1.9.0 — Published by thechandanbhagat — View on GitHub