Feishu (Lark) is a team chat platform used by companies for messaging and collaboration. This plugin connects CoderClaw to a Feishu/Lark bot using the platformβs WebSocket event subscription so messages can be received without exposing a public webhook URL.
Install the Feishu plugin:
coderclaw plugins install @coderclaw/feishu
Local checkout (when running from a git repo):
coderclaw plugins install ./extensions/feishu
There are two ways to add the Feishu channel:
If you just installed CoderClaw, run the wizard:
coderclaw onboard
The wizard guides you through:
β After configuration, check gateway status:
coderclaw gateway statuscoderclaw logs --followIf you already completed initial install, add the channel via CLI:
coderclaw channels add
Choose Feishu, then enter the App ID and App Secret.
β After configuration, manage the gateway:
coderclaw gateway statuscoderclaw gateway restartcoderclaw logs --followVisit Feishu Open Platform and sign in.
Lark (global) tenants should use https://open.larksuite.com/app and set domain: "lark" in the Feishu config.

From Credentials & Basic Info, copy:
cli_xxx)β Important: keep the App Secret private.

On Permissions, click Batch import and paste:
{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"event:ip_list",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}

In App Capability > Bot:

β οΈ Important: before setting event subscription, make sure:
coderclaw channels add for Feishucoderclaw gateway status)In Event Subscription:
im.message.receive_v1β οΈ If the gateway is not running, the long-connection setup may fail to save.

coderclaw channels add
Choose Feishu and paste your App ID + App Secret.
Edit ~/.coderclaw/coderclaw.json:
{
channels: {
feishu: {
enabled: true,
dmPolicy: "pairing",
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
botName: "My AI assistant",
},
},
},
},
}
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
If your tenant is on Lark (international), set the domain to lark (or a full domain string). You can set it at channels.feishu.domain or per account (channels.feishu.accounts.<id>.domain).
{
channels: {
feishu: {
domain: "lark",
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
},
},
},
},
}
coderclaw gateway
In Feishu, find your bot and send a message.
By default, the bot replies with a pairing code. Approve it:
coderclaw pairing approve feishu <CODE>
After approval, you can chat normally.
dmPolicy: "pairing" (unknown users get a pairing code)Approve pairing:
coderclaw pairing list feishu
coderclaw pairing approve feishu <CODE>
channels.feishu.allowFrom with allowed Open IDs1. Group policy (channels.feishu.groupPolicy):
"open" = allow everyone in groups (default)"allowlist" = only allow groupAllowFrom"disabled" = disable group messages2. Mention requirement (channels.feishu.groups.<chat_id>.requireMention):
true = require @mention (default)false = respond without mentions{
channels: {
feishu: {
groupPolicy: "open",
// Default requireMention: true
},
},
}
{
channels: {
feishu: {
groups: {
oc_xxx: { requireMention: false },
},
},
},
}
{
channels: {
feishu: {
groupPolicy: "allowlist",
groupAllowFrom: ["ou_xxx", "ou_yyy"],
},
},
}
Group IDs look like oc_xxx.
Method 1 (recommended)
coderclaw logs --follow and look for chat_idMethod 2
Use the Feishu API debugger to list group chats.
User IDs look like ou_xxx.
Method 1 (recommended)
coderclaw logs --follow and look for open_idMethod 2
Check pairing requests for user Open IDs:
coderclaw pairing list feishu
| Command | Description |
|---|---|
/status |
Show bot status |
/reset |
Reset the session |
/model |
Show/switch model |
Note: Feishu does not support native command menus yet, so commands must be sent as text.
| Command | Description |
|---|---|
coderclaw gateway status |
Show gateway status |
coderclaw gateway install |
Install/start gateway service |
coderclaw gateway stop |
Stop gateway service |
coderclaw gateway restart |
Restart gateway service |
coderclaw logs --follow |
Tail gateway logs |
groupPolicy is not set to "disabled"coderclaw logs --followim.message.receive_v1coderclaw gateway statuscoderclaw logs --followim:message:send_as_bot permission{
channels: {
feishu: {
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
botName: "Primary bot",
},
backup: {
appId: "cli_yyy",
appSecret: "yyy",
botName: "Backup bot",
enabled: false,
},
},
},
},
}
textChunkLimit: outbound text chunk size (default: 2000 chars)mediaMaxMb: media upload/download limit (default: 30MB)Feishu supports streaming replies via interactive cards. When enabled, the bot updates a card as it generates text.
{
channels: {
feishu: {
streaming: true, // enable streaming card output (default true)
blockStreaming: true, // enable block-level streaming (default true)
},
},
}
Set streaming: false to wait for the full reply before sending.
Use bindings to route Feishu DMs or groups to different agents.
{
agents: {
list: [
{ id: "main" },
{
id: "coderclaw-fan",
workspace: "/home/user/coderclaw-fan",
agentDir: "/home/user/.coderclaw/agents/coderclaw-fan/agent",
},
{
id: "coderclaw-xi",
workspace: "/home/user/coderclaw-xi",
agentDir: "/home/user/.coderclaw/agents/coderclaw-xi/agent",
},
],
},
bindings: [
{
agentId: "main",
match: {
channel: "feishu",
peer: { kind: "direct", id: "ou_xxx" },
},
},
{
agentId: "coderclaw-fan",
match: {
channel: "feishu",
peer: { kind: "direct", id: "ou_yyy" },
},
},
{
agentId: "coderclaw-xi",
match: {
channel: "feishu",
peer: { kind: "group", id: "oc_zzz" },
},
},
],
}
Routing fields:
match.channel: "feishu"match.peer.kind: "direct" or "group"match.peer.id: user Open ID (ou_xxx) or group ID (oc_xxx)See Get group/user IDs for lookup tips.
Full configuration: Gateway configuration
Key options:
| Setting | Description | Default |
|---|---|---|
channels.feishu.enabled |
Enable/disable channel | true |
channels.feishu.domain |
API domain (feishu or lark) |
feishu |
channels.feishu.accounts.<id>.appId |
App ID | - |
channels.feishu.accounts.<id>.appSecret |
App Secret | - |
channels.feishu.accounts.<id>.domain |
Per-account API domain override | feishu |
channels.feishu.dmPolicy |
DM policy | pairing |
channels.feishu.allowFrom |
DM allowlist (open_id list) | - |
channels.feishu.groupPolicy |
Group policy | open |
channels.feishu.groupAllowFrom |
Group allowlist | - |
channels.feishu.groups.<chat_id>.requireMention |
Require @mention | true |
channels.feishu.groups.<chat_id>.enabled |
Enable group | true |
channels.feishu.textChunkLimit |
Message chunk size | 2000 |
channels.feishu.mediaMaxMb |
Media size limit | 30 |
channels.feishu.streaming |
Enable streaming card output | true |
channels.feishu.blockStreaming |
Enable block streaming | true |
| Value | Behavior |
|---|---|
"pairing" |
Default. Unknown users get a pairing code; must be approved |
"allowlist" |
Only users in allowFrom can chat |
"open" |
Allow all users (requires "*" in allowFrom) |
"disabled" |
Disable DMs |