Harnesses

Pi

Pi Coding Agent. Every invocation mode, native model listing with fuzzy search, JSONL sessions with UUIDv7 ids, prompt templates as slash commands.
IDpi13 / 1313 paths · env + project
Harness

Pi Coding Agent

  • pi

Every invocation mode, native model listing with search. The reference harness here.

Invoke
6 of 6 · official
Models
native listing
MCP
json · pi
Agents file
~/.pi/agent/AGENTS.md
Inferred 0 / 13

Access

GetgetHarness("pi")
CLIharnesses paths pi --json
Trypi in the explorer

Pi is the reference harness for this package, because it supports everything: --no-tools for the advisor, --tools read,grep,find,ls for a read-only agent, --mode json for structured output on all of them, --model for selection and --list-models with an optional fuzzy filter. listModels parses that output into the shared AvailableModel shape; it lists only providers with configured authentication, so an empty result is a credentials question, not a bug.

Sessions are JSONL per project under ~/.pi/agent/sessions/, with UUIDv7 ids, and the directory moves with PI_CODING_AGENT_SESSION_DIR or --session-dir. .pi/SYSTEM.md replaces the system prompt and APPEND_SYSTEM.md appends to it. .pi/prompts/ holds reusable Markdown prompts invoked as slash commands, so those paths appear in both promptTemplates and commands. The Pi extension in this package registers the eleven tools in Pi itself.

MCP servers? Since 0.99 Pi has them built in, in ~/.pi/agent/mcp.json and .pi/mcp.json. The project file counts only once you trust the project. sse is out, Pi wants stdio or streamable HTTP.

Capabilities and invocation

  • mcp: yes
  • vision: yes
  • audio: no
  • video: no
  • tools: yes
  • streaming: yes

Binary pi, evidence official. Add --mode json for structured event output. Model selection appends --model {model}.

Callinvoke(prompt, options)6 of 6 modes
  • advisor{}-p --no-tools {prompt}
  • advisor · json{ structured: true }-p --no-tools --mode json {prompt}
  • read-only{ readOnly: true }-p --tools read,grep,find,ls {prompt}
  • read-only · json{ readOnly: true, structured: true }-p --tools read,grep,find,ls --mode json {prompt}
  • agent{ tools: true }-p {prompt}
  • agent · json{ tools: true, structured: true }-p --mode json {prompt}

Model listing runs pi --list-models and --list-models {search} with a filter. Lists models with configured provider authentication; accepts an optional fuzzy search.

Paths

Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.

PathsgetHarness("pi")13 templates · 6 groups

config

  • ~/.pi/agent/settings.jsonuserofficialall
  • .pi/settings.jsonprojectofficialall

sessions

  • ~/.pi/agent/sessions/<dash-encoded-cwd>/<timestamp>_<session-id>.jsonldataofficialall

    Per-project session transcripts in JSONL format; session ids are UUIDv7. Overridable with --session-dir.

instructions

  • AGENTS.mdprojectofficialall

    Loaded from parent directories and cwd; CLAUDE.md accepted as an alternative, AGENTS.override.md takes precedence over both in a directory.

  • .pi/SYSTEM.mdprojectofficialall

    Replaces the default system prompt; APPEND_SYSTEM.md appends instead.

  • ~/.pi/agent/AGENTS.mduserofficialall

    Global user-level instructions.

  • ~/.pi/agent/SYSTEM.mduserofficialall

    Global system prompt replacement; APPEND_SYSTEM.md appends instead.

skills

  • .pi/skills/projectofficialall
  • ~/.pi/agent/skills/userofficialall

    Global user-level skills.

commands

  • .pi/prompts/projectofficialall

    Prompt templates invoked as slash commands.

  • ~/.pi/agent/prompts/userofficialall

    Global user-level prompt templates.

promptTemplates

  • .pi/prompts/projectofficialall

    Prompt templates invoked as slash commands.

  • ~/.pi/agent/prompts/userofficialall

    Global user-level prompt templates.

Empty

hookstempThat is not the same as the feature being missing.

Env overrides

Variables the harness reads to move a root. The path is the default while the variable is unset; resolve() applies a set one to temp.

EnvenvOverrides2 variables
  • PI_CODING_AGENT_DIR~/.pi/agentconfig · sessions · instructions · skills · commands · promptTemplates

    A leading ~ in the value is expanded.

  • PI_CODING_AGENT_SESSION_DIR~/.pi/agent/sessionssessions

    Takes precedence over PI_CODING_AGENT_DIR for sessions; --session-dir beats both.

MCP servers

FilemcpConfigs2 files
  • ~/.pi/agent/mcp.jsonuser · json · pi · mcpServers
  • .pi/mcp.jsonproject · json · pi · mcpServers

Detection

CalldetectHarness()env, then project

envVars

  • PI_CODING_AGENT
  • PI_SESSION_ID
  • PI_SESSION_FILE

projectMarkers

  • .pi

Persistence

  • JSON - Settings, auth, trust, models, and keybindings files. (official)
  • JSONL - Session transcripts. (official)

syncAgentsFiles links ~/.pi/agent/AGENTS.md to the master bundle.