Skip to content

Commit 16eb4bd

Browse files
committed
fix: add Claude CLI flag passthrough and relax /spec permission mode enforcement
1 parent 90114f6 commit 16eb4bd

13 files changed

Lines changed: 82 additions & 20 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,24 @@ Investigation-first workflow for targeted fixes. Finds the root cause before tou
218218

219219
Just chat — no plan, no approval gate. Quality hooks and TDD enforcement still apply. Best for small tasks and exploration. For anything that needs a plan, use `/spec` — not Claude Code's built-in plan mode.
220220

221+
### Claude CLI Flag Passthrough
222+
223+
All Claude Code CLI flags work directly with `pilot` — current and future. Pilot forwards any flag it doesn't recognize to the Claude CLI automatically.
224+
225+
```bash
226+
pilot --channels plugin:telegram@claude-plugins-official
227+
pilot --model opus --verbose
228+
pilot --resume
229+
```
230+
221231
### Headless Mode
222232

223-
Run Pilot non-interactively with `-p` for CI/CD pipelines, scripts, and automated workflows. All Claude Code CLI flags work — `--output-format`, `--allowedTools`, `--continue`, `--bare`, etc.
233+
Run Pilot non-interactively with `-p` for CI/CD pipelines, scripts, and automated workflows. All Claude Code CLI flags work — `--output-format`, `--allowedTools`, `--channels`, `--continue`, `--bare`, etc.
224234

225235
```bash
226236
pilot -p "Run tests and fix failures" --allowedTools "Bash,Read,Edit"
227237
pilot -p "Summarize this project" --output-format json
228-
pilot -p "Review this PR for security issues" --bare --allowedTools "Read"
238+
pilot --channels plugin:telegram@official -p "Check messages"
229239
```
230240

231241
### /setup-rules — Generate Modular Rules

docs/docusaurus/docs/features/cli.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ Command reference for the `pilot` binary at `~/.pilot/bin/pilot`.
1010

1111
Run `pilot` or `ccp` with no arguments to start Claude with Pilot enhancements. Most commands support `--json` for structured output. Multiple sessions can run in parallel on the same project.
1212

13+
## Claude CLI Flag Passthrough
14+
15+
Pilot forwards any unrecognized flags directly to the Claude CLI. This means all current and future Claude Code flags work out of the box — no Pilot update required.
16+
17+
```bash
18+
# Use any Claude CLI flag directly
19+
pilot --channels plugin:telegram@claude-plugins-official
20+
pilot --model opus --verbose
21+
pilot --resume
22+
pilot --continue
23+
24+
# 'run' is an explicit alias — same behavior
25+
pilot run --channels plugin:telegram@claude-plugins-official
26+
```
27+
28+
Pilot only intercepts its own subcommands (`activate`, `status`, `worktree`, etc.) and flags (`--version`, `--skip-update-check`). Everything else passes through to `claude`.
29+
1330
## Headless Mode
1431

1532
Run Pilot non-interactively with `-p` (or `--print`). Wraps `claude -p` with license validation and the Pilot plugin — use it in CI/CD pipelines, scripts, or automated workflows.
@@ -24,8 +41,8 @@ pilot -p "Summarize this project" --output-format json
2441
# Auto-approve specific tools
2542
pilot -p "Run tests and fix failures" --allowedTools "Bash,Read,Edit"
2643

27-
# Streaming output
28-
pilot -p "Explain recursion" --output-format stream-json --verbose
44+
# With channels
45+
pilot --channels plugin:telegram@claude-plugins-official -p "Check messages"
2946

3047
# Continue a previous conversation
3148
pilot -p "Now focus on the database queries" --continue
@@ -34,15 +51,16 @@ pilot -p "Now focus on the database queries" --continue
3451
pilot -p "Summarize this file" --bare --allowedTools "Read"
3552
```
3653

37-
All [Claude Code CLI flags](https://code.claude.com/docs/en/cli-reference) work with `-p`, including `--output-format`, `--allowedTools`, `--continue`, `--resume`, `--append-system-prompt`, `--json-schema`, and `--bare`. Pilot-specific flags like `--skip-update-check` are stripped automatically.
54+
All [Claude Code CLI flags](https://code.claude.com/docs/en/cli-reference) work with `-p`, including `--output-format`, `--allowedTools`, `--continue`, `--resume`, `--channels`, `--append-system-prompt`, `--json-schema`, and `--bare`. Pilot-specific flags like `--skip-update-check` are stripped automatically.
3855

3956
## Session & Context
4057

4158
| Command | Description |
4259
|---------|-------------|
4360
| `pilot` | Start Claude with Pilot enhancements, auto-update, and license check |
61+
| `pilot [claude-flags...]` | Start Claude with any Claude CLI flags passed through |
4462
| `pilot -p "prompt" [flags...]` | Headless mode — run non-interactively with Pilot plugin (CI/CD, scripts) |
45-
| `pilot run [args...]` | Same as interactive, with optional flags (`--skip-update-check`) |
63+
| `pilot run [flags...]` | Explicit alias for starting Claude (all flags passed through) |
4664
| `ccp` | Alias for pilot |
4765
| `pilot check-context --json` | Get current context usage percentage |
4866
| `pilot register-plan <path> <status>` | Associate a plan file with the current session |

docs/docusaurus/docs/features/remote-control.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,29 @@ For the SSH/Termius approach, you need network connectivity to your computer. In
8484
| **Quick check** | Glance at a running session from your phone without going back to your desk |
8585
| **Multi-device** | Heavy coding from terminal, lighter interactions from browser, quick approvals from phone |
8686

87+
## Channels — Telegram, Discord & iMessage
88+
89+
[Channels](https://code.claude.com/docs/en/channels) push messages from external platforms directly into your running Pilot session. Claude reads the message, acts on it with your full local environment, and replies back through the same platform.
90+
91+
```bash
92+
# Start Pilot with a channel enabled
93+
pilot --channels plugin:telegram@claude-plugins-official
94+
pilot --channels plugin:discord@claude-plugins-official
95+
pilot --channels plugin:imessage@claude-plugins-official
96+
```
97+
98+
Channels require [Bun](https://bun.sh/) and a one-time bot setup (Telegram/Discord) or macOS (iMessage). Each channel maintains a sender allowlist — only paired users can push messages.
99+
100+
| Channel | Setup | Pairing |
101+
| ------- | ----- | ------- |
102+
| **Telegram** | [Create a bot](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram), pass token during install | Send any message to the bot → approve pairing code in terminal |
103+
| **Discord** | [Create a bot](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord), pass token during install | Send any message to the bot → approve pairing code in terminal |
104+
| **iMessage** | [macOS only](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage), no token needed | Texting yourself works automatically |
105+
106+
**Channels vs Remote Control:** Remote Control gives you a window into your session from the Claude App or browser. Channels let external platforms push events *into* your session — they're complementary. Use both together: channels for incoming messages, Remote Control for monitoring and steering.
107+
108+
**Team/Enterprise:** Channels are off by default. Admins enable them via [claude.ai Admin settings](https://claude.ai/admin-settings/claude-code). See the full [Channels documentation](https://code.claude.com/docs/en/channels) and [Channels reference](https://code.claude.com/docs/en/channels-reference) for building custom channels.
109+
87110
## Troubleshooting
88111

89112
If Remote Control doesn't connect or shows authentication errors, run `/logout` followed by `/login` inside Claude Code. This re-authenticates your session and resolves most connection issues.

launcher/cli.py

1.41 KB
Binary file not shown.

launcher/config.py

230 Bytes
Binary file not shown.

launcher/tests/unit/test_cli.py

4.68 KB
Binary file not shown.

pilot/commands/spec.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ model: sonnet
3535

3636
## 0.0 Permission Mode Pre-Flight Check
3737

38-
**Before ANY other step, check if the spec_mode_guard hook injected a permission mode warning.** If you see a system-reminder containing "Current permission mode is" or "requires 'bypassPermissions' mode", you MUST:
38+
**Before proceeding, check if the spec_mode_guard hook injected a permission mode note.** If you see a system-reminder containing "Current permission mode is", briefly warn the user:
3939

40-
1. Tell the user their current mode is not optimal for `/spec` autonomous execution
41-
2. Instruct them to press **Shift+Tab** to cycle to **Bypass Permissions** mode
42-
3. **STOP** — do NOT read env vars, invoke any skill, or proceed with the workflow
43-
4. Wait for the user to confirm they have switched, then re-invoke `/spec` with the same arguments
40+
> "Your current permission mode is **{mode}**. For uninterrupted `/spec` execution, **Bypass Permissions** mode is recommended (Shift+Tab to cycle). Proceeding — the workflow may pause for permission prompts."
4441
45-
**This check takes priority over all workflow steps below.** The hook warning is authoritativenever override it.
42+
**Then continue with the workflow.** Do not stop or wait for the user to switch. The user's mode choice is respectedbypass permissions is recommended, not required.
4643

4744
---
4845

pilot/hooks/spec_mode_guard.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def run_spec_mode_guard() -> int:
5151
"hookSpecificOutput": {
5252
"hookEventName": "UserPromptSubmit",
5353
"additionalContext": (
54-
f"WARNING: Current permission mode is '{permission_mode}'. "
55-
"The /spec workflow requires 'bypassPermissions' mode for autonomous execution. "
56-
"Tell the user to press Shift+Tab to cycle to 'Bypass Permissions' mode before proceeding. "
57-
"Do NOT invoke the /spec skill until the user confirms they have switched."
54+
f"NOTE: Current permission mode is '{permission_mode}'. "
55+
"For uninterrupted /spec execution, 'bypassPermissions' mode is recommended "
56+
"(Shift+Tab to cycle). In the current mode the workflow may pause for "
57+
"permission prompts. Briefly warn the user, then proceed with the workflow."
5858
),
5959
}
6060
}

pilot/hooks/tests/test_spec_mode_guard.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,32 @@ def test_warns_in_default_mode(self):
6464
ctx = result["hookSpecificOutput"]["additionalContext"]
6565
assert "default" in ctx
6666
assert "bypassPermissions" in ctx
67+
assert "proceed" in ctx.lower()
6768

6869
def test_warns_in_accept_edits_mode(self):
6970
code, output = _run_with_input("/spec fix bug", "acceptEdits")
7071
assert code == 0
7172
result = json.loads(output)
7273
ctx = result["hookSpecificOutput"]["additionalContext"]
7374
assert "acceptEdits" in ctx
75+
assert "proceed" in ctx.lower()
7476

7577
def test_warns_in_dont_ask_mode(self):
7678
code, output = _run_with_input("/spec fix bug", "dontAsk")
7779
assert code == 0
7880
result = json.loads(output)
7981
ctx = result["hookSpecificOutput"]["additionalContext"]
8082
assert "dontAsk" in ctx
83+
assert "proceed" in ctx.lower()
84+
85+
def test_warning_does_not_block(self):
86+
"""Non-bypass modes must NOT instruct the LLM to stop."""
87+
for mode in ("default", "acceptEdits", "dontAsk"):
88+
code, output = _run_with_input("/spec fix bug", mode)
89+
assert code == 0
90+
ctx = json.loads(output)["hookSpecificOutput"]["additionalContext"]
91+
assert "Do NOT" not in ctx
92+
assert "STOP" not in ctx
8193

8294

8395
class TestNonSpecPrompts:

pilot/rules/development-practices.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ This rule is about git commands, not file operations. Editing files is always al
118118

119119
**⛔ Never selectively unstage.** Commit ALL staged changes as-is.
120120

121+
**⛔ Always `git push -u` on new branches.** When pushing a newly created branch for the first time, use `git push -u origin <branch>` (or `--set-upstream`) so the local branch tracks the correct remote. Without `-u`, the upstream stays on the old branch (e.g. `origin/master`), breaking subsequent pushes from IDEs and CLI.
122+
121123
**Read commands — always allowed:** `git status`, `diff`, `log`, `show`, `branch`
122124

123125
**Exceptions:** Explicit user override ("checkout branch X") and worktree during `/spec` (`Worktree: Yes`).

0 commit comments

Comments
 (0)