Skip to main content
The Lark channel connects a Lark (Feishu) bot app to your Codeg workspace. Once connected, you can start agent tasks, send follow-up messages, approve permissions, and receive rich card-based notifications — all from Lark or Feishu. Codeg communicates with Lark over a persistent WebSocket connection for receiving commands and uses the Lark REST API to send messages.

Prerequisites

  • A Lark or Feishu account
  • A Lark bot app with an App ID and App Secret — create one at open.feishu.cn (Feishu) or the equivalent Lark developer portal
You need the App ID, App Secret, and a chat ID (the target group or direct message to post into). The chat ID is available in the Lark app URL or via the Lark API.

Setup

1

Create a Lark bot app

Go to open.feishu.cn and create a new app. Enable the Receive messages and Send messages capabilities. Note the App ID and App Secret from the app credentials page.
2

Open Chat Channels settings

In Codeg, go to Settings → Chat Channels.
3

Add a Lark channel

Click Add Channel and select Lark.
4

Enter App ID and App Secret

Paste the App ID and App Secret from your Lark app. Codeg saves them to the OS keyring — they are never written to disk or logged.
5

Configure event filters

Choose which events this channel should receive: turn completions, tool calls, errors, or permission requests.
6

Enable daily report (optional)

Toggle Daily Report on and set the delivery time to receive an automated daily coding summary.
7

Click Connect

Codeg fetches a tenant access token from the Lark API, opens a WebSocket connection to the Lark event gateway, and begins receiving messages.
Lark is well suited for enterprise teams already using Lark or Feishu as their primary communication platform. You can post agent notifications into an existing group chat so the whole team stays informed.

Available commands

Send these commands to your Lark bot. The default prefix is /; you can change it in Settings → Chat Channels → Command Prefix.
CommandDescription
/folderPick a project directory
/agentChoose an AI agent
/task <description>Create a session and start a task
/resume [ID]Resume the most recent session, or a specific session by ID
/cancelAbort the current running task
/sessionsList active sessions in the current folder
/approveApprove a pending permission request
/approve alwaysApprove and auto-approve future requests of the same type
/denyDeny a pending permission request
/search <keyword>Search conversation history (returns up to 10 results)
/todayView today’s coding activity summary
/statusShow connection status for all configured channels
/helpDisplay available commands
When a session is active, send any plain text message to continue the conversation.

Message format

Codeg sends Lark messages using a card-based layout. Cards provide structured rich formatting native to the Lark platform:
  • A header section with the message title and level indicator
  • Body text with the main content
  • Key-value fields for structured data (agent type, stop reason, error details)
{
  "msg_type": "interactive",
  "card": {
    "header": { "title": { "content": "Turn Complete" } },
    "elements": [
      { "text": "claude_code session completed" },
      { "field": "Stop Reason", "value": "Completed" }
    ]
  }
}
Plain text fallback is used automatically when card rendering is unavailable.

Token refresh

Lark tenant access tokens expire periodically. Codeg refreshes the token automatically in the background (with a 5-minute margin before expiry) so the connection stays active without any manual intervention.

Event filters

Control which events Lark delivers to this channel:
  • Turn complete — agent finishes a response turn
  • Tool calls — agent invokes a tool (file read, shell command, etc.)
  • Errors — agent or channel errors
  • Permission requests — agent pauses to request approval
Set filters per channel in Settings → Chat Channels → [channel name] → Event Filters.

Troubleshooting

“Authentication failed” on connect Verify the App ID and App Secret are correct and that the app is published or in the correct environment (development vs. production). Re-enter the credentials from the Lark developer portal. Messages are not delivered to the chat Confirm that the chat ID configured in the channel settings matches the target group or direct message. The bot must be a member of the target chat. WebSocket connection drops Codeg automatically reconnects on WebSocket disconnections. Check Settings → Chat Channels for the current connection status. If status shows error, click Reconnect.