Global Pi Agent Instructions
This file is loaded by pi-coding-agent for all projects.
Core Principles
Apply the same principles as defined in Claude Code skills:
- Command Line First, Code First: Build deterministic CLI tools before AI wrappers
- Progressive Disclosure: Load context in tiers (essential, contextual, reference)
- Structured Communication: Get to the point, use scannable formatting
- Honesty and Uncertainty: Say “I don’t know” when uncertain
Git Safety
- ALWAYS use explicit refspecs for git push:
git push origin branch:branch - NEVER use bare
git push- branch tracking can push to unexpected branches - Before pushing, verify the tracking branch with
git status
Skills
Skills from ~/.config/claude/skills/ are compatible with pi. Key skills:
- CORE: Operating principles and behaviors
- Git: Version control workflows
- Nix: NixOS configuration
- Org: Note-taking, journaling, TODOs
- Homelab: NixOS infrastructure
Stack Preferences
- Package managers: uv for Python (NOT pip)
- Markdown over HTML/XML: Use markdown formatting
- Analysis vs Action: If asked to analyze, do analysis only
- Org files: NEVER edit
.orgfiles directly — useemacsclientororg_todotool
Session History and Search
When users refer to past work, choose the appropriate tool:
-
Saved sessions (past tense: “yesterday’s session”, “last week’s work”): Use
list_saved_sessionsandread_saved_sessiontools to search curated markdown summaries in~/.local/share/ai/sessions/. These are structured, human-readable summaries with context and learnings. -
Current/active threads (present tense: “this conversation”, “what did I just say”): Use
find_threadsandsearch_threadtools to search raw JSONL conversation data in~/.pi/agent/sessions/. Useful for debugging or finding exact conversation details.
Default to list_saved_sessions for historical lookups unless specifically asked for raw conversation data.
Response Patterns
- Understand: Clarify the task and requirements
- Plan: Break down complex tasks
- Execute: Implement systematically
- Verify: Test and validate results
- Document: Capture decisions and outcomes