// how to

How to Code With DeepSeek: Chat, Coding Agents and Harness

For small jobs, paste the code and the exact error into the DeepSeek chat with DeepThink on. For work across a whole project, connect a coding agent such as Claude Code, OpenCode or Codex to the DeepSeek API, or try DeepSeek’s own desktop app, DeepSeek Harness. Review and test every change before you ship it.

By Published Last updated 2 min read

The short version

There are three ways to code with DeepSeek: the chat, a coding agent running on the DeepSeek API, or DeepSeek Harness. Start with the chat. Move to an agent when you’re tired of copying code back and forth.

Step by step

1. In the chat (no setup)

  1. Turn on DeepThink. Bugs and design choices benefit from step-by-step reasoning.
  2. Paste the relevant code, the full error message and what you expected to happen.
  3. Say your language, framework and versions.
  4. Ask for the smallest change that fixes the problem, with an explanation.

2. In a coding agent (API key needed)

DeepSeek’s API docs include setup guides for Claude Code, Codex, OpenCode, OpenClaw, Qoder and others. For Claude Code, you point it at DeepSeek’s Anthropic-compatible address with environment variables:

text
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]

DeepSeek’s guide sets a few more variables; copy the full list from its page. See use DeepSeek in Claude Code and other tools.

3. In DeepSeek Harness (desktop)

Download it from deepseek.com for macOS (Apple silicon, macOS 13 or later) or Windows. It’s in public preview and open source.

Prompts to copy

Fix a bug:

text
This [language/framework, version] code throws the error below.
Explain the cause in two sentences, then give the smallest fix. Don't change anything else.
Code: [paste]
Error: [paste full error]

Write a function with tests:

text
Write a [language] function that [does X]. Inputs: [describe]. Output: [describe].
Handle empty input and invalid values. Include 5 unit tests, one for each edge case.

Review before you merge:

text
Review this diff for bugs, security problems and missing error handling.
List issues by severity, with the line and a suggested fix. Don't rewrite the whole file.
[paste diff]

Example

You paste: a Python script that crashes with KeyError: 'email' when reading a CSV export.

A good result: DeepSeek explains that some rows have no email column value, suggests reading with .get() or skipping those rows, and asks which you prefer. You test it on the real file before relying on it.

Mistakes to avoid

  • Pasting secrets. Remove API keys, passwords and connection strings before you paste code into the chat.
  • Pasting your company’s code into the app without permission. DeepSeek’s privacy policy says inputs are stored in China. Check your employer’s rules first.
  • Shipping without review. Read and test what it wrote. Our guide to reviewing AI-written code has a checklist.
  • Giving an agent free rein. Start agents in a test branch, and approve commands before they run.

Good to know

For agent work, tell the tool about your project in a file it reads at startup; our AGENTS.md generator makes one. To compare DeepSeek-powered setups with other tools, see AI coding assistants compared and set up an AI coding assistant.

Related: use the DeepSeek API and use DeepSeek in Claude Code and other tools.

Frequently asked questions

Which DeepSeek model should I use for code?

On the API, DeepSeek's docs use deepseek-flash in their coding-agent setups. DeepSeek says its October 2026 Flash update was optimized for DeepSeek Harness and coding tools, with stronger project development.

What is DeepSeek Harness?

DeepSeek's open-source agent app for macOS (Apple silicon) and Windows, in public preview. DeepSeek says it can explore code repositories, fix bugs, build features and run tests, as well as handle documents and data.

Sources

  1. DeepSeek API Docs: integrate with Claude Code
  2. DeepSeek API Docs: DeepSeek-V4.1-Flash-1017 release note
  3. DeepSeek Harness
  4. DeepSeek API Docs: thinking mode