CodePilotCodePilot

Feishu / Lark

Configure the Feishu / Lark bridge.

Feishu Bridge

Chat with Claude through a Feishu (or Lark) app. Supports switching between the domestic and international editions, and group policy control.

Create a Feishu App

Domestic Edition (Feishu)

  1. Go to the Feishu Open Platform and sign in with a developer account
  2. Click Create Custom App
  3. Fill in the app name and description
  4. On the app details page, under Credentials & Basic Info, obtain:
    • App ID (format: cli_xxxxxxxxxx)
    • App Secret
  5. In the left menu, select Add Capabilities > Bot to enable the bot capability
  6. Under Event Subscriptions, select Long Connection Mode (WebSocket, no public IP required):
    • Long connection mode must be started before you can save the configuration — click enable and wait for the connection to be established
    • Once connected, add the event: im.message.receive_v1 (receive messages)
    • Save the event subscription configuration
  7. Under Permissions, request the following:
    • im:message (send messages)
    • im:message.group_at_msg (receive group chat @messages)
    • im:message.p2p_msg (receive DM messages)
  8. Publish the app — submit for review or self-approve

International Edition (Lark)

The process is the same as the domestic edition, but performed on Lark Developer. When configuring in CodePilot, select the domain as Lark.

Configure in CodePilot

  1. Click Bridge in the sidebar, then switch to the Feishu tab
  2. Select domain: Feishu (domestic) or Lark (international)
  3. Enter the App ID and App Secret
  4. Click Test Connection to verify the credentials
  5. Configure group policy:
    • Open — Bot responds to @messages in all group chats
    • Allowlist — Only responds in specified group chats (enter group chat_id values)
    • Disabled — Only responds in DMs
  6. (Optional) Require @mention — When enabled, the Bot only responds to messages that @mention it in group chats
  7. (Optional) Allowed Users — Enter Feishu open_id or chat_id values to restrict who can use the Bot
  8. Click Save

Enable the Bridge

  1. Go back to the Bridge overview page
  2. Make sure the Feishu channel toggle is on
  3. Make sure the Bridge master switch is on
  4. Click Start

Message Format

The Feishu bridge converts Claude's replies into Feishu message format:

  • Complex replies (containing code blocks, tables, etc.) → Interactive Card
  • Simple replies → Rich text message (Post)
  • Maximum 30,000 characters per message (splitting is usually not needed)

Troubleshooting

Test connection failed

  1. Confirm the App ID and App Secret are correct
  2. Confirm the app has been published (review approved)
  3. Confirm you selected the correct domain (domestic vs. international)

Bot not responding in group chats

  1. Confirm the bot capability has been added
  2. Confirm the im:message.group_at_msg permission has been granted
  3. Confirm the group policy is not set to "Disabled"
  4. If the policy is set to "Allowlist", confirm the group chat ID is in the allowed list
  5. If "Require @mention" is enabled, make sure the message @mentions the Bot

Bot not responding in DMs

  1. Confirm the im:message.p2p_msg permission has been granted
  2. Confirm the app has been published
  3. Search for the Bot by name in Feishu and start a DM