Skip to content

Configuration

Agent Feishu Channel is configured via a TOML file. The default location is ~/.agent-feishu-channel/config.toml. You can override this path by setting the AGENT_FEISHU_CONFIG environment variable (CLAUDE_FEISHU_CONFIG is still honored as a legacy alias).

A fully commented example is available in config.example.toml at the project root.

Config File Setup

bash
mkdir -p ~/.agent-feishu-channel
cp config.example.toml ~/.agent-feishu-channel/config.toml

Config Sections

[feishu] — Feishu App Credentials

KeyDescription
app_idYour Feishu app's App ID (from open.feishu.cn > Credentials)
app_secretYour Feishu app's App Secret
encrypt_keyEvent encryption key (optional; only if encryption is enabled in the Feishu console)
verification_tokenEvent verification token (optional)

[access] — Access Control

KeyDescription
allowed_open_idsArray of open_id values allowed to talk to the bot
unauthorized_behavior"ignore" (silently drop) or "reject" (reply with error)

WARNING

The bot has full shell and file access to your machine. Always configure allowed_open_ids to restrict access.

[agent] — Shared Agent Defaults

KeyDefaultDescription
default_provider"claude"Default provider for new chats: claude or codex
default_cwd"~/my-projects"Working directory for new sessions
default_permission_mode"default"Permission mode: default, acceptEdits, plan, bypassPermissions
permission_timeout_seconds300Seconds before a permission card auto-denies
permission_warn_before_seconds60Seconds before timeout to post a reminder
auto_compact_thresholdprovider defaultProvider-native compact hint threshold, when supported

[claude] — Claude Runtime Defaults

KeyDefaultDescription
default_model"claude-opus-4-6"Model ID passed to the CLI's --model flag
cli_path"claude"Path to the claude binary; resolves via $PATH by default

[codex] — Codex Runtime Defaults

KeyDefaultDescription
default_model"gpt-5.4"Model ID passed to the Codex SDK
cli_path"codex"Path to the codex binary; resolves via $PATH by default

[render] — Card Rendering Options

KeyDefaultDescription
inline_max_bytes2048Max UTF-8 bytes of inline content before truncation
hide_thinkingfalseSkip Claude's extended-thinking blocks entirely
show_turn_statstrueShow token usage and timing after each turn

[persistence] — State and Log Paths

KeyDefaultDescription
state_file"~/.agent-feishu-channel/state.json"Path to the session state file
log_dir"~/.agent-feishu-channel/logs"Directory for structured log files
session_ttl_days30Days to keep session records before cleanup on startup

[logging] — Log Level

KeyDefaultDescription
level"info"Log level: trace, debug, info, warn, error

[projects] — Project Aliases

Define aliases for the /project command to quickly switch working directories:

toml
[projects]
my-app = "~/projects/my-app"
infra = "~/projects/infrastructure"

[[mcp]] — Custom MCP Servers

Register additional Model Context Protocol servers to expose their tools to the active provider. Each [[mcp]] block is one server; repeat the block to add more. Servers are loaded at startup — restart the process after editing.

KeyRequiredDescription
nameyesUnique identifier; Claude sees tools as mcp__<name>__<tool>
typeyes"stdio" (spawn a local process) or "sse" (connect to an HTTP SSE endpoint)
commandstdio onlyExecutable to run (e.g. "npx")
argsoptionalArgument list for command
envoptionalEnvironment variables passed to the stdio process
urlsse onlySSE endpoint URL

Stdio example:

toml
[[mcp]]
name = "my-tools"
type = "stdio"
command = "npx"
args = ["-y", "@company/my-mcp-server"]
env = { API_KEY = "secret" }

SSE example:

toml
[[mcp]]
name = "remote"
type = "sse"
url = "http://localhost:8080/sse"

TIP

The built-in mcp__feishu__ask_user tool (which drives interactive question cards) is always available and does not need to be configured here.

Runtime-Settable Keys

The following keys can be changed at runtime via /config set without restarting the process:

KeyDescription
render.hide_thinkingToggle thinking block visibility
render.show_turn_statsToggle turn statistics
render.inline_max_bytesChange inline content truncation limit
logging.levelChange log verbosity
agent.default_providerChange the default provider for new chats
agent.default_cwdChange the shared default working directory
agent.default_permission_modeChange the shared default permission mode
agent.permission_timeout_secondsAdjust permission timeout
agent.permission_warn_before_secondsAdjust the timeout warning threshold
claude.default_modelSwitch the default Claude model
codex.default_modelSwitch the default Codex model

The --persist Flag

By default, /config set only changes the value in memory for the current process. Add --persist to write the change back to config.toml so it survives restarts:

/config set logging.level debug --persist

Environment Variables

VariableDescription
AGENT_FEISHU_CONFIGOverride the config file path (default: ~/.agent-feishu-channel/config.toml)
CLAUDE_FEISHU_CONFIGLegacy alias for AGENT_FEISHU_CONFIG (still honored)
ANTHROPIC_BASE_URLCustom API endpoint for the Claude SDK
ANTHROPIC_AUTH_TOKENAuth token for a custom endpoint

TIP

Environment variables take precedence over config file values where applicable.

Provider Notes

  • Existing chats persist their chosen provider and resume with the same provider after restart.
  • Switching provider in chat with /provider <claude|codex> starts a fresh provider-native thread for that chat.
  • Codex currently treats mid-turn acceptEdits escalation as a no-op; all other shared session/config behavior stays aligned where possible.

Built with VitePress