{"id":50909144,"url":"https://github.com/syscode-labs/syscode-pi-agent-kit","last_synced_at":"2026-06-16T08:30:31.926Z","repository":{"id":362995225,"uuid":"1261597770","full_name":"syscode-labs/syscode-pi-agent-kit","owner":"syscode-labs","description":"Reproducible Pi agent workflow with mise, Nix, Devbox, Safehouse, SpecStory, skills, and subagents","archived":false,"fork":false,"pushed_at":"2026-06-06T22:52:29.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T23:19:24.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syscode-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-06T22:52:27.000Z","updated_at":"2026-06-06T22:52:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/syscode-labs/syscode-pi-agent-kit","commit_stats":null,"previous_names":["syscode-labs/syscode-pi-agent-kit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/syscode-labs/syscode-pi-agent-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscode-labs%2Fsyscode-pi-agent-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscode-labs%2Fsyscode-pi-agent-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscode-labs%2Fsyscode-pi-agent-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscode-labs%2Fsyscode-pi-agent-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syscode-labs","download_url":"https://codeload.github.com/syscode-labs/syscode-pi-agent-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscode-labs%2Fsyscode-pi-agent-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34398405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-16T08:30:31.157Z","updated_at":"2026-06-16T08:30:31.920Z","avatar_url":"https://github.com/syscode-labs.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syscode-pi-agent-kit\n\n[![CI](https://github.com/syscode-labs/syscode-pi-agent-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/syscode-labs/syscode-pi-agent-kit/actions/workflows/ci.yml)\n[![mise](https://img.shields.io/badge/mise-managed-5C4EE5)](https://mise.jdx.dev)\n[![pi](https://img.shields.io/badge/pi-0.75.5-blue)](https://earendil.works)\n[![experimental](https://img.shields.io/badge/status-experimental-orange)](https://github.com/syscode-labs/syscode-pi-agent-kit)\n\n\u003e **Experimental.** This is a personal research scaffold — nothing here is\n\u003e stable, production-ready, or guaranteed to work. Tool versions change, upstream\n\u003e APIs break, and entire subsystems may be replaced or removed without notice.\n\u003e Use it as a starting point or for inspiration, not as a reliable foundation.\n\nRun a capable AI coding agent on your laptop using your existing ChatGPT Plus\nsubscription — no extra API costs. The kit bundles a small set of tools that\ncompress what the agent reads and writes, so each session uses fewer tokens and\ncosts less. Everything is version-pinned and installed with a single command,\nso the environment reproduces reliably across machines.\n\n## What it includes\n\n| Layer | Tool | What it does |\n|-------|------|-------------|\n| Agent | [Pi](https://earendil.works) | Terminal AI coding agent |\n| Model | ChatGPT Plus via Codex CLI | Runs on your existing subscription; no extra billing |\n| Compression | [lean-ctx](https://github.com/yvgude/lean-ctx) + pi-lean-ctx | Shrinks file reads, shell output, and search results before they reach the model |\n| MCP proxy | pi-mcp-adapter | Loads MCP server tool definitions lazily — ~200 tokens instead of thousands |\n| Docs retrieval | Docmancer | Indexes local docs and third-party documentation sites for fast in-session lookup |\n| Isolation | [Safehouse](https://safehouse.dev) | Sandboxes Pi sessions on macOS |\n| Session capture | [SpecStory](https://specstory.dev) | Records terminal agent history |\n| Task runner | [mise](https://mise.jdx.dev) | Single stable command interface for every operation |\n| Dev environment | Nix devShell / Devbox | Reproducible bootstrap on any machine |\n\n## Getting started\n\n### 1. Enter a clean environment\n\n```bash\nnix develop\n# or\ndevbox shell\n```\n\nThis gives you a reproducible shell with all system-level dependencies available.\nSkip this step only if you already have `mise` installed and trust your local environment.\n\n### 2. Install everything\n\n```bash\nmise run bootstrap\n```\n\nThis runs `mise install` (which pulls pinned versions of Node, Pi, Codex CLI,\nlean-ctx, and Groundcrew), pulls the latest skills from\n[syscode-agentic-skills](https://github.com/syscode-labs/syscode-agentic-skills)\ninto `.pi/skills/`, installs Pi extensions for context compression, and copies\nthe project configuration into `.pi/`.\n\n### 3. Log in to ChatGPT Plus\n\nBoth Pi and the Codex CLI authenticate through ChatGPT Plus OAuth. Do this once\nper machine:\n\n```bash\ncodex          # then type /login → select ChatGPT Plus/Pro\npi             # then type /login → select ChatGPT Plus/Pro (Codex)\n```\n\nCredentials are saved to `~/.codex/` and `~/.pi/agent/auth.json` and reused\nautomatically from then on.\n\n### 4. Start a session\n\n```bash\nmise run pi            # plain Pi session\nmise run pi-safe       # sandboxed via Safehouse (macOS only)\nmise run pi-story      # sandboxed + SpecStory session capture (macOS only)\n```\n\nCheck that everything is wired up correctly at any time:\n\n```bash\nmise run doctor\n```\n\n## Measuring token savings\n\nlean-ctx tracks how many tokens were compressed away during a session. View a\nsummary after any Pi session:\n\n```bash\nmise run leanctx-gain          # human-readable dashboard\nmise run leanctx-gain-json     # machine-readable JSON\n```\n\nOr inside Pi, run `/lean-ctx`.\n\n### Export to Prometheus\n\nIf you have a Pushgateway (or any compatible endpoint), savings metrics can be\npushed automatically:\n\n```bash\nexport METRICS_PUSH_URL=http://pushgateway:9091\nmise run push-leanctx-metrics\n```\n\nFor per-tool-call granularity, start the lean-ctx daemon before your session:\n\n```bash\nmise run lean-ctx-daemon\n```\n\nThe e2e test (`mise run test-e2e`) captures a before/after delta automatically\nand pushes it to `$METRICS_PUSH_URL` if set.\n\n\u003cdetails\u003e\n\u003csummary\u003eEmitted metrics\u003c/summary\u003e\n\nAll metrics carry `repo` and `session` labels.\n\n| Metric | Type | Description |\n|--------|------|-------------|\n| `lean_ctx_tokens_saved` | gauge | Tokens saved by compression this session |\n| `lean_ctx_avoided_usd` | gauge | API cost avoided this session (USD) |\n| `lean_ctx_total_commands` | counter | Compressed tool calls this session |\n| `lean_ctx_gain_rate_pct` | gauge | Compression gain rate % |\n| `lean_ctx_roi` | gauge | ROI (avoided / spend) |\n| `lean_ctx_score_compression` | gauge | Compression score 0–10 |\n| `lean_ctx_score_cost_efficiency` | gauge | Cost efficiency score 0–10 |\n| `lean_ctx_score_quality` | gauge | Quality score 0–10 |\n| `lean_ctx_score_consistency` | gauge | Consistency score 0–10 |\n\n\u003c/details\u003e\n\n## Optional extras\n\n```bash\nmise run bootstrap-docmancer         # index documentation sites for in-session lookup\nDOCS_URL=https://docs.pytest.org mise run docmancer-add\nmise run docmancer-query -- \"How do I parametrize fixtures?\"\n\nmise run install-caveman             # output-token compressor (experimental)\nmise run install-context-mode-profile  # alternate compression router (not compatible with lean-ctx)\n```\n\n\u003e Do not enable the Context Mode profile alongside lean-ctx — they both act as\n\u003e the default compression router and will conflict.\n\n## E2E comparison\n\nRun the same prompt through plain `codex exec` and a Pi+lean-ctx session, then\ndiff the outputs:\n\n```bash\nmise run test-e2e\n```\n\nResults land in `e2e-out/\u003ctimestamp\u003e/` (git-ignored). Not run in CI.\n\n---\n\n## Reference\n\n\u003cdetails\u003e\n\u003csummary\u003eAll mise tasks\u003c/summary\u003e\n\n| Task | Description |\n|------|-------------|\n| `mise run bootstrap` | Full install: tools, Pi extensions, local config |\n| `mise run bootstrap-context` | Install pi-lean-ctx and pi-mcp-adapter |\n| `mise run bootstrap-docmancer` | Install and initialise Docmancer |\n| `mise run install-local` | Copy templates into `.pi/` |\n| `mise run doctor` | Report required and optional tool availability |\n| `mise run doctor-leanctx` | Check lean-ctx binary and Pi wiring |\n| `mise run doctor-codex` | Check Codex CLI |\n| `mise run doctor-codebase-memory` | Check Codebase Memory MCP (optional) |\n| `mise run pi` | Run Pi directly |\n| `mise run pi-safe` | Run Pi through Safehouse (macOS) |\n| `mise run pi-story` | Run Pi through Safehouse + SpecStory (macOS) |\n| `mise run leanctx-gain` | Token-savings dashboard |\n| `mise run leanctx-gain-json` | Token-savings as JSON |\n| `mise run lean-ctx-daemon` | Start lean-ctx daemon for per-call tracking |\n| `mise run push-leanctx-metrics` | Push metrics to Pushgateway (`$METRICS_PUSH_URL`) |\n| `mise run test` | Run scaffold tests |\n| `mise run test-e2e` | Run e2e comparison (costs tokens; requires auth) |\n| `mise run audit-public` | Scan for secrets and machine-specific paths |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePinned versions\u003c/summary\u003e\n\n| Tool | Version |\n|------|---------|\n| Node.js | 24.14.1 |\n| Pi | 0.75.5 |\n| Codex CLI | 0.137.0 |\n| lean-ctx | 3.7.5 |\n| Groundcrew | 4.10.4 |\n| Safehouse | 0.10.1 |\n| SpecStory | 1.13.0 |\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscode-labs%2Fsyscode-pi-agent-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyscode-labs%2Fsyscode-pi-agent-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscode-labs%2Fsyscode-pi-agent-kit/lists"}