Solve complex problems by switching between four cognitive mindsets (Spatial, Convergent, Divergent, Algorithmic) at each reasoning step, adapting the thinking mode to what the current sub-problem actually needs. Use when asked to: 'reason through this step by step', 'solve this hard problem', 'think carefully about this', 'use chain of mindset', 'adaptive reasoning', 'multi-step problem solving'.
Chain of Mindset (CoM) enables Claude to solve complex problems by dynamically switching between four distinct cognitive modes at each reasoning step, rather than applying one uniform thinking style throughout. Inspired by how humans naturally shift between visualization, focused analysis, brainstorming, and computation when tackling hard problems, CoM decomposes reasoning into Spatial (visualize structure), Convergent (deep focused logic), Divergent (parallel exploration of alternatives), and Algorithmic (precise code-based computation) mindsets. A meta-cognitive selection step before each reasoning phase picks the mode best suited to the current sub-problem, and a context-gating discipline filters what information flows between steps to prevent context pollution.
The core insight: Different stages within a single problem demand fundamentally different cognitive modes. A geometry proof might start with spatial visualization, shift to divergent exploration of proof strategies, then converge on one via focused logic, and finally verify with algorithmic computation. Existing chain-of-thought methods apply one fixed mode throughout, which is like trying to hammer every stage of carpentry with the same tool.
The four mindsets serve distinct functions. The Spatial mindset transforms abstract relationships into structural representations -- ASCII diagrams, dependency graphs, state machines, data flow sketches. The Convergent mindset performs deep, focused logical analysis grounded in established facts, following one thread to its conclusion without branching. The Divergent mindset generates 2-5 parallel solution branches when uncertainty is high, exploring each independently before selecting the most promising path. The Algorithmic mindset handles precise computation via code execution -- calculations, simulations, data transformations -- using a generate-execute-repair loop.
The meta-cognitive step is what makes this adaptive rather than scripted. Before each reasoning phase, evaluate the current state: What does the problem need right now? If you're stuck on understanding the structure, switch to Spatial. If you have too many possibilities, switch to Convergent to narrow down. If you're stuck in a rut, switch to Divergent. If you need exact numbers, switch to Algorithmic. The context gate discipline means each mindset receives only the relevant subset of prior reasoning, and its output is distilled to its essential insight before being carried forward.
Read the full problem and classify its domains. Identify which cognitive demands are present: structural/spatial understanding, logical deduction, creative exploration, or precise computation. Most hard problems involve at least two.
Select the initial mindset based on the problem's entry point. If the problem presents a structure to understand (architecture, graph, geometry), start with Spatial. If it presents a clear logical chain to follow, start with Convergent. If the approach is unclear, start with Divergent. If it's primarily computational, start with Algorithmic.
Execute the chosen mindset with filtered context. Work within that mode using only the information relevant to the current sub-task. For Spatial: produce a concrete structural representation (ASCII diagram, bullet-point graph, state table). For Convergent: follow a single logical thread step by step to a conclusion. For Divergent: generate 2-5 distinct approaches, briefly analyze each, then select the most promising. For Algorithmic: write and mentally execute code or formal computation.
Distill the output into a concise insight. After completing a mindset phase, extract the key finding in 1-3 sentences. This is what carries forward -- not the full reasoning trace. This prevents context bloat and keeps subsequent steps focused.
Re-evaluate: select the next mindset based on what you now know. Ask: "Given what I just learned, what does the problem need next?" This is the critical adaptive step. Do not default to the same mode. Explicitly justify why the next mode is appropriate.
Repeat the mindset-execute-distill-select cycle until the problem reaches a solution or a termination condition (answer found, all branches exhausted, computation verified).
Cross-verify the solution using a different mindset than the one that produced it. If you arrived at the answer via Convergent logic, verify with Algorithmic computation. If via Divergent exploration, verify with Convergent focused analysis. This catches mode-specific blind spots.
Synthesize the final answer by integrating insights from all phases, presenting the solution with clear reasoning and appropriate confidence level.
Example 1: Debugging a Race Condition
User: "Our API sometimes returns stale data. The endpoint reads from a cache that's updated by a background worker. It happens under load but we can't reproduce it consistently."
Approach:
Spatial -- Map the data flow: Request -> Cache Read -> Response, alongside Worker -> DB Read -> Cache Write. Draw the timing diagram to identify where reads and writes can interleave.
Divergent -- Generate hypotheses: (a) Cache read-write is not atomic, (b) Worker has no lock and two instances run concurrently, (c) Cache TTL causes reads of expired-but-not-yet-refreshed entries, (d) Network delay causes worker writes to arrive out of order.
Convergent -- Focus on hypothesis (b): If the worker is triggered by a cron/interval and the previous run hasn't finished, two workers read DB at different times, then write to cache in unpredictable order. The slower worker overwrites the faster one's newer data.
Algorithmic -- Produce the fix: Add a distributed lock (e.g., Redis SETNX) around the worker's read-write cycle, or use a single-flight pattern.
Output:
Root cause: Your background worker lacks mutual exclusion. Under load, overlapping
worker executions read the DB at different times and write to cache in
unpredictable order, causing stale overwrites.
Fix: Wrap the worker's cache-update cycle in a distributed lock:
async function refreshCache() {
const acquired = await redis.set('cache-lock', '1', 'NX', 'EX', 30);
if (!acquired) return; // another worker is already running
try {
const data = await db.query('SELECT ...');
await redis.set('cache-key', JSON.stringify(data));
} finally {
await redis.del('cache-lock');
}
}
Alternatively, use a single-flight/coalescing pattern if you want waiting
workers to receive the result of the in-progress refresh rather than skipping.
Example 2: Designing a Rate Limiter
User: "Implement a rate limiter that allows 100 requests per minute per user, with smooth distribution (not bursty)."
Approach:
Divergent -- Explore algorithms: (a) Fixed window counter, (b) Sliding window log, (c) Sliding window counter, (d) Token bucket, (e) Leaky bucket. Evaluate each against "smooth distribution" requirement.
Convergent -- Analyze leaky bucket: Requests enter a queue processed at a fixed rate (100/60s = 1 request per 0.6s). Excess requests are rejected. This guarantees even distribution.
Algorithmic -- Implement the solution:
Output:
import time
from collections import defaultdict
import threading
class LeakyBucketRateLimiter:
def __init__(self, capacity: int = 100, rate_per_second: float = 100 / 60):
self.capacity = capacity
self.rate = rate_per_second # requests drained per second
self._buckets: dict[str, dict] = defaultdict(
lambda: {"water": 0.0, "last_check": time.monotonic()}
)
self._lock = threading.Lock()
def allow(self, user_id: str) -> bool:
with self._lock:
bucket = self._buckets[user_id]
now = time.monotonic()
elapsed = now - bucket["last_check"]
bucket["last_check"] = now
# Drain water based on elapsed time
bucket["water"] = max(0.0, bucket["water"] - elapsed * self.rate)
if bucket["water"] < self.capacity:
bucket["water"] += 1.0
return True
return False
Example 3: Understanding a Complex Algorithm
User: "Explain how this recursive function works and whether it's correct for finding all valid parentheses combinations."
Approach:
Spatial -- Trace the recursion tree for n=2: draw the branching structure showing how open/close counts evolve at each node, marking valid leaves.
Convergent -- Verify the pruning conditions are both necessary and sufficient: (a) open <= n prevents excess opens, (b) close <= open ensures validity at every prefix. Together they generate exactly the Catalan(n) valid strings.
close <= open <= n at every recursion point is both necessary and sufficient for generating all and only valid combinations.Algorithmic -- Verify by counting: for n=3, the function should produce exactly C(3) = 5 results. Enumerate them mentally: ((())), (()()), (())(), ()(()), ()()().
Do:
Avoid:
Chain of Mindset: Reasoning with Adaptive Cognitive Modes -- Jiang et al., 2026. See Section 3 for the formal mindset definitions and Meta-Agent selection policy, and Section 4 for ablation studies showing the Context Gate contributes 8.24% accuracy and Divergent mode is critical for mathematical reasoning (16.66% drop on AIME when removed).3c:["$","$L46",null,{"content":"$47","frontMatter":{"name":"chain-mindset-reasoning-adaptive","description":"Solve complex problems by switching between four cognitive mindsets (Spatial, Convergent, Divergent, Algorithmic) at each reasoning step, adapting the thinking mode to what the current sub-problem actually needs. Use when asked to: 'reason through this step by step', 'solve this hard problem', 'think carefully about this', 'use chain of mindset', 'adaptive reasoning', 'multi-step problem solving'."}}]