EnglishPilot is a local-first English learning gate for AI workflows: it can block or coach over-Chinese prompts, suggests copyable English rewrites, records useful lessons, and lets Claude Code / Codex / Feishu / WeChat share the same coaching and review loop.
Read the manual Β»
Features
Β·
Getting Started
Β·
Eval & Quality
Β·
Report Bug
Β·
Request Feature
Table of Contents
EnglishPilot sits in front of prompts and chat messages. It keeps the main sentence structure in English while still allowing a controlled amount of Chinese during the learning transition.
It has two runtime modes:
- Inline agent mode β Claude Code / Codex hooks enforce or coach through the language gate; MCP exposes coaching, review, diagnostics, and roadmap tools to the running agent.
- Managed channel mode β a daemon maintains Feishu/Lark and WeChat long connections, checks incoming messages, optionally calls a configured local agent backend, and replies through the same channel.
The goal is not to replace English study time. It makes normal work conversations carry a small, steady English practice loop without interrupting the real task unless the prompt crosses the configured threshold.
- Language / runtime β TypeScript on Node.js 22.5+
- Agent surfaces β Claude Code hooks, Codex hooks, MCP stdio
- Channels β Feishu/Lark long connection, WeChat QR-login long connection
- Storage β SQLite by default, JSONL fallback for local state and evidence logs
- Build & test β Vitest, ESLint, Prettier, dependency-cruiser, knip, Stryker, gitleaks
- English ratio gate β blocks prompts above the configured Chinese/non-English threshold.
- Copyable rewrite on block β blocked messages include a practical English starting point.
- Inline teaching notes β allowed prompts can produce compact Better/Why/IPA coaching notes;
forcemode raises the frequency. - Reviewable learning items β useful phrases are stored with scene, pattern, IPA, and spaced-review metadata.
- Claude Code and Codex installers β installs hooks, MCP config, and host guidance.
- MCP tool surface β exposes analysis, rewrite, review, config, roadmap, integration, voice, and diagnostic tools.
- Feishu/Lark long connection β QR-assisted setup, allowlist, threshold checks,
/new, voice-to-text handoff, and local agent replies. - WeChat long connection β QR-login account storage, allowlist, reconnect/session refresh handling,
/new, and local agent replies. - Managed daemon β one launchd/systemd service owns external channels, logs, instance locking, and a local control socket.
- Quality gates β CI on Ubuntu/macOS, project-health workflow, full-history gitleaks, CodeQL, coverage artifact, pre-commit and pre-push hooks.
Claude Code / Codex Feishu / WeChat
hooks + MCP stdio tools long-connection channels
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β adapters/cli + β β channels/* β
β adapters/mcp β β daemon runtime β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
ββββββββββββββββββββ¬βββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββ
β core language + β
β coaching policy β
ββββββββββ¬βββββββββββ
β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββ
βΌ βΌ βΌ
storage/review agent runner diagnostics
SQLite / JSONL claude -p / codex exec doctor / roadmap
Key points:
- One policy, multiple adapters β hooks, CLI, MCP, Feishu, and WeChat all use the same threshold and coaching pipeline.
- External channels are daemon-owned β Feishu and WeChat run as long connections with daemon-managed lifecycle, reply policy, and session continuity.
- Same assessment, controlled delivery β hooks, CLI, MCP, Feishu, and WeChat share one prompt-assessment pipeline; external channels add deterministic reply modes (
silent,violation,always) because the daemon owns the outbound message. - AI work is explicit β channel messages call a configured local backend (
claude -porcodex exec) only after the language gate allows the message. - Conversation continuity is local β per-channel Claude session IDs and Codex thread IDs are stored locally and can be reset with
/new.
See docs/agent-runtime-design.md for the local agent runtime decision and docs/manual.md for the full command reference.
- Node.js 22.5+
- macOS or Linux
- Claude Code CLI and/or Codex CLI when using external agent replies
- Feishu/Lark or WeChat credentials only when enabling those channels
- Optional: local Whisper command or cloud STT endpoint for voice transcription. See Voice STT install for Apple Silicon and Intel Mac recommendations.
Recommended install or update:
curl -fsSL https://raw.githubusercontent.com/OctopusGarage/english-pilot/main/install.sh | bashPin a release:
curl -fsSL https://raw.githubusercontent.com/OctopusGarage/english-pilot/main/install.sh |
ENGLISH_PILOT_VERSION=vX.Y.Z bashOr use npm after the package is published:
npm install -g @octopusgarage/english-pilot
english-pilot setup --yesSee INSTALL.md for the packaged install path. Source checkout is still the development path.
Check a prompt:
english-pilot check --text "I want to create a new project" --jsonInstall Claude Code or Codex integration:
english-pilot install claude --yes
english-pilot install codex --yesStart the MCP server:
english-pilot serve --mcpRun local diagnostics:
english-pilot doctor --jsonFor background services, put service-only environment variables in ~/.english-pilot/.env, then restart the service:
WHISPER_COMMAND=/absolute/path/to/english-pilot-stt-wrapper.py
WECHAT_PROCESSING_ACK=onFor voice setup, use docs/voice-stt-install.md. The short version is: Apple Silicon Macs should use mlx-whisper; Intel Macs should start with whisper.cpp.
Run a quick local behavior check:
english-pilot eval smoke --json
npm run smoke:mcp-stdio
npm run eval:suiteSee Eval and Quality Gates for smoke coverage, AI-agent evals, Claude Code shortcuts, and CI behavior.
Claude Code and Codex hooks enforce blocking before a prompt reaches the model. Their Stop hooks also capture the final assistant English note and store it in the normal review queue when it can be parsed. MCP exposes optional tools the agent can call naturally during a session.
english-pilot install claude --yes
english-pilot install codex --yes
english-pilot mcp config --write --json
english-pilot doctor --jsonThe submit hook blocks prompts over the configured Chinese/non-English ratio. MCP and host guidance ask agents to attach final-response coaching notes after the main task is complete; the Stop hook turns those notes into review items. force mode asks agents to attach a compact teaching note whenever the prompt has Chinese fragments, awkward English, or an obvious everyday improvement.
For recap, lesson, speech, or review requests, agents can use english_input_history, english_notes_history, and english_learning_brief to read local prompt history and English notes before generating teaching content.
english-pilot feishu setup
english-pilot feishu doctor --json
english-pilot feishu start --dry-run --json
english-pilot runFeishu/Lark uses a long connection. Incoming text and voice messages pass through the same language gate, then optionally continue the configured Claude/Codex conversation. Send /new to start a fresh local agent session for the current chat scope.
english-pilot wechat setup
english-pilot wechat accounts --json
english-pilot wechat doctor --json
english-pilot runWeChat uses QR-login long connection state under ~/.english-pilot/wechat/accounts/. The channel runtime handles reconnect/session refresh and uses /new to clear the active local agent thread. Feishu and WeChat send Received. Working on it... before long Claude/Codex turns; set WECHAT_PROCESSING_ACK=off or FEISHU_PROCESSING_ACK=off to disable it.
english-pilot service install
english-pilot service install-dev
english-pilot service status
english-pilot service logs
english-pilot service restart
english-pilot service uninstallenglish-pilot run starts the daemon in the foreground. service install registers the built dist daemon with launchd on macOS or a user systemd service on Linux. On macOS, service install-dev installs a launchd service that points at this checkout and runs a dev supervisor: it watches src/, rebuilds after changes, and reloads the daemon only after a clean build.
Use english-pilot daemon status or english-pilot doctor to find ~/.english-pilot/logs/daemon.log. It is JSONL and includes stable events for channel start, WeChat retry/recovery, session expiry, inbound messages, agent failures, and reply failures.
Defaults:
gateMode:enforceblocks over-threshold prompts;coachnever blocks but still analyzes, suggests, and records useful lessonsmaxChineseRatio:0.3targetChineseRatio: coaching target below the hard block thresholdstorage: SQLite under~/.english-pilot/english-pilot.sqliterewriteBackend: local rule-based fallback unless a local translator is configured
Common commands:
english-pilot config get
english-pilot config profiles --json
english-pilot config use beginner
english-pilot config use balanced
english-pilot config use force
english-pilot config use coach
english-pilot config set gateMode coach
english-pilot config set externalAgentBackend claude
english-pilot config set externalAgentBackend codex
english-pilot config set externalAgentCwd /path/to/workspace
english-pilot config set disabledProjectPaths /path/to/project-a,/path/to/project-bTo disable submit-hook blocking for one repository without editing global path config, add this file at the repository root:
{
"gateHook": false
}Save it as .english-pilot.json; hook checks in descendant directories inherit it.
To create that file and keep it out of Git using local ignore mechanisms:
english-pilot gate disable --repo-ignore
english-pilot gate disable --global-ignoreUse --repo-ignore for the current repository's .git/info/exclude; use --global-ignore for the user's configured global Git excludes file, falling back to ~/.config/git/ignore.
Local state is stored under ~/.english-pilot by default. Set ENGLISH_PILOT_HOME for tests or isolated runs.
Eval details are documented in Eval and Quality Gates.
npm ci
npm run lint
npm run typecheck
npm test
npm run smoke
npm run smoke:mcp-stdio
npm run eval:suite
npm run project-health
npm run verifyUse Eval and Quality Gates for the detailed development, smoke, AI eval, and GitHub Actions workflow reference.
See PROJECT_PLAN.md for roadmap context.
MIT. See LICENSE.