Fluxio
← Back to the blog

Run Claude Code in VS Code Without Losing the Stream

Coding agents, liveEN

§1 Keep Claude Code close to your editor

Running Claude Code inside VS Code gives you a practical coding workspace: files in the editor, an agent in the integrated terminal, and incremental responses you can follow as work happens. The important distinction is that streaming depends on the entire path, not just a model setting. A buffering proxy, output wrapper, or incompatible endpoint can make a streaming response appear only after it finishes.

This walkthrough uses the VS Code integrated terminal rather than an editor extension, making the process easier to inspect and troubleshoot.

§2 Open your project and install Claude Code

Open your project folder in VS Code, then select Terminal followed by New Terminal. Confirm that the terminal starts in the project directory. If you use WSL, a development container, or a remote workspace, install and run Claude Code in that same environment.

With a supported Node.js installation available, run npm install -g @anthropic-ai/claude-code. Then run claude --version to verify that the command resolves. If installation fails because of permissions, use a user-managed Node.js installation rather than applying administrator privileges by default.

Start with a clean working tree or commit pending changes. Streaming makes the agent easier to observe, but it does not replace reviewing proposed edits and command permissions.

§3 Choose your authentication route

For a direct connection, run claude and follow the supported sign-in flow. Establishing this baseline first helps distinguish local terminal problems from relay configuration problems.

If you want centralized access and usage-based billing, Fluxio is a streaming-first, pay-per-token AI API relay that works with Claude Code. One key also supports tools such as Codex, Gemini CLI, and OpenAI SDK clients, making it useful when your development workflow spans multiple providers.

Before switching, check Fluxio’s current Claude Code instructions for its supported authentication method, endpoint, and model identifiers. The API base is https://api.fluxioapi.com. OpenAI-style clients add /v1, but that does not make their request format interchangeable with Claude Code’s protocol.

§4 Configure the relay in your terminal

For a relay configuration that uses Claude Code’s ANTHROPIC_AUTH_TOKEN variable, open a Bash terminal and run read -r -s -p "Fluxio API key: " ANTHROPIC_AUTH_TOKEN; echo. Then run export ANTHROPIC_AUTH_TOKEN. This avoids placing the key directly in shell history.

Set the endpoint with export ANTHROPIC_BASE_URL=https://api.fluxioapi.com when Fluxio’s current instructions specify that base. Resolve conflicting authentication variables or existing login credentials according to those instructions rather than assuming which credential takes precedence.

These variables apply to processes launched from that terminal. Restart Claude Code after changing them. Do not commit keys to your repository, paste them into chat, or assume an already-running editor extension inherits terminal variables.

§5 Launch without an output wrapper

Run claude directly in the integrated terminal. Avoid piping its interactive output through logging commands, task runners, or custom scripts during the initial test. Those layers can change terminal detection, buffer output, or interfere with interactive rendering.

Choose a model supported by your account and relay. For example, if Claude Sonnet 5.5 is available, use the exact model identifier supplied by Fluxio rather than guessing an identifier from its display name.

Ask a harmless first question: “Explain the top-level structure of this repository without changing any files.” Watch for incremental output. Visible text may arrive in small chunks rather than one literal token at a time; tools and reasoning can also introduce pauses.

§6 Find buffering before changing models

  • – Compare connection paths. Repeat the same request through your supported direct connection and relay configuration.
  • – Remove intermediaries. Temporarily bypass custom output wrappers and check whether a corporate proxy or VPN affects delivery.
  • – Inspect your own gateway. If you operate an additional reverse proxy, verify that it forwards streaming responses promptly instead of collecting the complete body.
  • – Separate latency from buffering. A slow first response is different from a response that arrives all at once.

Once incremental output works, reintroduce your usual tooling one layer at a time. Keep secrets out of diagnostic logs, and review edits before accepting them. The goal is a responsive coding workflow with visibility into both execution and cost.

Sign up for Fluxio to try streaming-first API access.

Create a Fluxio account →

More from the current