SmarterCode DeepSeek
Table of Contents
1. OverviewSmarterCode DeepSeek is a VS Code extension that brings DeepSeek's language models (V4 Flash & V4 Pro) directly into your editor. It goes beyond a simple chat wrapper by providing:
2. Copilot IntegrationThe extension registers DeepSeek as a VS Code Language Model Chat Provider and a Chat Participant, making DeepSeek models available throughout VS Code's built-in chat interface. How It Works
Registration
Features
Usage
Chat Participant FallbackWhen invoked in the chat participant ( 3. Vault-Based Persistent MemoryThe vault is an embedded Obsidian-style Markdown note collection that serves as the project's persistent memory. Every note is a Vault Structure
Note Format
Frontmatter Fields
Vault IndexingOn startup, the extension scans all
The vault is auto-reindexed whenever files are added, removed, or modified via a System Prompt from VaultYou can place a custom system prompt in your vault and point to it via the 4. Iteration Flow (Workflow-Based Interaction)The Iteration Flow ( Workflow StepsStep 1 — Objective
Step 2 — Files
Step 3 — DeepSeek Submit
Step 4 — Response
Workflow Header Menu (⋮)The workflow header provides a kebab menu (⋮) with the following actions:
Iterative Refinement LoopIf DeepSeek's response contains a YAML block with
...the workflow prompts for clarifications and restarts, enabling an adjustment loop where you iteratively refine the objective and files until satisfied. Context Menu TriggersExplorer context menu (
Editor context menu (
Custom WorkflowsYou can define custom workflow YAML files in Active Flow InjectionWhile an Iteration Flow is running, you can inject additional files, tags, or objective text into the active flow via the sidebar explorer's "Add to Iteration Flow" context menu action. 5. Sidebar ExplorerThe DeepSeek Explorer sidebar (activity bar icon) provides a hierarchical view of: Vault Files
Global Vault Files (if configured)
Tags
TODOs
Workflows
6. ToDo BrowserThe ToDo Browser ( Memory TODOsScans vault Markdown files for sections matching: Parses:
Source TODOsScans workspace source files (configurable via
Features
7. Writeback Engine (Auto-Apply Diff Patches)The Writeback Engine enables DeepSeek to propose and apply changes to workspace files automatically. When DeepSeek outputs a unified diff inside a Supported FormatsUnified Diff:
Note Creation:
How It Works
Response StorageAll responses are saved to
8. Context Tag SystemTags are the primary mechanism for selective context injection. Each vault note carries one or more tags, and you control which tags are active. How It Works
Smart Features
Status Bar Indicator
Click the status bar item to open the tag picker. 9. Multi-Vault ArchitectureThe extension supports two vaults simultaneously: Workspace Vault (default)
Global Vault (optional)
Use Cases
10. Configuration ReferenceAll settings are under the Core Settings (
|
| Setting | Type | Default | Description |
|---|---|---|---|
deepseek.mode |
"api" | "local" |
"api" |
Inference mode. |
deepseek.apiKey |
string | "" |
API key (stored in SecretStorage; prefer DEEPSEEK_API_KEY env var). |
deepseek.apiEndpoint |
string | https://api.deepseek.com/v1/chat/completions |
API endpoint override. |
deepseek.model |
string | "deepseek-v4-flash" |
Model name to use. |
deepseek.vaultRoot |
string | ".vault" |
Vault path relative to workspace root. |
deepseek.vaultPath |
string | "" |
(Legacy) Deprecated alias for deepseek.vaultRoot. Takes precedence only if vaultRoot is empty. |
deepseek.globalVaultPath |
string | "" |
Absolute path to an external global vault. |
deepseek.defaultContextTags |
string[] | [] |
Tags active on startup. |
deepseek.maxContextNotes |
number (1–50) | 10 |
Max vault notes injected per turn. |
deepseek.maxNoteLength |
number (100–32000) | 4000 |
Max chars per note before truncation. |
deepseek.systemPromptPath |
string | "" |
Path to a custom system prompt file inside vault. |
Copilot Debug Settings (deepseek-copilot.*)
| Setting | Type | Default | Description |
|---|---|---|---|
deepseek-copilot.debugMode |
"minimal" | "metadata" | "verbose" |
"minimal" |
Controls request diagnostics and dump file generation. |
Internal Copilot Settings (advanced)
| Setting | Namespace | Description |
|---|---|---|
baseUrl |
deepseek-copilot |
API base URL for the deepseek-copilot provider. |
maxTokens |
deepseek-copilot |
Max output tokens (0 = model default). |
experimental.stabilizeToolList |
deepseek-copilot |
Enable tool list stabilization across turns. |
visionModel |
deepseek-copilot |
Model used for vision proxy image descriptions. |
11. Commands Reference
Primary Commands
| Command ID | Title | Description |
|---|---|---|
deepseek.newObjective |
DeepSeek: Iteration Flow | Open the multi-step workflow-based interaction flow. |
deepseek.openChat |
DeepSeek: Open Chat | Open VS Code's built-in chat panel. |
deepseek.setApiKey |
DeepSeek: Set API Key | Prompt to set/update the DeepSeek API key. |
deepseek.clearApiKey |
DeepSeek: Clear API Key | Remove the stored API key. |
deepseek.getApiKey |
DeepSeek: Get API Key | Check if an API key is configured. |
deepseek.showLogs |
DeepSeek: Show Logs | Open the DeepSeek Copilot log output channel. |
Context & Vault Commands
| Command ID | Title | Description |
|---|---|---|
deepseek.setContextTags |
DeepSeek: Set Context Tags | Open tag picker to select active tags. |
deepseek.clearContext |
DeepSeek: Clear Context | Reset to default context tags. |
deepseek.showCurrentContext |
DeepSeek: Show Current Context | Display active context tags. |
deepseek.reindexVault |
DeepSeek: Reindex Vault | Force a full vault reindex. |
deepseek.configureDeepSeek |
DeepSeek: Configure Settings | Open VS Code settings for this extension. |
deepseek.createVault |
DeepSeek: Create Vault | Initialize a new vault in the workspace. |
Sidebar & Explorer Commands
| Command ID | Title | Description |
|---|---|---|
deepseek.sidebar.refresh |
DeepSeek: Refresh Sidebar Explorer | Refresh the sidebar tree view. |
deepseek.openVaultFile |
DeepSeek: Open Vault File | Open a vault note in the editor. |
deepseek.openTodoItem |
DeepSeek: Open Todo File at Line | Jump to a TODO item's file and line. |
deepseek.explorerOpenItem |
Open in Deepseek | Open a sidebar item. |
deepseek.explorerDeleteItem |
Delete | Delete a vault note from the sidebar. |
deepseek.explorerAddToIterationFlow |
Add to Iteration Flow | Inject item into active workflow. |
deepseek.saveWorkflowToVault |
DeepSeek: Save Workflow to Vault | Save current workflow as YAML. |
deepseek.openSavedWorkflow |
DeepSeek: Open Saved Workflow | Open and run a saved workflow. |
deepseek.saveWorkflowFromExplorer |
DeepSeek: Save Workflow | Save workflow from sidebar context menu. |
Context Menu Triggers
| Command ID | Where | Title | Behavior |
|---|---|---|---|
deepseek.startIterationFlow |
Explorer (file/folder/multi) | Ask Deepseek... | Opens Iteration Flow with pre-populated files. |
deepseek.addSelectionToIterationFlow |
Editor (selected text) | Ask Deepseek... | Opens Iteration Flow with selection + line numbers. |
API Commands (for programmatic use)
| Command ID | Title | Description |
|---|---|---|
deepseek.api.addFileToContext |
Add File to Chat Context | Add a file to the pending context. |
deepseek.api.clearChatContext |
Clear Chat Context | Reset the pending context. |
deepseek.api.addFileFragmentToContext |
Add File Fragment to Chat Context | Add a code fragment to context. |
deepseek.api.submitToDeepSeek |
Submit Context to DeepSeek | Submit accumulated context to DeepSeek. |
deepseek.api.addTagToContext |
Add Tag to Chat Context | Add a tag to context. |
deepseek.api.addRequestText |
Add Request Text to Chat Draft | Add text to the request draft. |
ToDo Browser
| Command ID | Title | Description |
|---|---|---|
deepseek.openTodoBrowser |
DeepSeek: Open ToDo Browser | Open the ToDo aggregation webview. |
12. Architecture Overview
┌──────────────────────────────────────────────────────┐
│ VS Code Extensions Host │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ extension.ts (activate) │ │
│ │ │ │
│ │ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ AuthManager │ │ VaultManager │ │ │
│ │ │ (auth.ts) │ │ (vaultManager.ts) │ │ │
│ │ └──────┬──────┘ └────────┬─────────┘ │ │
│ │ │ │ │ │
│ │ ┌──────▼──────┐ ┌───────▼────────┐ │ │
│ │ │ DeepSeek │ │ IndexEngine │ │ │
│ │ │ ChatProvider│ │ (indexEngine.ts)│ │ │
│ │ │(provider/ │ └───────┬────────┘ │ │
│ │ │ index.ts) │ │ │ │
│ │ └──────┬──────┘ ┌───────▼────────┐ │ │
│ │ │ │ ContextSelector │ │ │
│ │ │ │(contextSelector)│ │ │
│ │ │ └───────┬────────┘ │ │
│ │ │ │ │ │
│ │ ┌──────▼──────────────────▼────────┐ │ │
│ │ │ DeepSeekClient │ │ │
│ │ │ (deepseekClient.ts) │ │ │
│ │ └──────────────┬───────────────────┘ │ │
│ │ │ │ │
│ │ ┌──────────────▼────────────┐ │ │
│ │ │ WritebackEngine │ │ │
│ │ │ (writebackEngine.ts) │ │ │
│ │ └───────────────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ SidebarTree │ │ ObjectiveWorkflow │ │ │
│ │ │(sidebarTree) │ │(objectiveWorkflow│ │ │
│ │ └─────────────┘ │ .ts) │ │ │
│ │ └──────────────────┘ │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ DeepSeek API (chat.deepseek.com) │ │
│ │ or Local Inference Server │ │
│ └──────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
Key Design Decisions
Dual Provider Architecture — The extension registers both a
LanguageModelChatProvider(for Copilot integration) and a standaloneDeepSeekClient(for the Iteration Flow). Each has independent configuration and request pipelines.Vault as File System — The vault is stored as plain Markdown files on disk, making it version-control friendly and editable with any tool.
Tag-Based Context Injection — Instead of relying on full-text search, tags provide explicit, user-controlled context selection. The
@basetag ensures foundational notes are always included.Workflow Execution Plan — The Iteration Flow uses a reusable workflow execution framework from
shared/vscode-components/, supporting custom YAML-defined workflows beyond the embedded default.Unified Diff Writeback — Code changes are applied via unified diff patches parsed directly from model responses, enabling automated code modification with human oversight.
13. Build & Install
Prerequisites
- Node.js 18+
- VS Code 1.85+
Build
cd vscode-extensions/vscode-deepseek
npm install
npm run compile
Package & Install
Run build-install.bat from the extension folder:
build-install.bat
This runs vsce package (which triggers vscode:prepublish → precompile → compile), then code --install-extension on the resulting .vsix.
If shared components have changed (shared/vscode-components/), vsce package automatically runs prepare:shared-components to materialize the latest build.
After install, reload VS Code:
Ctrl+Shift+P → Developer: Reload Window
Extension Structure
vscode-deepseek/
├── src/
│ ├── extension.ts # Activation, command registrations, DI wiring
│ ├── auth.ts # API key management via SecretStorage
│ ├── consts.ts # Constants & model definitions
│ ├── types.ts # TypeScript types
│ ├── logger.ts # Output channel logger
│ ├── i18n.ts # Internationalization (Chinese/English)
│ ├── deepseekClient.ts # Standalone DeepSeek API client (Iteration Flow)
│ ├── vaultManager.ts # Vault file management & frontmatter parsing
│ ├── indexEngine.ts # Tag/id/type index building
│ ├── contextSelector.ts # Active tag selection & intent parsing
│ ├── sidebarTree.ts # DeepSeek Explorer tree provider
│ ├── todoBrowser.ts # ToDo aggregation webview
│ ├── writebackEngine.ts # Unified diff parser & file patcher
│ ├── objectiveWorkflow.ts # Iteration Flow workflow definition
│ ├── client/
│ │ ├── core.ts # Copilot provider HTTP client
│ │ └── error.ts # Error handling utilities
│ └── provider/
│ ├── index.ts # DeepSeekChatProvider (Copilot integration)
│ ├── convert.ts # Message/tool format conversion
│ ├── schema.ts # Schema validation
│ ├── debug/ # Request dumping & diagnostics
│ ├── replay/ # Conversation replay engine
│ ├── tools/ # Tool stabilization & limits
│ └── vision/ # Vision proxy for image input
├── vendor/ # Materialized shared components
├── imgs/ # Extension icons
├── scripts/ # Build scripts
├── package.json
├── tsconfig.json
└── build-install.bat