Skip to content

seb3point0/laudec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laudec

laudec demo

laudec is a small wrapper around the interactive Claude Code TUI. You hand it a prompt, it runs claude for you in the background, and prints back the answer — so you can use Claude from a script or a pipe without sitting in the TUI yourself.

Under the hood it runs a normal claude session in a pseudo-terminal and has Claude hand its answer back through a named pipe, so what you get is clean text rather than something scraped off the screen. It's a single Python file with no dependencies.

Install

You need python3 and the claude CLI, logged in.

For a per-user install, clone into your local data directory and symlink the launcher onto your PATH:

git clone https://github.com/seb3point0/laudec.git ~/.local/share/laudec
ln -s ~/.local/share/laudec/laudec ~/.local/bin/laudec

Make sure ~/.local/bin is on your PATH (it is by default on most distros), then run laudec from anywhere. Update later with:

git -C ~/.local/share/laudec pull

Or just clone it anywhere and call the script directly with python3 laudec.py "...".

Usage

laudec "what is 17 * 23?"
laudec -m sonnet "quick question"
echo "some data" | laudec "summarize this"
git diff | laudec "review this diff"

Anything piped on stdin is appended to the prompt, which is handy for feeding in files or the output of another command.

Options

Command-line flags:

Flag What it does
-m, --model <name> model to use, e.g. sonnet, opus, haiku
--effort <level> effort level: low, medium, high, xhigh, max
-b, --bypass skip laudec entirely and run claude -p directly
-v, --verbose print what it's doing to stderr

Environment variables, if you need to change the defaults:

Variable Default What it does
LAUDEC_CMD claude the binary to run
LAUDEC_MODEL sonnet model (same as -m)
LAUDEC_EFFORT medium effort level (same as --effort)
LAUDEC_FAST 1 trim TUI startup; set 0 to keep MCP servers and skills
LAUDEC_NUDGES 2 how many times to remind Claude to deliver if it forgets
LAUDEC_ARGS extra arguments passed straight through to claude
LAUDEC_AGENT_CMD auto override the callback command laudec asks Claude to run
LAUDEC_BOOT_TIMEOUT 30 seconds to wait for Claude to start
LAUDEC_TIMEOUT 300 overall time limit, in seconds
LAUDEC_RUNTIME_DIR $XDG_RUNTIME_DIR or /tmp where the named pipes are created
LAUDEC_NO_ARGPROMPT 0 set 1 to always type the prompt into the TUI instead of passing it as an argument

Exit codes: 0 success, 2 Claude didn't start, 3 no response, 4 delivery error.

Security

laudec runs claude --dangerously-skip-permissions, because the way it gets the answer back is to have Claude run a shell command unattended. That means Claude can run any command without asking. Only give it prompts and input you trust — piping in something untrusted is like handing that content a shell on your machine.

Notes

  • Each call is a fresh session, so there's no memory between runs.
  • Expect a few seconds of startup per call: the TUI has to boot and Claude runs one command to deliver the answer. sonnet and haiku are noticeably quicker than the default.
  • You get the whole response at once — there's no streaming.

About

A Claude Code TUI Wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors