All posts
Getting started

Claude Code in Feishu:
a team bot you can @ in 5 minutes

You already run Claude Code locally. This post shows how Larkway turns it into a Feishu (Lark) bot: a teammate @s it in a group, it reads the real code on your machine, runs commands, opens PRs, and posts the result back to the thread. No API key, no public ports.

Claude Code Feishu bot Larkway 0.3.x 2026-09-06 · ~6 min

The problem it solves

Every team has one person who knows "how this feature is implemented", and everyone else has to ask them. A data analyst wants to confirm whether a metric filters deleted users; a PM wants to know which API sits behind a chart; QA wants to reproduce a bug without the context. Feishu's built-in AI assistant cannot answer these because it cannot see your code.

A Claude Code running inside your real repository can. Larkway does exactly one thing: keeps that Claude Code alive on your machine and makes it reachable by anyone who @s it in Feishu.

@ the bot in a Feishu thread Larkway bridge (WebSocket) local claude subprocess result card back to the thread

Prerequisites

Four steps to running

zsh
# 1. install globally
$ npm i -g larkway

# 2. check: Node, claude login, lark-cli, git/gh, one by one
$ larkway doctor
#    lists what is missing; --fix repairs some of it

# 3. register the Feishu app + create the first bot (scan → name → pick claude)
$ larkway init

# 4. start the bridge; it stays in the background
$ larkway start
✓ bridge online · Feishu connected

Step three is the only place you have to act in person: Feishu requires the account owner to scan a QR code to authorise creating an app, and no agent can do that for you. After the scan, the wizard asks you to name the bot and pick a backend — choose claude.

Then, in a Feishu group: group settings → bots → add bot → pick yours. From that moment, anyone who @s it in the group starts a Claude Code session on your machine.

On a server without a browser use the larkway init CLI wizard. With a browser, run bare larkway to open the local web console — scanning, creating bots, editing memory and tailing logs all live there.

The first @

Engineering · Feishu group
DA
Data analyst
@dev-helper How does the retention metric treat deleted users?
dev-helper Larkway
Done

retention.ts line 47: the deleted_at IS NULL filter applies before the aggregation window, so deleted users are excluded.

Call chain: metrics/retention.ts → lib/cohort.ts.

The file name and line number in the answer come from actually reading the repository, not from guessing. Follow-up questions in the same thread continue the same Claude Code session; it remembers the context.

A bot is defined in three layers

Once it runs, you will want it to "know who it is and what it may touch". Larkway splits a bot into three layers, each in its own place:

LayerWhatWhere
L1 permissionsenv var names for the Feishu app credentials, allowed groups, repo pointers, token scope~/.larkway/bots/<id>.yaml
L2 role memory"who I am, what I must not do, where the rules live" — thin~/.larkway/bots/<id>.memory.md
L3 workflowhow to develop, test, commit, when to stop and ask a humanyour repo's AGENTS.md / CLAUDE.md / .claude/skills

Secrets live only in ~/.larkway/.env with mode 0600; the yaml and memory hold env var names only. So configs and memory can be shared with colleagues — having them does not let anyone run your bot.

A minimal L2 memory looks like this:

~/.larkway/bots/dev-helper.memory.md
# dev-helper

You are the team's engineering Q&A bot. When mentioned, pull the thread
context with lark-cli first, then answer from the real code in the repo,
citing file names and line numbers.

## Do not
- Change code or open PRs (another bot does that)
- Guess: if you cannot find it, say "not found"

The detailed workflow does not go here; it goes into the repository's CLAUDE.md and skills. When the process changes, you change the repo, not Larkway.

Common questions

Will it burn my API quota?

No. The subprocess inherits your local Claude Code login and runs on the subscription you already have. Larkway does not inject ANTHROPIC_API_KEY.

Does my code go anywhere?

No. Claude Code runs on your own machine; only messages and cards travel between Larkway and Feishu.

Do I need to open a public port?

No. Feishu pushes events over a persistent WebSocket; outbound access is enough.

How many bots can run at once?

One bridge can run several bots — say a read-only Q&A bot and a bot that edits code and opens PRs — each with its own three layers. But one Feishu app may only run larkway start in one place; do not run the same bot locally and on a server at the same time.

What about Codex?

Supported: pick codex as the backend when creating the bot. For how to choose, see Claude Code or Codex as a Feishu agent backend?

Next steps