
Security News
Rolldown Pulls Rust React Compiler Integration After Binary Size Increase
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.
@feniix/pi-code-reasoning
Advanced tools
Code Reasoning tools for pi and MCP — reflective sequential thinking with branching and revision support
Code Reasoning tools for pi and MCP — reflective problem-solving through sequential thinking with branching and revision support.
Based on the MCP server by Matt Westgate, this package defines its tools once with BridgeKit and exposes the same implementation through both pi and MCP adapters.
pi install npm:@feniix/pi-code-reasoning
Ephemeral (one-off) use:
pi -e npm:@feniix/pi-code-reasoning
Run the stdio MCP server with npx:
npx -y @feniix/pi-code-reasoning
Example MCP client configuration:
{
"mcpServers": {
"code-reasoning": {
"command": "npx",
"args": ["-y", "@feniix/pi-code-reasoning"]
}
}
}
Use the MCP adapter entrypoint when wiring the same tools into a custom host:
import { createMcpServerOptions, runServer } from "@feniix/pi-code-reasoning/mcp";
// For tests or custom hosts:
const options = createMcpServerOptions();
// For a stdio MCP server entrypoint:
await runServer();
The shared portable tool definitions are available from @feniix/pi-code-reasoning/tools for advanced adapters.
| Entry point | Purpose |
|---|---|
@feniix/pi-code-reasoning/mcp | compiled MCP server helpers |
@feniix/pi-code-reasoning/tools | compiled BridgeKit portable tools |
@feniix/pi-code-reasoning/extensions/* | compiled compatibility deep imports for extension internals |
The pi extension entrypoint remains source-loaded through the package pi.extensions metadata.
code_reasoningRecord and process a thought with metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
thought | string | yes | Your reasoning content |
thought_number | integer | yes | Position in sequence |
total_thoughts | integer | yes | Estimated total thoughts |
next_thought_needed | boolean | yes | Set FALSE when done |
is_revision | boolean | no | When correcting earlier thought (🔄) |
revises_thought | integer | no | Which thought# you're revising |
branch_from_thought | integer | no | When exploring alternatives (🌿) |
branch_id | string | no | Identifier for the branch |
needs_more_thoughts | boolean | no | If more thoughts needed |
piMaxBytes | integer | no | Per-call output byte limit, clamped by configured max |
piMaxLines | integer | no | Per-call output line limit, clamped by configured max |
code_reasoning_statusGet current session status: branches and thought count.
Optional parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
piMaxBytes | integer | no | Per-call output byte limit, clamped by configured max |
piMaxLines | integer | no | Per-call output line limit, clamped by configured max |
code_reasoning_resetReset the session, clearing all thoughts and branches.
{
"thought": "Initial exploration of the problem...",
"thought_number": 1,
"total_thoughts": 5,
"next_thought_needed": true
}
{
"thought": "Exploring alternative approach...",
"thought_number": 3,
"total_thoughts": 7,
"next_thought_needed": true,
"branch_from_thought": 2,
"branch_id": "alternative-algo-x"
}
{
"thought": "Revisiting earlier point: Assumption Y was flawed...",
"thought_number": 4,
"total_thoughts": 6,
"next_thought_needed": true,
"is_revision": true,
"revises_thought": 2
}
CLI flags apply when running as a pi extension:
pi --code-reasoning-max-bytes=102400 --code-reasoning-max-lines=5000
Environment variables apply to both pi and MCP runtimes:
export CODE_REASONING_MAX_BYTES=102400
export CODE_REASONING_MAX_LINES=5000
export CODE_REASONING_CONFIG_FILE=/path/to/code-reasoning.json
Use pi's standard settings locations for non-secret configuration:
.pi/settings.json~/.pi/agent/settings.jsonUnder the pi-code-reasoning key:
{
"pi-code-reasoning": {
"maxBytes": 51200,
"maxLines": 2000
}
}
Best practice: use
settings.jsonfor non-secret defaults only. If you need a separate private override file, use--code-reasoning-config-fileorCODE_REASONING_CONFIG_FILEto point to a custom JSON config file. Legacy aliases--code-reasoning-configandCODE_REASONING_CONFIGare still accepted but deprecated.
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--code-reasoning-config-file | CODE_REASONING_CONFIG_FILE | — | Custom JSON config file path (overrides settings.json lookup) |
--code-reasoning-config | CODE_REASONING_CONFIG | — | Deprecated alias for the config file path |
--code-reasoning-max-bytes | CODE_REASONING_MAX_BYTES | 51200 | Max output bytes |
--code-reasoning-max-lines | CODE_REASONING_MAX_LINES | 2000 | Max output lines |
Build the compiled MCP entrypoint locally:
npm run build:mcp --workspace packages/pi-code-reasoning
Run the built stdio server directly:
node packages/pi-code-reasoning/dist/extensions/mcp-server.js
MIT
FAQs
Code Reasoning tools for pi and MCP — reflective sequential thinking with branching and revision support
The npm package @feniix/pi-code-reasoning receives a total of 47 weekly downloads. As such, @feniix/pi-code-reasoning popularity was classified as not popular.
We found that @feniix/pi-code-reasoning demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.