DeepSeek Harness: Four Running Modes

Last updated: 2026-08-31

DSH's four running modes are like a car's different driving modes — economy, sport, off-road, track — same car, different personality. Choose the right mode and the Agent behaves exactly as you expect; choose the wrong one and it's either too conservative or runs out of control.

💡 Tip: Standard mode is the default choice, suitable for 80% of scenarios. PTC mode is for tasks requiring precise control. Minimal mode is for pure Q&A. Creative mode is for exploratory work. When in doubt, use Standard mode.

📋 Prerequisites: Completed 04-model-config.md, model configured and available

1. What You'll Learn


Event Dispatch Modes

2. Mode Overview

(1) ▶ Example 1

100%
graph TB
    INPUT[User Input] --> MODE{Select Mode}
    MODE --> STD[Standard Mode<br/>Agent Autonomous Decision]
    MODE --> PTC[PTC Mode<br/>Plan First, Then Execute]
    MODE --> MIN[Minimal Mode<br/>Fewest Tool Calls]
    MODE --> CRE[Creative Mode<br/>Exploratory Output]
    
    STD --> ACTION1[Autonomous Tool Selection<br/>Autonomous Step Decisions]
    PTC --> ACTION2[Output Plan First<br/>Execute After User Confirms]
    MIN --> ACTION3[Prefer Own Knowledge<br/>Call Tools Only When Necessary]
    CRE --> ACTION4[Free Association<br/>Encourage Creativity and Exploration]

(2) One Comparison Table to Understand All Four Modes

Dimension Standard PTC Minimal Creative
Tool Calls Agent decides autonomously Declared in plan Minimized Free to use
User Control Moderate (approval) High (confirm plan) High (few operations) Low (free expression)
Output Certainty Moderate High High Low
Speed Moderate Slower (two-step) Fastest Uncertain
Use Cases General programming Complex tasks Simple Q&A Creative writing
Temperature 0.7 0.3 0.2 1.0+
Token Consumption Moderate Higher Lowest Higher

3. Standard Mode

(1) How It Works

Standard mode is DSH's default mode. After receiving a user instruction, the Agent autonomously analyzes which tools are needed and what operations to execute, following its best judgment:

Standard Mode


🤖 Agent: 
🔍 Using tool: search
  → Searching for src/utils/format.ts

🔍 Using tool: file_edit (read)
  → Reading src/utils/format.ts

📝 Using tool: file_edit (create)
  → Creating src/utils/date-format.ts

📝 Using tool: file_edit (edit)
  → Updating src/utils/format.ts (removing date functions)

📝 Using tool: file_edit (edit)
  → Updating imports in src/index.ts

✅ Done! Date formatting function extracted to src/utils/date-format.ts

(2) Autonomous Decision Logic

In Standard mode, the Agent's decision chain:

100%
graph TD
    INPUT[User Instruction] --> ANALYZE[Analyze Intent]
    ANALYZE --> PLAN[Internal Step Planning]
    PLAN --> DECIDE{Need Tools?}
    DECIDE -->|Yes| EXEC[Call Tools]
    DECIDE -->|No| RESPOND[Reply Directly]
    EXEC --> CHECK{Done?}
    CHECK -->|No| PLAN
    CHECK -->|Yes| RESPOND

(3) When to Use Standard Mode


4. PTC Mode (Plan-then-Code)

(1) How It Works

PTC mode divides Agent behavior into two steps:

PTC Mode

  1. Plan Phase: The Agent analyzes the task and outputs a detailed plan without executing any operations
  2. Code Phase: After the user confirms the plan, the Agent executes it step by step
TEXT 📖 Display only
👤 Bob: Add a user authentication system to the project, supporting JWT

🤖 Agent (Plan Phase):
📋 Execution Plan:
  1. Install dependencies: jsonwebtoken, bcryptjs
  2. Create src/auth/jwt.ts — JWT signing and verification
  3. Create src/auth/middleware.ts — Authentication middleware
  4. Create src/routes/auth.ts — Login/register routes
  5. Modify src/app.ts — Register routes and middleware
  6. Add environment variable JWT_SECRET

Estimated: 5 files modified, 3 files created.
Execute this plan?

👤 Bob: Execute, but skip step 1 — dependencies are already installed

🤖 Agent (Code Phase):
📝 Step 2: Creating src/auth/jwt.ts...
📝 Step 3: Creating src/auth/middleware.ts...
📝 Step 4: Creating src/routes/auth.ts...
📝 Step 5: Editing src/app.ts...
📝 Step 6: Adding JWT_SECRET to .env.example...

✅ Authentication system added!

(2) PTC Plan Format

PTC mode outputs plans containing:

TYPESCRIPT
interface PTCPlan {
  steps: PlanStep[];
  estimatedFiles: { created: number; modified: number; deleted: number };
  riskLevel: 'low' | 'medium' | 'high';
  reversible: boolean;
}

interface PlanStep {
  id: number;
  description: string;
  tool: string;           // Tool to use
  files: string[];        // Files involved
  dependsOn: number[];    // Prerequisite steps
}

(3) ▶ Example 3

100%
graph TD
    INPUT[User Instruction] --> PLAN[Agent Outputs Plan]
    PLAN --> REVIEW[User Reviews Plan]
    REVIEW -->|Confirm| EXEC[Agent Executes]
    REVIEW -->|Modify| MODIFY[User Modifies Plan]
    MODIFY --> EXEC
    REVIEW -->|Reject| CANCEL[Cancel Execution]
    EXEC --> STEP[Step-by-step Execution]
    STEP --> DONE{All Complete?}
    DONE -->|No| STEP
    DONE -->|Yes| RESULT[Output Results]

(4) When to Use PTC Mode


5. Minimal Mode

(1) How It Works

In Minimal mode, the Agent minimizes tool calls, preferring to answer questions using its own knowledge:

Minimal Mode

TEXT 📖 Display only

🤖 Agent: 
Promise is an object representation of async operations; async/await is syntactic sugar for Promises:

1. Promise uses .then() chaining:
   fetchData().then(data => process(data)).catch(err => handle(err));

2. async/await uses synchronous-looking syntax:
   const data = await fetchData();
   process(data);

Key differences:
- Promise is an object; async/await is syntax
- await can only be used inside async functions
- async functions always return Promises
- Error handling: .catch() vs try/catch

Note: The Agent didn't call any tools — it answered directly from knowledge.

(2) ▶ Example 2

100%
graph TD
    INPUT[User Instruction] --> EVAL{Can answer from knowledge?}
    EVAL -->|Yes| RESPOND[Reply Directly]
    EVAL -->|No| TOOL[Call Minimal Necessary Tools]
    TOOL --> RESPOND

(3) Minimal Mode vs. Standard Mode Comparison

Scenario Standard Mode Minimal Mode
"What is a closure?" Might search for closure examples in the project Directly explains the concept
"Write a sort function" First searches project code style, then writes Directly writes a general implementation
"How to fix this bug?" Reads files, searches related code Gives a general solution first; reads files only if user asks

(4) When to Use Minimal Mode


6. Creative Mode

(1) How It Works

Creative mode gives the Agent the highest freedom, encouraging exploratory and creative output:

TEXT 📖 Display only
👤 Alice: Design a unique 404 page for me

🤖 Agent: 
🎨 I'll design an interactive 404 page — using Canvas to draw an asteroid field where users can move the mouse to dodge meteors!

📝 Using tool: file_edit (create)
  → Creating src/pages/404.html

🎨 Features:
- Canvas-rendered dynamic starfield background
- Mouse-controlled spaceship movement
- Random meteor generation and collision detection
- Increasing difficulty over time
- After collision, shows "You found 404!" and redirects to home

🔧 Additional ideas:
- Add sound effects using Web Audio API
- Mobile touch support
- Score leaderboard (localStorage)

(2) Creative Mode Characteristics

Characteristic Description
High Temperature More random, more diverse output
Free Association Proactively offers additional suggestions and ideas
Beyond Instructions Thinks beyond the scope of the user's request
Encourages Exploration Tries unconventional approaches
Longer Output Usually produces more content than other modes

(3) Applicable Scenarios for Creative Mode

100%
graph LR
    A[Creative Writing] --> CRE[Creative Mode]
    B[UI/UX Design] --> CRE
    C[Brainstorming] --> CRE
    D[Prototype Exploration] --> CRE
    E[Learning New Frameworks] --> CRE

(4) Creative Mode Caveats


7. Mode Switching and Combination

(1) Switching Methods

Web UI Switching:

TEXT 📖 Display only
Top control bar → Mode dropdown → Select target mode

CLI Switching:

BASH
# Specify at startup
npx @deepseek-ai/dsh cli --mode ptc

# Switch during session
/mode creative

Default Mode in Configuration:

YAML
# dsh.config.yaml
default_mode: ptc

(2) Mode Combination Strategy

In practice, different phases can use different modes:

TEXT 📖 Display only
Project Planning Phase → PTC Mode (plan first)
  ↓
Implementation Phase → Standard Mode (autonomous execution)
  ↓
Troubleshooting → Minimal Mode (quick Q&A)
  ↓
UI Design → Creative Mode (explore ideas)

(3) Best Mode-Model Combinations

Task Recommended Mode Recommended Model Reason
Code writing Standard deepseek-coder Code model + autonomous decision
Complex refactoring PTC deepseek-reasoner Reasoning model + plan confirmation
Technical Q&A Minimal deepseek-chat General model + quick answers
Creative design Creative gpt-4o High creativity + diverse output
Bug debugging Standard deepseek-coder Code understanding + tool usage

8. Mode Implementation Principles

(1) Mode Configuration Structure

TYPESCRIPT
interface ModeConfig {
  name: string;
  allowTools: boolean;
  requirePlan: boolean;
  temperature: number;
  maxToolCalls: number | null;
  systemPromptExtra: string;
}

const MODES: Record<string, ModeConfig> = {
  standard: {
    name: 'standard',
    allowTools: true,
    requirePlan: false,
    temperature: 0.7,
    maxToolCalls: null,
    systemPromptExtra: 'You have full autonomy to use tools as needed.'
  },
  ptc: {
    name: 'ptc',
    allowTools: true,
    requirePlan: true,
    temperature: 0.3,
    maxToolCalls: null,
    systemPromptExtra: 'Always create a plan first. Do not execute until the user confirms.'
  },
  minimal: {
    name: 'minimal',
    allowTools: true,
    requirePlan: false,
    temperature: 0.2,
    maxToolCalls: 1,
    systemPromptExtra: 'Minimize tool usage. Prefer answering from knowledge.'
  },
  creative: {
    name: 'creative',
    allowTools: true,
    requirePlan: false,
    temperature: 1.0,
    maxToolCalls: null,
    systemPromptExtra: 'Be creative, explore unusual approaches, think beyond the obvious.'
  }
};

(2) How Modes Affect System Prompt

Each mode appends additional instructions at the end of the System Prompt to guide Agent behavior:

TEXT 📖 Display only
Standard mode appends:
"Use tools freely when they help accomplish the task."

PTC mode appends:
"Before any action, output a numbered plan. Wait for user confirmation before executing."

Minimal mode appends:
"Answer from your knowledge first. Only use tools when absolutely necessary."

Creative mode appends:
"Think creatively and explore novel approaches. Offer additional ideas beyond the request."

❓ FAQ

Q Which mode saves the most tokens?
A Minimal mode — fewest tool calls, most concise output. PTC mode costs the most tokens (plan + execution two-step output).
Q Can I modify the PTC mode plan?
A Yes. You can delete, modify, or reorder steps in the plan, or tell the Agent "skip step 3."
Q Will Creative mode write unsafe code?
A Possibly. Creative mode encourages exploration and may use unconventional approaches. For security-sensitive tasks, Creative mode is not recommended.
Q Is the Agent's decision-making in Standard mode predictable?
A Mostly predictable — the same input usually produces similar tool call sequences. However, LLM output has inherent randomness and is not fully deterministic.
Q Can I switch modes within the same session?
A Yes. Mode switching takes effect immediately and doesn't affect existing conversation history. Subsequent messages will follow the new mode's behavior rules.
Q Does Minimal mode completely avoid using tools?
A Not completely — it minimizes tool usage. If a question truly requires reading files or executing commands, the Agent will still call tools, but far less frequently than Standard mode.

📖 Summary


📝 Exercises

1. ⭐ Basic: Ask the Agent the same question in all four modes: "Write a quicksort function," and compare the output differences (tool call count, output length, code style).

2. ⭐⭐ Intermediate: Use PTC mode to complete a 5+ step task (e.g., "Add a logging system to the project"). Record the Agent's plan content, manually modify the plan (delete or adjust steps), and observe the execution results.

3. ⭐⭐⭐ Challenge: Design a "mode combination plan" — select the most appropriate mode for each phase of a complete Web development project (from design to deployment), and use a Mermaid flowchart to show mode switching timing and reasons.

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏