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.
claude subprocess
→
result card back to the thread
Prerequisites
- Node.js 20+.
- Claude Code installed and logged in. Run
claudeonce in a terminal to log in; Larkway reuses that login and injects no API key. - lark-cli, Feishu's command-line client, which handles the long connection and messaging.
larkway doctorchecks for it and tells you how to install. - git and gh if you want the bot to open PRs. A read-only Q&A bot can skip them. Use
glabfor GitLab repositories. - An always-on machine. The bridge must stay online to receive Feishu events; a laptop that sleeps when closed will miss messages. A desktop or a small server is a better host.
Four steps to running
# 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 @
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:
| Layer | What | Where |
|---|---|---|
| L1 permissions | env 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 workflow | how to develop, test, commit, when to stop and ask a human | your 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:
# 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
- Open the console with
larkway uito edit the bot's memory and tail live logs. - Write a
CLAUDE.mdin your repository describing how your team develops and commits. - To dispatch a fleet of agents from your phone, read Dispatching a fleet of local coding agents from your phone.
- Stuck? Open an issue on GitHub.