PromptPilot - SLM-powered control plane for AI coding agents; routes, clarifies, compresses, and preserves context before invoking Codex/Claude-style agents
Project description
PromptPilot
Small-language-model control layer for AI coding agents.
PromptPilot puts a cheap small model in front of Codex and Claude Code: it turns a rough prompt into a clear, constraint-pinned brief — so the frontier model stops burning tokens on ambiguity, repeated history, and noisy tool output.
What it does
- Clarifies vague requests — flags ambiguity and asks first instead of guessing.
- Pins constraints & protected spans — APIs, file paths, "don't touch X" go into the prompt explicitly.
- Routes every request — clarify / answer / passthrough / act — instead of blindly forwarding.
- Bounds session memory — long sessions don't re-feed the whole transcript every turn.
- Compresses noisy tool output — pytest / grep / diff, via agent hooks, before the expensive model reads it.
The SLM manages the workflow; the frontier model still writes and debugs the code. PromptPilot optimizes for semantic-preserving context control, not blind token reduction — a rewrite may be longer when that preserves a constraint. The savings come from fewer ambiguous turns, bounded replay, and compressed context.
Measured (hybrid mode, one 15-turn chain): ~24k input tokens of SLM work directed ~12.66M input tokens of agent work — the control layer was ~0.2% of the input footprint, and the bounded session ran the same work on ~7.6× fewer input tokens than the tool's native
--resume. Single workload, not a guarantee — see Benchmarks and Hybrid Mode.
How it works
%%{init: {"flowchart": {"curve": "basis", "nodeSpacing": 48, "rankSpacing": 60}}}%%
flowchart LR
U([Developer request])
subgraph PP["PromptPilot control plane"]
direction LR
M[["Session memory<br/>bounded summaries"]]
C{{"SLM route<br/>clarify / answer / passthrough / act"}}
Q["Clarify<br/>ask first"]
A["Answer<br/>offer reply"]
D["Direct reply<br/>opt-in only"]
P["Passthrough<br/>raw prompt"]
R["Act<br/>safe rewrite"]
end
subgraph AG["Frontier coding agent"]
direction LR
F["Codex / Claude CLI"]
O["Code changes<br/>tests / summary"]
T["Tool output"]
end
subgraph HK["Optional hooks"]
H["Compress logs<br/>pytest / grep / diff"]
end
U --> M --> C
C -->|clarify| Q
C -->|answer| A
A -->|enabled| D
A -.->|otherwise| F
C -->|passthrough| P --> F
C -->|act| R --> F
F --> O
F --> T --> H --> F
C -. "hybrid" .-> API[("Metered SLM API")]
F -. "hybrid" .-> SUB[("Subscription CLI")]
classDef entry fill:#fff7ed,stroke:#fb923c,stroke-width:2px,color:#7c2d12;
classDef control fill:#eef2ff,stroke:#6366f1,stroke-width:2px,color:#312e81;
classDef route fill:#f5f3ff,stroke:#8b5cf6,stroke-width:2px,color:#4c1d95;
classDef agent fill:#ecfeff,stroke:#06b6d4,stroke-width:2px,color:#164e63;
classDef hook fill:#f0fdf4,stroke:#22c55e,stroke-width:2px,color:#14532d;
classDef infra fill:#f8fafc,stroke:#94a3b8,stroke-width:1.5px,color:#334155;
class U entry;
class M,Q,A,D,P,R control;
class C route;
class F,O,T agent;
class H hook;
class API,SUB infra;
For answer, PromptPilot skips the downstream coding agent only when direct SLM answering is enabled (--let-slm-answer or PROMPTPILOT_LET_SLM_ANSWER); otherwise the request continues to the agent. The diagram keeps node labels short so GitHub Mermaid previews do not clip long text.
Dig deeper in Architecture, Routes and Decisions, and Semantic Preservation.
Install
PromptPilot wraps an existing coding-agent CLI — install and authenticate at least one first:
- Claude Code:
npm install -g @anthropic-ai/claude-code→claude auth login --claudeai - Codex:
npm install -g @openai/codex→codex login
pip install prpt[claude] # Claude/Anthropic SLM path
pip install prpt[codex] # Codex/OpenAI SLM path
pip install prpt[all] # both
Subscription auth and API keys both work; hybrid mode can route the small control layer to a metered API key and the coding agent to a subscription CLI. ([anthropic] / [openai] remain as aliases.)
First run
cd /path/to/your/repo
prpt setup # one-time onboarding (checks + smoke test)
prpt "fix the flaky test in payments" # auto-detects claude or codex from PATH
prpt --dry-run "refactor auth, no API changes" # preview the optimized prompt
prpt --tool codex "add dark mode" # force a specific agent
prpt restart # collapse a heavy session -> handoff.md -> fresh
prpt doctor re-runs setup checks; prpt install-hook wires prompt/tool hooks into Claude Code. Full flag set: prpt --help (or prpt --advanced-help for researcher/internal flags). New here? → QUICKSTART.md.
Demo
See the SLM control layer reshape a rough prompt into a structured brief, with zero setup — no API key, no coding agent, no network:
python examples/demo.py
Sample output, the live-SLM run, and every flag are in the demo walkthrough → examples/README.md.
Docs
Long-form docs live in docs/ (source of truth), mirrored to the PromptPilot GitHub Wiki by scripts/publish_wiki.sh. Start at the Project Overview or the docs index. Operational pages stay at the repo root: QUICKSTART.md, SECURITY.md, CONTRIBUTING.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prpt-0.2.1.tar.gz.
File metadata
- Download URL: prpt-0.2.1.tar.gz
- Upload date:
- Size: 127.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0489a873cefc3bb2793b2c1de11b599fc4bfd08c5a023aa03f20c2e773a56969
|
|
| MD5 |
a032223a9a9d61b38479bf75b4ddb640
|
|
| BLAKE2b-256 |
9610c1a8db3b84eddb162437ec2409c12cbe9f783a23e62556eb06cc557f1a7c
|
Provenance
The following attestation bundles were made for prpt-0.2.1.tar.gz:
Publisher:
publish.yml on steyangdot/PromptPilot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prpt-0.2.1.tar.gz -
Subject digest:
0489a873cefc3bb2793b2c1de11b599fc4bfd08c5a023aa03f20c2e773a56969 - Sigstore transparency entry: 1707978141
- Sigstore integration time:
-
Permalink:
steyangdot/PromptPilot@aea4ff857af8cde5a6132e9969adc4f88424b773 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/steyangdot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea4ff857af8cde5a6132e9969adc4f88424b773 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prpt-0.2.1-py3-none-any.whl.
File metadata
- Download URL: prpt-0.2.1-py3-none-any.whl
- Upload date:
- Size: 110.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58469f0ada264dae8fb7fb4e1938f8d553c98a608176c47e916b375236ced582
|
|
| MD5 |
2d67b6a9ddab1945130e204022a8ee17
|
|
| BLAKE2b-256 |
0829be6a3693649efe1ad295f924deae0e1d853d4c03231217fdbce06869f0fd
|
Provenance
The following attestation bundles were made for prpt-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on steyangdot/PromptPilot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prpt-0.2.1-py3-none-any.whl -
Subject digest:
58469f0ada264dae8fb7fb4e1938f8d553c98a608176c47e916b375236ced582 - Sigstore transparency entry: 1707978175
- Sigstore integration time:
-
Permalink:
steyangdot/PromptPilot@aea4ff857af8cde5a6132e9969adc4f88424b773 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/steyangdot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea4ff857af8cde5a6132e9969adc4f88424b773 -
Trigger Event:
release
-
Statement type: