Skip to content

Instantly share code, notes, and snippets.

@smkalle
smkalle / cs.sh
Created May 16, 2026 03:21 — forked from jedi4ever/cs.sh
Simple script to run claude headless without the -p (to avoid extra costs)
#!/usr/bin/env bash
# Usage: ./cs "your prompt"
# Runs Claude headlessly, suppresses the TUI, prints Claude's final reply on stdout.
set -uo pipefail
PROMPT="$*"
REPLY_FILE=$(mktemp)
SESSION_ID=$(uuidgen | tr 'A-Z' 'a-z')
ENC_CWD=$(pwd | sed 's|/|-|g')