Persistent python repl for agents. Did you every want an agent to do data analysis on python? Want it not to load a 100Gb dataset every time? Want it not to waste tokens on boiler plate every time? Want it to use repl like a normal person?
replmux runs a long-lived Python process. Recommended to run inside tmux. And lets another shell (where your agent is) send Python code into the persistent session.
From the project where you want to use replmux, add it as a dev dependency:
uv add --dev git+https://github.com/eduardomazevedo/replmuxStart the persistent REPL server:
tmux new -s replmux
replmux startFrom another terminal, send code:
replmux run 'x = 41'
replmux run 'x + 1'Send a multi-line block:
replmux run <<'PY'
def f(x):
return x + 1
f(41)
PYJoin interactively:
replmux joinStop the server:
replmux stopNone. Anyone who can connect to the Unix socket can execute Python code as your user.