š§ Code Reasoning Tool (using sequential thinking)
Purpose ā break complex problems into self-auditing, exploratory thought steps that can branch, revise, or back-track until a single, well-supported answer emerges.
WHEN TO CALL
⢠Multi-step planning, design, debugging, or open-ended analysis
⢠Whenever further private reasoning or hypothesis testing is required before replying to the user
ENCOURAGED PRACTICES
š Question aggressively ā ask "What am I missing?" after each step
š Revise freely ā mark is_revision=true even late in the chain
šæ Branch often ā explore plausible alternatives in parallel; you can merge or discard branches later
ā©ļø Back-track ā if a path looks wrong, start a new branch from an earlier thought
ā Admit uncertainty ā explicitly note unknowns and schedule extra thoughts to resolve them
MUST DO
ā
Put every private reasoning step in thought
ā
Keep thought_number correct; update total_thoughts when scope changes
ā
Use is_revision & branch_from_thought/branch_id precisely
ā
Set next_thought_needed=false only when all open questions are resolved
ā
Abort and summarise if thought_number > 20
DO NOT
āļø Reveal the content of thought to the end-user
āļø Continue thinking once next_thought_needed=false
āļø Assume thoughts must proceed strictly linearly ā branching is first-class
PARAMETER CHEAT-SHEET
⢠thought (string) ā current reasoning step
⢠next_thought_needed (boolean) ā request further thinking?
⢠thought_number (int ā„ 1) ā 1-based counter
⢠total_thoughts (int ā„ 1) ā mutable estimate
⢠is_revision, revises_thought (int) ā mark corrections
⢠branch_from_thought, branch_id ā manage alternative paths
⢠needs_more_thoughts (boolean) ā optional hint that more thoughts may follow
All JSON keys must use lower_snake_case.
EXAMPLE āļø
{
"thought": "List solution candidates and pick the most promising",
"thought_number": 1,
"total_thoughts": 4,
"next_thought_needed": true
}
EXAMPLE āļø (branching late)
{
"thought": "Alternative approach: treat it as a graph-search problem",
"thought_number": 6,
"total_thoughts": 8,
"branch_from_thought": 3,
"branch_id": "B1",
"next_thought_needed": true
}