A Pi extension that tracks hostname context for cross-machine session sharing.
When you share Pi sessions across multiple machines (via Dropbox, Syncthing, etc.), resuming a session on a different machine can confuse the LLM because:
- File paths may differ between machines
- Installed tools and versions may vary
- Environment variables and system state are different
This extension records the hostname when a session is created. When you resume that session on a different machine, it automatically injects a context message informing the LLM about the machine change.
pi install git:github.com/Whamp/pi-hostnameThe extension works automatically:
-
When you create a new session, your hostname is recorded
-
When you resume a session (
/resume) on the same machine, nothing happens -
When you resume a session on a different machine, the LLM receives:
System context: This session was originally created on machine "desktop". You are now on "laptop". File paths, installed tools, environment variables, and system state may differ between these machines.
/hostname- Show the hostname where the session was created vs. current machine
- Uses Pi's
CustomEntryto store hostname in the session file - Listens to
session_startandsession_switchevents - Injects a
CustomMessageEntry(withdisplay: false) when machine mismatch is detected - The context message is hidden from the TUI but sent to the LLM
MIT