pi-fxxk
v0.3.1
Published
Pi extension that turns /fxxk into a two-stage handoff command.
Downloads
418
Readme
pi-fxxk
pi-fxxk is a Pi extension that turns fxxk into a two-stage handoff command.
Why this exists
Because this annoying handoff keeps happening:
- Your task runs long, the context blows up, the model gets noticeably dumber, and now you have to open a fresh session and manually
@files again just to explain where the work should continue. - A long task finishes a chunk, and then you still have to ask the model to write a little
compactsummary of what it already did, what is still pending, and where the next session should pick things up. - You already did the brainstorm, the planning, the workflow ceremony, maybe even used Superpowers or compound-engineering, the todos are still sitting right there unfinished, and the model still goes: "Yes, I can continue. Anything else do you want me to do?" Come on. Just continue.
pi-fxxk exists to kill that handoff friction. Instead of re-explaining the situation like a human glue script, you generate the handoff while the current session still has the best context, then resume from that exact prompt in the next session.
What it does
pi-fxxk now uses a two-stage workflow:
- run
/fxxkin the source session to generate a copyable handoff prompt from the current session - run
/newmanually - run
/fxxkin the new session to consume that exact staged prompt
You can also provide an explicit goal when generating the staged prompt:
/fxxk finish the next test slice and run verificationIn the source session, /fxxk:
- reads the current session's visible context
- reuses an already explicit handoff prompt when one is present in transcript history
- otherwise composes a fresh handoff prompt
- extracts more than just the next action: it tries to preserve completed work, remaining work, key files, verification state, constraints, and completion criteria when that evidence exists
- lets you review or copy it
- stages it as a single-use prompt for the next session
In the next session, /fxxk:
- looks for the staged prompt linked from the source session
- only consumes it when the new session is running in the exact same working directory as the source session
- sends that exact prompt as the next user message
- clears it after successful use
If no staged prompt exists, /fxxk warns that the previous session did not generate a /fxxk prompt and sends nothing.
Inspired by
Inspired by thefuck. Thanks to that project for the naming joke and the original spark behind turning fxxk into a fast recovery and continuation gesture.
Prompt file
The handoff system prompt lives in a separate file so it can be iterated independently:
handoff-system-prompt.md
Installation
Install from npm:
pi install npm:pi-fxxkOr from git:
pi install git:github.com/vurihuang/pi-fxxkRestart Pi after installation so the extension is loaded.
Load it for a single run
pi -e npm:pi-fxxkInstall from a local path
pi install /absolute/path/to/pi-fxxkYou can also install from the current directory while developing:
pi install -l .Load from a local path for one session
pi -e /absolute/path/to/pi-fxxkVerify installation
After restarting Pi, open any session and run:
/fxxkIf the command is available and the extension stages or consumes a handoff prompt as expected, the installation is working.
Usage
1. Generate the staged handoff prompt in the source session
Run:
/fxxkIf you want to steer the handoff goal, pass it inline:
/fxxk continue with a planning pass before implementationThis generates a handoff prompt from the current session, opens it for review or copy, and stages it for the next session.
The target shape is closer to a continuation execution contract than a tiny recap: one clear next action, then only the progress, remaining work, files, checks, and constraints that materially help the next session continue without guessing.
2. Open the next session manually
Run:
/new3. Consume the staged prompt in the new session
Run:
/fxxkThe slash command and the plain-text trigger behave the same way.
Example flow
1. Stage the next-session prompt from the current session
Previous session is still open and has the best context. Run:
/fxxkTypical result:
- the extension reads the current session
- it generates or reuses the best handoff prompt available
- it opens that prompt for review or copy
- it stages the prompt as a single-use handoff for the next session
2. Stage a verification-focused handoff
If the next session should focus on verification, run:
/fxxk run the required checks, fix failures, then finish the taskThis biases the staged handoff prompt toward type-checking, linting, tests, and remaining fixes.
3. Resume from the staged prompt in the next session
After /new, run:
/fxxkTypical result:
- the extension finds the staged prompt linked from the source session
- it only consumes it when the source session cwd exactly matches the current session cwd
- it sends that exact prompt into the new session
- it clears the staged prompt so it cannot be reused accidentally
4. Cache miss behavior
If the source session never generated a staged prompt, /fxxk in the child session:
- warns that no staged
/fxxkprompt was found - sends nothing
Notes
- The slash command is
/fxxk - Plain
fxxkinput is also intercepted and handled /fxxkis session-aware: it stages in the source session, consumes in the child session only when both sessions use the exact same cwd, and warns on cache miss instead of falling back- Staged prompts are single-use and are cleared after successful consumption
- If you run
/fxxkmultiple times in the source session, only the latest staged prompt remains active /fxxkstill prefers explicit workflow artifacts and compact recent evidence over summarizing an entire prior session when it has to synthesize a new prompt- when a recent assistant report already contains handoff structure like completed work, remaining tasks, verification, or execution constraints,
/fxxknow tries to preserve those layers instead of collapsing everything into a one-line next step - If the session history already contains an explicit copy-paste handoff prompt,
/fxxkreuses it directly - Workflow markdown is only treated as the source of truth when the preserved session evidence is thin or explicitly points back to that artifact
/fxxknow biases generation toward a richer continuation contract instead of a minimal next-step prompt- model-generated handoffs and deterministic fallback both try to follow the natural response language and structure implied by the preserved user context and evidence
Install as a pi package
This project is already structured as a pi package via the pi field in package.json:
{
"pi": {
"extensions": ["./fxxk.js"]
}
}That means Pi can install it from a local path, npm, or git using the standard pi package flow.
