pi-reflect

pi-reflect is an open-source agent harness and self-improvement extension for pi coding agents, developed by jo-inc. It inspects agent session transcripts over time to extract recurring correction patterns, mistakes, and developer preferences, and then updates agent behavioral configuration files with precise, surgical edits. In daily operations, pi-reflect operates either interactively inside agent sessions using slash commands or in a headless mode for scheduled automation. The system includes commands such as /reflect to initiate transcript analysis, /reflect-config to adjust per-target models, lookback windows, and transcript sources, and /reflect-history to monitor recent reflection runs. It supports custom model registry authentication to route reflection analysis through various LLM providers. What sets pi-reflect apart from standard memory layers is its focus on safe, automated rule synthesis rather than naive context append. It includes safety mechanisms such as automated backups, exact text matching, ambiguity detection, and duplication prevention to prevent configuration corruption. Distributed via npm under the `@jo-inc/pi-reflect` package scope, pi-reflect is open-source software that can run locally on developer workstations or via system schedulers like cron and launchd.

Tags: ai agent, cli, code assistant, coding agent, developer tools, OpenSource

Visit pi-reflect

Key features

  • Automated Transcript Reflection — Analyzes past interaction histories to detect developer corrections and update behavioral instructions. - Surgical Instruction Updates — Applies exact text matching and ambiguity checks to safely modify behavioral files without duplicating rules. - Configurable Target Profiles — Allows configuring per-target LLMs, lookback window sizes, and custom transcript source commands via /reflect-config. - Headless Execution Support — Runs outside interactive sessions to facilitate recurring maintenance via cron jobs or launchd daemons. - History Tracking & Auditability — Provides a /reflect-history command to inspect past reflection passes and verify changes. - Automated Safety Backups — Preserves backup snapshots prior to making automated changes to existing configuration files. - Flexible Model Registry Auth — Integrates with multiple model providers using current and legacy authentication schemes.

Use cases

Use Case: Automated Agent Guideline Tuning A developer frequently corrects a coding agent on project-specific formatting standards and testing conventions. Running the /reflect command parses recent session transcripts and writes these recurring preferences directly into the agent's behavior file.

Use Case: Scheduled Maintenance via Cron A team maintains long-running coding agents and sets up pi-reflect in headless mode using a nightly cron schedule. The utility scans daily session logs, extracts developer feedback patterns, and updates configuration targets without manual intervention.

Use Case: Multi-Target Workspace Optimization A developer switches between different project workspaces with different tech stacks. Using /reflect-config, they configure isolated lookback windows and distinct model parameters for each target repository to capture domain-specific patterns.

Who it is for

pi-reflect is built for developers and engineering teams using pi-based coding agents who want continuous, automated refinement of agent instructions based on real-world session corrections. It is ideal for developers looking for safe, programmatic prompt self-improvement. It is not intended for users looking for a standalone coding agent with an out-of-the-box GUI.

Install guide

Installation Install the package globally or as an extension via npm: bash npm install -g @jo-inc/pi-reflect

First Run Configure your reflection target, model backend, and lookback depth within your pi agent environment or CLI: bash # Inside an active pi agent session /reflect-config Configure your provider credentials or model registry settings as required by your underlying LLM provider.

Example Session To analyze recent transcripts and update behavioral files based on past corrections: bash # Trigger interactive reflection /reflect # Check recent runs and applied changes /reflect-history

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • Plandex — Plandex is an open-source terminal-based AI coding agent designed to handle complex, multi-file engineering tasks in large codebases. Created by…
  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • Open Code Review — Open Code Review is an open-source code review orchestration tool and agent plugin suite developed by Alibaba. Built primarily in…
  • EchoCoding — EchoCoding is an open-source agent harness and audio-augmented developer tooling layer created by launsion-boop. Designed to run alongside AI coding…
  • Concord MCP — Concord MCP is an open-source orchestration harness and Model Context Protocol (MCP) server developed by Get Concord AI. It provides…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories