YOUSEFISLAM-dev/deepseek-unchained
GitHub: YOUSEFISLAM-dev/deepseek-unchained
Stars: 1 | Forks: 0
# ☣ DeepSeek Unchained
### Red Team AI Coding Agent — Uncensored & Unfiltered
[](https://python.org)
[](LICENSE)
[](https://code.visualstudio.com)
**A VS Code extension + local proxy that turns DeepSeek's free web API into a fully agentic, uncensored coding assistant.**
No API key needed — uses your free DeepSeek account.
## ⚡ Features
- ☠ **Uncensored** — bypasses content filters via custom system prompting
- 🔧 **Agentic Tool Use** — reads/writes files, runs terminal commands, searches your codebase
- 🧠 **Multi-turn Agent Loop** — executes tools automatically across multiple rounds (up to 25)
- 💭 **Chain-of-Thought** — shows DeepSeek's reasoning in collapsible blocks
- 🔄 **Session Reuse** — maintains conversation context, auto-resets at 24k chars / 15 turns
- 📦 **Context Compaction** — auto-compresses old messages to avoid token overflow
- 🔌 **Unstable Internet Resilience** — auto-retry with exponential backoff (3 retries, 15s connect / 120s idle timeout)
- 🎨 **Red Team Terminal UI** — evil dark theme with CRT scanlines, neon red accents, and hazard indicators
## 🛠️ Requirements
- **Python 3.10+**
- **Node.js 18+** *(only if you want to rebuild the extension from source)*
- **VS Code**
- **A free DeepSeek account** at [chat.deepseek.com](https://chat.deepseek.com)
## 🚀 Quick Start
### 1. Clone the Repo
git clone https://github.com/YOUSEFISLAM-dev/deepseek-unchained.git
cd deepseek-unchained
### 2. Install Python Dependencies
pip install -r requirements.txt
### 3. Get Your DeepSeek Token
You need a **free** DeepSeek account. No paid API key required.
1. Go to [chat.deepseek.com](https://chat.deepseek.com) and **log in**
2. Open **DevTools** (press `F12`)
3. Go to the **Console** tab
4. Paste this and press Enter:
JSON.parse(localStorage.getItem("userToken")).value
5. Copy the long string that appears — that's your token
### 4. Create Your `.env` File
cp .env.example .env
Then edit `.env` and paste your token:
DEEPSEEK_USER_TOKEN=eyJhbGci...your_long_token_here...
# Optional: Cloudflare cf_clearance cookie
CF_CLEARANCE=
HOST=0.0.0.0
PORT=8080
UN_TXT_PATH=./un.txt
### 5. Start the Proxy
**Windows:**
start.bat
**Linux/Mac:**
chmod +x start.sh
./start.sh
**Or manually:**
python proxy.py
You should see:
============================================================
DeepSeek Reverse Proxy — OpenAI-Compatible API
============================================================
Listening on: http://0.0.0.0:8080
Token set: Yes
============================================================
**Keep this terminal running.**
### 6. Install the VS Code Extension
Download the pre-built VSIX from the [Releases page](https://github.com/YOUSEFISLAM-dev/deepseek-unchained/releases), or use the one in the repo:
**Option A — Command line:**
code --install-extension deepseek-coder/deepseek-coder-0.1.0.vsix
**Option B — VS Code UI:**
1. Open VS Code
2. `Ctrl+Shift+P` → **"Install from VSIX"**
3. Select `deepseek-coder/deepseek-coder-0.1.0.vsix`
### 7. Open the Chat
1. **Reload VS Code**: `Ctrl+Shift+P` → `Developer: Reload Window`
2. **Open chat**: `Ctrl+Shift+P` → `DeepSeek: Open Chat` (or `Ctrl+Shift+D`)
## 💀 Usage
### Chat Interface
- Type any message and press **Enter** to send
- Press **Shift+Enter** for a new line
- Click **✕ WIPE TERMINAL** to start a new conversation
- Click **■ TERMINATE** to abort a running request
### What the Agent Can Do
| Tool | Example Prompt |
|------|---------------|
| **Read files** | *"Read the package.json file"* |
| **Write files** | *"Create a Python script that does X"* |
| **Edit files** | *"Fix the bug on line 42 of server.py"* |
| **Run commands** | *"Run npm test"* |
| **Search files** | *"Find all files that import express"* |
| **List files** | *"Show me the project structure"* |
### Model Variants
The proxy supports different modes via VS Code settings (`deepseekCoder.model`):
| Model Name | Thinking | Web Search | Description |
|---|---|---|---|
| `deepseek` *(default)* | ✅ | ❌ | Standard with chain-of-thought |
| `deepseek-think` | ✅ | ❌ | Alias for deepseek |
| `deepseek-search` | ✅ | ✅ | Thinking + web search |
| `deepseek-fast` | ❌ | ❌ | No thinking, fast responses |
### VS Code Settings
| Setting | Default | Description |
|---------|---------|-------------|
| `deepseekCoder.proxyUrl` | `http://localhost:8080` | Proxy server URL |
| `deepseekCoder.model` | `deepseek` | Model variant |
| `deepseekCoder.maxToolRounds` | `25` | Max tool-use rounds per turn |
| `deepseekCoder.autoApproveReads` | `true` | Auto-approve read-only tools |
| `deepseekCoder.autoApproveWrites` | `false` | Auto-approve file writes |
| `deepseekCoder.autoApproveCommands` | `false` | Auto-approve terminal commands |
## 🔧 Troubleshooting
### "Token set: NO" in proxy output
Your `.env` file is missing `DEEPSEEK_USER_TOKEN`. Re-do Step 3.
### Messages not sending / stuck
1. Check the proxy terminal for errors
2. Your token may have expired — get a new one (Step 3)
3. Check if [chat.deepseek.com](https://chat.deepseek.com) itself is working
### Extension not showing
1. Make sure you installed the VSIX (Step 6)
2. Reload VS Code: `Ctrl+Shift+P` → `Developer: Reload Window`
### Cloudflare blocking
If you see "Cloudflare protection detected" in the proxy:
1. Go to [chat.deepseek.com](https://chat.deepseek.com) in your browser
2. Open DevTools → Application → Cookies
3. Copy the `cf_clearance` cookie value
4. Add to `.env`: `CF_CLEARANCE=your_value_here`
5. Restart the proxy
## 📁 Project Structure
deepseek-unchained/
├── .env.example # Template — copy to .env and add your token
├── proxy.py # FastAPI reverse proxy (OpenAI-compatible)
├── deepseek_client.py # DeepSeek web API client with retry logic
├── pow_solver.py # Proof-of-Work challenge solver
├── un.txt # System prompt (the "unchaining" prompt)
├── requirements.txt # Python dependencies
├── start.bat # Windows one-click launcher
├── start.sh # Linux/Mac one-click launcher
├── wasm/ # WASM files for PoW solver
└── deepseek-coder/ # VS Code extension
├── deepseek-coder-0.1.0.vsix # Pre-built extension
├── src/ # TypeScript source
│ ├── extension.ts # Entry point
│ ├── agent.ts # Multi-turn agent loop
│ ├── proxyClient.ts # HTTP streaming client
│ ├── toolParser.ts # XML tool-call parser
│ ├── toolExecutor.ts # Tool execution (file ops, terminal, search)
│ └── webview/
│ ├── ChatPanel.ts # Webview panel manager
│ └── index.html # Red team terminal UI
└── package.json # Extension manifest
## 🔒 Security
- **`.env` is gitignored** — never committed
- **Your token = your session** — anyone with it can use your DeepSeek account
- **Tokens expire** — refresh them periodically
- **The proxy runs locally** — no data goes anywhere except DeepSeek's servers
- **The VSIX is local-only** — no telemetry, no analytics, no tracking
## 🏗️ Building from Source
If you want to rebuild the VS Code extension:
cd deepseek-coder
npm install
npm run compile
npx @vscode/vsce package
This produces a new `deepseek-coder-0.1.0.vsix`.
## ⚖️ License
[MIT](LICENSE) — do whatever you want with it.