I built claude-loopback , an npm package that serves your Claude subscription as a local HTTP API. I use it in personal projects where I need LLM calls without setting up a separate API key. You might find other uses for it. npm install -g claude-loopback claude-loopback setup claude-loopback Then send a prompt from any language: POST http://127.0.0.1:7337/v1/prompt { “prompt”: “Summarise this in three bullets”, “model”: “sonnet” } How it works your script ──HTTP──▶ claude-loopback (127.0.0.1) ──▶ claude -p ──▶ your subscription It runs each prompt through your logged-in Claude Code CLI in headless mode ( claude -p ) and returns JSON, or streams the answer as server-sent events. You can also pass a JSON schema to get structured output back. It only listens on 127.0.0.1, requires a token, and keeps Claude’s tools off by default. It’s meant for your own scripts on your own machine. It’s Windows only for now (macOS/Linux next), and each request takes about 1–3 seconds to start. GitHub: https://github.com/ssaarthakk/claude-loopback npm: https://www.npmjs.com/package/claude-loopback Feedback and contributions are very welcome, whether that’s bug reports, feature ideas or PRs. Next on my list: an OpenAI-compatible endpoint, conversations, image attachments and macOS/Linux support. submitted by /u/dexfade
Originally posted by u/dexfade on r/ClaudeCode
