Labsco
MCP SERVER

Code Reasoning

by mettamatt

Give a coding problem a numbered chain of thoughts that can be revised or branched, with templates for the five moments where that pays off.

Reasoning Scaffolds & Agent Workflow EnginesVerified
Summary
Reasoning you can inspect, correct and branch, rather than a wall of prose.

Revision is the part that changes outcomes: a wrong assumption at thought three can be replaced in place instead of quietly carried through everything after it, and a branch lets two candidate fixes be developed before one is picked. Because the model has to be told to use it, the prompt templates are the reliable entry point — pick bug-analysis or refactoring-plan and the structured pass happens without you having to ask for it in words.

What it is

One tool that structures the model's own reasoning about code. Each call is a single thought carrying its number, an estimate of the total, and whether another is needed — and the estimate is allowed to move as the problem gets clearer.

What you get
  • A numbered chain of thoughts, each one call, with total_thoughts adjustable mid-chain and next_thought_needed set to false only when the reasoning is actually finished
  • Revision in place: is_revision plus revises_thought rewrites an earlier step rather than piling a correction on top of it
  • Branching with branch_from_thought and branch_id, so two approaches can be carried side by side instead of one being abandoned
  • needs_more_thoughts extends a chain that turned out to be longer than it looked
  • A stop at 20 thought steps, so a loop ends rather than running away
  • Five prompt templates for the moments this actually helps: architecture-decision, bug-analysis, code-review, feature-planning and refactoring-plan
  • Every template takes working_directory, so the reasoning is anchored to the project you are in
  • Argument values persist between sessions, so a template you use often does not have to be refilled
Requirements

No account and no key — it reasons, it does not call anything out. It runs as npx -y @mettamatt/code-reasoning, or as the code-reasoning command once installed, with --debug for verbose logging and --config-dir to move the configuration directory. MIT.

Setup effort

One command — npx -y @mettamatt/code-reasoning