docs/usage/agent/claude-code.mdx
Claude Code is Anthropic's coding agent that reads, writes, and runs code from your terminal. In LobeHub, you can delegate Claude Code from the desktop app — keep the chat UX you already use, while Claude Code does the work locally with full access to your project.
Send a prompt and Claude Code reads files, makes edits, runs commands, and reports back. Tasks, todos, skills, and tool calls stream into the chat as the agent moves; sessions resume across turns so a long task can span many messages.
A bridge between LobeHub's chat UI and the Claude Code CLI running on your machine. LobeHub spawns the claude command as a local subprocess, streams its events into a chat conversation, and renders Claude Code's output — partial messages, tasks, todos, skills, sub-agent threads — as first-class chat blocks. You drive the agent in natural language; Claude Code executes locally with your environment, credentials, and project context.
claude command must be available on your PATH.claude once in a terminal to authenticate before LobeHub can drive it. Requires an Anthropic account.Pick one of the install paths:
Recommended (install script)
curl -fsSL https://claude.ai/install.sh | bash
Homebrew (macOS)
brew install --cask claude-code
After installing, run claude once in a terminal to sign in. See the Claude Code setup guide for details.
If LobeHub can't find the CLI, it shows an Install Claude Code CLI prompt with the same commands and an Open System Tools button — click it after installing to re-detect the CLI.
When LobeHub detects the Claude Code CLI on your machine, an Add Claude Code recommendation card appears on the home page tagged "Coding Agent". Click it to create a Claude Code agent in one step.
You can also create one manually from the Create Agent menu and pick Claude Code as the type.
Each agent is independent, so you can keep multiple Claude Code agents pinned to different projects or workflows.
Every Claude Code session is pinned to a working directory — the folder Claude Code sees as the project root. Set it from the chat input bar before sending your first message. Switching mid-conversation triggers a Switch working directory? confirmation: chat messages stay, but the previous session context cannot be resumed and a new session starts for this topic.
If you change folders and the saved Claude Code session can't be resumed, LobeHub shows: "Working directory changed. Previous Claude Code session can only be resumed from its original directory, so a new conversation has started."
Inside the working directory, Claude Code runs with Full access — read and write to anything in the folder. Switching permission modes from inside LobeHub is not yet supported.
LobeHub renders Claude Code's tool calls and structured output with purpose-built blocks instead of raw JSON:
Tasks — When Claude Code uses its task manager, tasks render as a live progress card. Watch items move through pending → in-progress → completed as Claude Code works.
Todos — TodoWrite plans render as a progress card with completion counts and check states. Useful for tracking multi-step work.
Skills — When Claude Code invokes a built-in or user-installed skill, the call appears in a Skill block showing inputs, outputs, and any artifacts.
Tool calls — Reads, edits, shell runs, web fetches, and other tool uses get their own block in the conversation. Streamed partial output appears as Claude Code generates it.
Sub-agents — Claude Code can spawn sub-agents to handle parallel or scoped work. Their threads render in isolation inside the conversation without leaking into the main bubble.
Interventions — When Claude Code needs to ask you something mid-run, it shows a prompt inline so you can answer without leaving the chat.
Claude Code sessions persist across messages in the same topic. LobeHub captures the underlying session ID and reuses it on every follow-up, so you can pick up a long-running task at any point.
A session can't be resumed if:
In either case, LobeHub starts a fresh conversation automatically.
The Execution Device selector lets you pick where the Claude Code agent runs:
lh connect. Useful when the project lives on a different machine.claude works in your terminal, it works in LobeHub.claude once in a terminal first — sign-in happens at the CLI level, not in LobeHub.<Card href={'/docs/usage/agent/agent-team'} title={'Agent Groups'} />
<Card href={'/docs/usage/agent/sandbox'} title={'Cloud Sandbox'} /> </Cards>