Overview
Segments analyzes your codebase in real-time, breaking it into semantic segments and mapping their connections. Explore your code through live visualization and interactive dependency graphs. When you bring in AI, it works with the same segment-level understanding you have.
Features
Live Segment Representation

Your code, always in view. The sidebar displays all segments from compatible languages along with their dependencies and signatures. Jump instantly between segments and their connections. Everything updates in real-time as you type.
Dependency Visualization

See how your code connects. Choose what to display: current file, whole project, or current file with its dependencies. Refine the view by toggling files in the tree or filtering by segment type. Click any node to jump straight to the code.
AI Restructuring (Beta)

Restructure your project with AI guidance. Select target directories and choose whether to include subdirectories recursively.
- Code Splitting (optional): Split large classes and functions automatically
- Manual Fine-tuning: Drag-and-drop segments, create/rename/delete files and directories
- Orphan Detection: Orphaned files are flagged automatically
- Dependency Reconstruction: AI rebuilds all imports across your codebase
SegMate
Real-time suggestions while coding, leveraging segment information for project-aware recommendations.
Version Snapshots
Every restructuring creates a full compressed backup. Restore any previous state with one click.
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Segments"
- Click Install
Manual Installation
- Download the
.vsix file
- In VS Code, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run "Extensions: Install from VSIX..."
- Select the downloaded file
Getting Started
- Install the extension and open any project
- Click the Segments icon in the editor title bar to open the sidebar
- Live Segments and Dependency Visualization work immediately after installation
- For AI Restructuring, configure your AI model in Settings (gear icon in the Segments sidebar). Version Snapshots can be disabled there for large projects (100MB+ source code).
- For SegMate, configure your FIM (Fill-in-the-Middle) model in Settings (gear icon in the Segments sidebar).
Supported Languages
- Python
- JavaScript / TypeScript
- Java
- C++
- C#
- Go
- Rust
- Ruby
Requirements
- VS Code 1.95.0 or higher
- Internet connection (required for Dependency Visualization)
Known Issues
- AI Restructuring (Beta): Import statements in the newly generated structure may occasionally be incorrect. Review and adjust if needed.
Roadmap
- [ ] System Health Reporting: Get insights into code complexity, coupling, and maintainability metrics
- [ ] Precise Code Adjustment: AI-powered code modifications using segment context for accurate dependency and signature handling
- [ ] Dependency Types: Show not just connections between segments, but also the type of each dependency
- [ ] Impact Analysis: Understand how changes to a segment affect the rest of your codebase
- [ ] Dataflow Analysis: Visualize data flow between segments, including realtime segment-level taint analysis
Some features are already in development.