🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@feniix/pi-code-reasoning

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feniix/pi-code-reasoning

Code Reasoning extension for pi — reflective problem-solving through sequential thinking with branching and revision support

Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
47
-20.34%
Maintainers
1
Weekly downloads
 
Created
Source

@feniix/pi-code-reasoning

Code Reasoning extension for pi — reflective problem-solving through sequential thinking with branching and revision support.

Based on the MCP server by Matt Westgate, this native TypeScript extension provides structured thinking tools without external dependencies.

Features

  • Sequential Thinking — Break down complex problems into structured, revisable steps
  • Branching — Explore alternative approaches from any thought (🌿)
  • Revision — Correct earlier thinking when new insights emerge (🔄)
  • Progress Tracking — Track thought count and branches
  • Configurable Output — Client-side byte and line truncation

Install

pi install npm:@feniix/pi-code-reasoning

Ephemeral (one-off) use:

pi -e npm:@feniix/pi-code-reasoning

Tools

code_reasoning

Record and process a thought with metadata.

ParameterTypeRequiredDescription
thoughtstringyesYour reasoning content
thought_numberintegeryesPosition in sequence
total_thoughtsintegeryesEstimated total thoughts
next_thought_neededbooleanyesSet FALSE when done
is_revisionbooleannoWhen correcting earlier thought (🔄)
revises_thoughtintegernoWhich thought# you're revising
branch_from_thoughtintegernoWhen exploring alternatives (🌿)
branch_idstringnoIdentifier for the branch
needs_more_thoughtsbooleannoIf more thoughts needed

code_reasoning_status

Get current session status: branches and thought count.

code_reasoning_reset

Reset the session, clearing all thoughts and branches.

Thinking Patterns

Sequential Thinking (Basic)

{
  "thought": "Initial exploration of the problem...",
  "thought_number": 1,
  "total_thoughts": 5,
  "next_thought_needed": true
}

Branching (Explore Alternatives) 🌿

{
  "thought": "Exploring alternative approach...",
  "thought_number": 3,
  "total_thoughts": 7,
  "next_thought_needed": true,
  "branch_from_thought": 2,
  "branch_id": "alternative-algo-x"
}

Revision (Correct Earlier Thinking) 🔄

{
  "thought": "Revisiting earlier point: Assumption Y was flawed...",
  "thought_number": 4,
  "total_thoughts": 6,
  "next_thought_needed": true,
  "is_revision": true,
  "revises_thought": 2
}

Checklist (Review Every 3 Thoughts)

  • Need to explore alternatives? → Use BRANCH (🌿)
  • Need to correct earlier thinking? → Use REVISION (🔄)
  • Scope changed? → Adjust total_thoughts
  • Done? → Set next_thought_needed = false

Configuration

CLI Flags

pi --code-reasoning-max-bytes=102400 --code-reasoning-max-lines=5000

Environment Variables

export CODE_REASONING_MAX_BYTES=102400
export CODE_REASONING_MAX_LINES=5000

JSON Config

Create ~/.pi/agent/extensions/code-reasoning.json:

{
  "maxBytes": 51200,
  "maxLines": 2000
}

CLI Flags

FlagEnv VariableDefaultDescription
--code-reasoning-configCODE_REASONING_CONFIGCustom config file path
--code-reasoning-max-bytesCODE_REASONING_MAX_BYTES51200Max output bytes
--code-reasoning-max-linesCODE_REASONING_MAX_LINES2000Max output lines

Requirements

  • pi v0.51.0 or later

License

MIT

Keywords

pi

FAQs

Package last updated on 19 Apr 2026

Did you know?

Socket

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.

Install

Related posts