SmarterCode DeepSeek
Quick Start
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. UsageConfiguration — Copilot Integration ModeAPI routing is handled automatically via the DeepSeek Copilot provider. No manual API key configuration is typically required. To point to a different API endpoint (e.g., a self-hosted proxy), set Using with CopilotAfter configuring your API key, the quickest way to start is through VS Code's built-in chat:
What you can do in Copilot:
Working with Iterative PromptThe Iterative Prompt (
Quick start:
The webview includes interactive list sections for Tags, Memory Files, and TODO items — you can remove items with the ✕ button and toggle checkboxes in the TODO section. Working with Files from ExplorerYou can quickly add files from the File Explorer to your Iterative Prompt:
Working with Editor SelectionTo get help on specific code:
Working with Memory Files (Vault)The Vault is your project's persistent memory — a collection of Markdown notes stored in Creating a note: Create a
The vault is auto-indexed — new notes are picked up immediately without a restart. Using notes in prompts:
See §3 — Vault-Based Persistent Memory for the full format reference and indexing details. Working with TODOsThe extension parses TODO items from vault Markdown files that contain sections matching "next steps", "todo", or "requests". Both In the sidebar: Expand the TODOs section to see items grouped by parent folder. Using TODOs in prompts:
DeepSeek Request Log & Token CostsThe extension logs all DeepSeek API activity to the DeepSeek output channel. Viewing logs:
Understanding costs: Each log entry shows:
This is useful for tracking usage and ensuring you're not exceeding API budget. You can adjust the model selection and context size (via For deeper diagnostics, set 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. Iterative Prompt (Structured Interaction)The Iterative Prompt ( Webview LayoutThe prompt webview is a markdown-based editor with the following sections:
Save ButtonThe prompt tab includes a Save button that saves the current prompt content to Iterative Refinement LoopIf DeepSeek's response contains a YAML block with
...the extension prompts for clarifications and restarts, enabling an adjustment loop where you iteratively refine the objective and files until satisfied. 5. Sidebar ExplorerThe DeepSeek Explorer sidebar (activity bar icon) provides a hierarchical view of: Vault Files
Global Vault Files (if configured)
Tags
TODOs
Saved Prompts
6. 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
7. Multi-Vault ArchitectureThe extension supports two vaults simultaneously: Workspace Vault (default)
Global Vault (optional)
Use Cases
8. Configuration ReferenceAll settings are under the Core Settings (
|
| Setting | Type | Default | Description |
|---|---|---|---|
deepseek.mode |
"api" | "local" |
"api" |
Inference mode. |
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.globalVaultPath |
string | "" |
Absolute path to an external global vault. |
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. |
9. Commands Reference
Commands marked with 🔍 are accessible from the F1 command palette. Internal commands are hidden from the palette but work via context menus, sidebar interactions, or programmatic calls.
F1-Accessible Commands
| Command ID | Title | Description |
|---|---|---|
🔍 deepseek.createPrompt |
DeepSeek: Iterative Prompt | Open the prompt webview with context tags, memory files, and DeepSeek submission. |
🔍 deepseek.showLogs |
DeepSeek: Browse Logs | Open the DeepSeek output log channel. |
🔍 deepseek.configureDeepSeek |
DeepSeek: Configure Settings | Open VS Code settings for this extension. |
🔍 deepseek.createVault |
DeepSeek: Create Vault | Initialize a new vault in the workspace. |
Internal Commands (hidden from F1 palette)
| Command ID | Title | Trigger Surface |
|---|---|---|
deepseek.addToPrompt |
Add To Prompt | Explorer right-click, sidebar right-click |
deepseek.sendPromptToDeepSeek |
Send Prompt To DeepSeek | Programmatic (sends prompt webview content to API) |
deepseek.sidebar.refresh |
Refresh Sidebar Explorer | Sidebar toolbar button |
deepseek.sidebar.filter |
Filter Vault Explorer | Sidebar search icon |
deepseek.sidebar.clearFilter |
Clear Vault Explorer Filter | Programmatic |
deepseek.explorerDeleteItem |
Delete | Sidebar item context menu |
deepseek.explorerShowMenu |
More Actions | Sidebar item inline button |
deepseek.openVaultFile |
Open Vault File | Sidebar file click |
deepseek.openTodoItem |
Open Todo File at Line | Sidebar click |
deepseek.openSavedWorkflow |
Open Saved Prompt | Sidebar saved prompt click |
deepseek.saveWorkflowToVault |
Save Prompt to Vault | Sidebar context menu |
deepseek.showTaggedFiles |
Show Tagged Files | Sidebar tag click |
deepseek.api.submitToDeepSeek |
Submit Context to DeepSeek | Programmatic (used by Iterative Prompt send) |
deepseek.api.addRequestText |
Add Request Text to Chat Draft | Programmatic |
10. 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 │ │ Prompt Webview │ │ │
│ │ │(sidebarTree) │ │(prompt-webview) │ │ │
│ │ └─────────────┘ │ .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 Iterative Prompt). 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 Selection — Tags provide explicit, user-controlled context selection for including relevant vault notes in prompts.
Unified Diff Writeback — Code changes are applied via unified diff patches parsed directly from model responses, enabling automated code modification with human oversight.
11. 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
│ ├── vaultManager.ts # Vault file management & frontmatter parsing
│ ├── indexEngine.ts # Tag/id/type index building
│ ├── sidebarTree.ts # DeepSeek Explorer tree provider
│ ├── writebackEngine.ts # Unified diff parser & file patcher
│ ├── promptFile.ts # Prompt markdown file creation & management
│ ├── 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