Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
with:
bun-version: latest
bun-version: "1.2.15"

- name: Install dependencies
working-directory: console
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
with:
bun-version: latest
bun-version: "1.2.15"

- name: Install dependencies
working-directory: console
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
with:
bun-version: latest
bun-version: "1.2.15"

- name: Install dependencies
working-directory: console
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
with:
bun-version: latest
bun-version: "1.2.15"

- name: Install dependencies
working-directory: console
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,4 @@ bun.lock
# Kiro
.kiro/
.worktrees/
.env*.local
123 changes: 62 additions & 61 deletions README.md

Large diffs are not rendered by default.

Binary file modified console/src/services/sqlite/notifications/store.ts
Binary file not shown.
Binary file modified console/src/services/worker/PaginationHelper.ts
Binary file not shown.
Binary file modified console/src/services/worker/http/routes/DataRoutes.ts
Binary file not shown.
Binary file modified console/src/services/worker/http/routes/ExtensionRoutes.ts
Binary file not shown.
Binary file modified console/src/services/worker/http/routes/NotificationRoutes.ts
Binary file not shown.
Binary file modified console/src/services/worker/http/routes/PlanRoutes.ts
Binary file not shown.
Binary file modified console/src/services/worker/http/routes/utils/planFileReader.ts
Binary file not shown.
Binary file modified console/src/ui/viewer/components/NotificationBell.tsx
Binary file not shown.
Binary file not shown.
Binary file modified console/src/ui/viewer/components/ui/Modal.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/hooks/useExtensions.ts
Binary file not shown.
Binary file modified console/src/ui/viewer/hooks/useNotifications.ts
Binary file not shown.
Binary file modified console/src/ui/viewer/hooks/useRouter.ts
Binary file not shown.
Binary file modified console/src/ui/viewer/hooks/useStats.ts
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Sidebar/SidebarFooter.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Sidebar/SidebarNav.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Sidebar/SidebarProjectSelector.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Sidebar/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Topbar/TopbarActions.tsx
Binary file not shown.
Binary file not shown.
Binary file modified console/src/ui/viewer/layouts/Topbar/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Changes/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/PlanStatus.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/RecentActivity.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/RecentSessions.tsx
Binary file not shown.
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/StatsCard.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/StatsGrid.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Dashboard/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Extensions/ExtensionsView.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Help/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Memories/MemoryCard.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Memories/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Requirements/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Sessions/SessionCard.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Sessions/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Settings/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Spec/index.tsx
Binary file not shown.
Binary file modified console/src/ui/viewer/views/Usage/index.tsx
Binary file not shown.
Binary file modified console/tests/ui/ChangesNavigation.test.ts
Binary file not shown.
Binary file modified console/tests/ui/dashboard-project-filter.test.ts
Binary file not shown.
Binary file modified console/tests/ui/notification-bell.test.ts
Binary file not shown.
Binary file modified console/tests/ui/project-selector.test.ts
Binary file not shown.
Binary file modified console/tests/ui/search-removal.test.ts
Binary file not shown.
Binary file modified console/tests/ui/stats-grid-spec-cards.test.ts
Binary file not shown.
Binary file modified console/tests/ui/use-stats-spec-metrics.test.ts
Binary file not shown.
Binary file modified console/tests/worker/notification-routes.test.ts
Binary file not shown.
Binary file modified console/tests/worker/plan-author-parsing.test.ts
Binary file not shown.
1 change: 1 addition & 0 deletions console/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"ignoreDeprecations": "5.0",
"target": "ES2022",
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
Expand Down
27 changes: 20 additions & 7 deletions docs/docusaurus/docs/features/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@ The Console runs locally as a Bun/Express server with a React web UI. It's autom
$ open http://localhost:41777
```

## 9 Views
## 10 Views

Each view that supports project filtering has an inline **Project Filter** dropdown next to the title — switch projects without leaving the page. The **Dashboard** shows stats across all projects with clickable tiles that navigate to the relevant view.

| View | Description |
|------|-------------|
| **Dashboard** | Workspace status, active sessions, spec progress, git info, recent activity. Your real-time command center. |
| **Dashboard** | Global command center — 8 clickable stat cards (Projects, Sessions, Active, Memories, Extensions, Requirements, Specifications, Changes), recent specifications, and recent memories. Active specs shown as pills in the top bar. |
| **Sessions** | Browse past sessions with search. Copy the session ID and use `/resume <session-id>` to jump back in. |
| **Memories** | Browsable observations — decisions, discoveries, bugfixes — with type filters and search. Each memory shows which session it belongs to — click the session label to navigate directly to it. |
| **Extensions** | All extensions — local, plugin, and remote — with team sharing via git (push, pull, diff), color-coded categories, and scope filtering. |
| **Requirements** | PRD documents with view/annotate modes. Latest shown as a tab, older ones in a Previous dropdown. |
| **Specifications** | All spec plans with task progress (checkboxes), phase tracking (PENDING/COMPLETE/VERIFIED), and iteration history. |
| **Extensions** | All extensions — local, plugin, and remote — with team sharing via git (push, pull, diff), color-coded categories, and scope filtering (All / Global / Project / Plugin / Remote). |
| **Changes** | Git diff viewer with staged/unstaged files, branch info, and worktree context. |
| **Memories** | Browsable observations — decisions, discoveries, bugfixes — with type filters, search, and timeline view. |
| **Sessions** | Active and past sessions with observation counts, duration, and the ability to browse session context. |
| **Changes** | Git diff viewer with staged/unstaged files, branch info, worktree context, and inline code review. |
| **Usage** | Daily token costs, model routing breakdown (Opus vs Sonnet distribution), and usage trends over time. |
| **Settings** | Model selection per command and sub-agent (Sonnet 4.6 vs Opus 4.6). Spec workflow toggles (worktree support, ask questions, plan approval). Reviewer toggles (spec review, changes review) and optional Codex adversarial reviewers. Extended context (1M) toggle. |
| **Help** | Embedded documentation from pilot-shell.com — full technical reference without leaving the Console. |
| **Settings** | Model selection per command and sub-agent. Spec workflow toggles. Reviewer toggles and optional Codex adversarial reviewers. Extended context (1M) toggle with pricing info. |

### Session Resume

The Sessions tab shows the Claude Code session ID for each session with a **copy-to-clipboard** button. Use this ID to resume any past session:

```bash
/resume <session-id>
```

This lets you pick up exactly where you left off — all context, files, and conversation history are restored.

## Plan Annotation & Code Review

Expand Down
12 changes: 12 additions & 0 deletions docs/docusaurus/docs/features/context-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@ Pilot Shell reduces context consumption at multiple levels:

| Strategy | Savings | How |
|----------|---------|-----|
| **context-mode sandbox** | Up to 98% | Routes large-output commands to a sandboxed executor — only your printed summary enters context. An FTS5 knowledge base indexes content for on-demand search. Blocks curl/wget/WebFetch entirely. |
| **RTK proxy** | 60–90% | Rewrites dev tool output (`git status`, `npm test`, etc.) to remove noise before it enters the context window |
| **Conditional rule loading** | Variable | Coding standards load only for matching file types — Python rules don't load when editing TypeScript |
| **Progressive skill disclosure** | ~90% | Skill frontmatter (~100 tokens) loads always; full SKILL.md loads only on activation; linked files load on demand |
| **Scoped MCP tools** | Variable | MCP tool schemas are lazy-loaded via `ToolSearch` — only fetched when needed, not preloaded |

### context-mode

The biggest single source of context savings. When a command would dump 50KB+ of output into your context window, context-mode intercepts it and runs it in a sandbox instead. The tool hierarchy:

1. **`ctx_batch_execute`** — Run multiple commands + search in one call. Replaces 30+ individual tool calls.
2. **`ctx_search`** — Query indexed content. Pass all questions as an array in one call.
3. **`ctx_execute` / `ctx_execute_file`** — Run code in sandbox (JS, Python, shell). Only stdout enters context.
4. **`ctx_fetch_and_index`** — Fetch and index web pages. Raw HTML never enters context.

PreToolUse hooks automatically guide Claude toward these tools when it attempts commands that would produce large output. Session continuity hooks (PostToolUse, PreCompact, SessionStart) track 13 event categories across compactions so context-mode can restore session awareness after auto-compaction.

## Context Display

The status line shows context usage as a visual progress bar:
Expand Down
13 changes: 9 additions & 4 deletions docs/docusaurus/docs/features/hooks.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
sidebar_position: 2
title: Hooks Pipeline
description: 15 hooks across 7 lifecycle events — fire automatically at every stage
description: 21 hooks across 7 lifecycle events — fire automatically at every stage
---

# Hooks Pipeline

15 hooks across 7 lifecycle events — quality enforcement on autopilot.
21 hooks across 7 lifecycle events — quality enforcement on autopilot.

Blocking hooks reject actions or force fixes. Non-blocking hooks warn without interrupting. Async hooks run in the background. Two additional command-scoped Stop hooks run during `/spec` phases.
Blocking hooks reject actions or force fixes. Non-blocking hooks warn without interrupting. Async hooks run in the background. Two additional command-scoped Stop hooks run during `/spec` phases. Context-mode hooks handle sandbox routing and session continuity.

## SessionStart

Expand All @@ -19,6 +19,7 @@ Blocking hooks reject actions or force fixes. Non-blocking hooks warn without in
| Memory loader | Blocking | Loads persistent context from Console memory |
| `post_compact_restore.py` | Blocking | Re-injects active plan, task state, and context after compaction |
| `session_clear.py` | Blocking | Resets session state on /clear |
| `sessionstart.mjs` | Blocking | Injects context-mode routing rules and restores session knowledge after compaction |
| Session tracker | Async | Initializes message tracking |

## UserPromptSubmit
Expand All @@ -28,6 +29,7 @@ Blocking hooks reject actions or force fixes. Non-blocking hooks warn without in
| Hook | Type | Description |
|------|------|-------------|
| `spec_mode_guard.py` | Blocking | Blocks `/spec` in plan mode, warns when not in bypassPermissions mode |
| `userpromptsubmit.mjs` | Blocking | Captures user prompts for context-mode session continuity |
| Session initializer | Async | Registers the session with the Console worker daemon |

## PreToolUse
Expand All @@ -38,6 +40,7 @@ Blocking hooks reject actions or force fixes. Non-blocking hooks warn without in
|------|------|-------------|
| `tool_redirect.py` | Blocking | Redirects to MCP alternatives, blocks Explore agent and plan mode conflicts |
| `tool_token_saver.py` | Blocking | Rewrites Bash commands via RTK for token savings (60-90% reduction) |
| `pretooluse.mjs` | Blocking | Routes large-output tools to context-mode sandbox, blocks curl/wget/WebFetch, injects subagent routing |

## PostToolUse

Expand All @@ -47,6 +50,7 @@ Blocking hooks reject actions or force fixes. Non-blocking hooks warn without in
|------|------|-------------|
| `file_checker.py` | Blocking | Quality checks: Python (ruff), TypeScript (ESLint), Go (go vet + golangci-lint). Also warns when implementation files are edited without a failing test (TDD) |
| `context_monitor.py` | Non-blocking | Tracks context usage 0-100% with warnings as compaction approaches |
| `posttooluse.mjs` | Blocking | Captures session events (13 categories) to context-mode session DB |
| Memory observer | Async | Captures decisions, discoveries, and bugfixes to persistent memory |

## PreCompact
Expand All @@ -56,6 +60,7 @@ Blocking hooks reject actions or force fixes. Non-blocking hooks warn without in
| Hook | Type | Description |
|------|------|-------------|
| `pre_compact.py` | Blocking | Snapshots active plan and task list to memory |
| `precompact.mjs` | Blocking | Builds context-mode resume snapshot from captured session events |

## Stop

Expand All @@ -77,5 +82,5 @@ Additionally, `spec_plan_validator.py` and `spec_verify_validator.py` run as com
| `session_end.py` | Blocking | Stops worker daemon if no other sessions active, sends dashboard notification |

:::info Closed loop
When compaction fires, **PreCompact** captures your active plan and task list to persistent memory. **SessionStart** restores everything afterward — no progress lost.
When compaction fires, **PreCompact** captures your active plan and task list to persistent memory, and `precompact.mjs` builds a context-mode resume snapshot. **SessionStart** restores everything afterward — Pilot state from memory, session knowledge from context-mode — no progress lost.
:::
29 changes: 28 additions & 1 deletion docs/docusaurus/docs/features/mcp-servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,34 @@ description: External context always available to every session

External context always available to every session.

Six MCP servers are pre-configured and always available. They're lazy-loaded via `ToolSearch` to keep context lean — discovered and called on demand. Add your own in `.mcp.json`, then run `/setup-rules` to generate documentation.
Seven MCP servers are pre-configured and always available. They're lazy-loaded via `ToolSearch` to keep context lean — discovered and called on demand. Add your own in `.mcp.json`, then run `/setup-rules` to generate documentation.

## context-mode

**Context window protection — sandbox execution and FTS5 knowledge base**

Keeps large outputs out of your context window. Commands that produce more than ~20 lines of output are routed to a sandboxed executor — only your printed summary enters context. An FTS5 knowledge base indexes content for later search. Integrated via [context-mode](https://github.com/mksglu/context-mode).

```
ctx_batch_execute(commands: [...], queries: ["find errors"])
ctx_execute(language: "javascript", code: "const r = await fetch(...)")
ctx_execute_file(path: "data.json", language: "javascript", code: "...")
ctx_search(queries: ["auth flow", "login endpoint"])
ctx_fetch_and_index(url: "https://docs.example.com", source: "docs")
```

**Key capabilities:**

| Tool | Use case |
|------|----------|
| `ctx_batch_execute` | Run multiple commands + search in one call — replaces 30+ individual tool calls |
| `ctx_execute` | Run code in sandbox (JS, Python, shell) — only stdout enters context |
| `ctx_execute_file` | Process a file in sandbox — file content never enters context |
| `ctx_search` | Query the FTS5 knowledge base with multiple queries in one call |
| `ctx_fetch_and_index` | Fetch and index web pages — raw HTML never enters context |
| `ctx_index` | Store content in the knowledge base for later search |

**Routing hooks** automatically intercept tools that produce large output (Bash, Read, Grep, WebFetch) and suggest context-mode alternatives. curl/wget and WebFetch are blocked entirely — use `ctx_execute` or `ctx_fetch_and_index` instead.

## context7

Expand Down
3 changes: 3 additions & 0 deletions docs/docusaurus/docs/features/open-source-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Pilot Shell installs the following open-source tools during setup. Each tool is
|------|---------|---------|
| [Transformers.js](https://github.com/xenova/transformers.js) | Local ML model inference for embeddings | Apache-2.0 |
| [sharp](https://github.com/lovell/sharp) | High-performance image processing | Apache-2.0 |
| [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) | SQLite bindings for context-mode FTS5 and session DB | MIT |
| [Turndown](https://github.com/mixmark-io/turndown) | HTML-to-markdown conversion for context-mode web fetching | MIT |

## Testing Tools

Expand All @@ -79,6 +81,7 @@ Pilot Shell installs the following open-source tools during setup. Each tool is

| Tool | Purpose | License |
|------|---------|---------|
| [context-mode](https://github.com/mksglu/context-mode) | Sandbox execution + FTS5 knowledge base — keeps large outputs out of context | ELv2 |
| [Context7](https://github.com/upstash/context7) | Library documentation lookup | MIT |
| [open-websearch](https://github.com/Aas-ee/open-webSearch) | Web search (multi-engine, no API key) | MIT |
| [fetcher-mcp](https://github.com/jae-jae/fetcher-mcp) | Web page fetching via Playwright | MIT |
2 changes: 1 addition & 1 deletion docs/docusaurus/docs/features/statusline.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Widgets separated by `|`, from left to right:
| **Cost** | Session cost in USD | Green < $1, Yellow $1–5, Red $5+ |
| **5h usage** | 5-hour usage limit percentage with reset time (requires OAuth credentials) | Green < 70%, Yellow 70–90%, Red 90%+ |
| **7d usage** | Weekly usage limit percentage with reset time | Same as 5h |
| **RTK savings** | Token savings percentage from RTK proxy (`Savings: N%`), shown when no usage data available | Cyan |
| **Savings** | Token savings percentage from RTK proxy (`Savings: N%`), shown when no usage data available | Cyan |

:::info Usage API
When OAuth credentials are present (`~/.claude/.credentials.json`), the Anthropic usage API provides 5-hour and weekly usage limits — these replace the lines-changed and RTK widgets. Without credentials, lines-changed and RTK savings are shown instead. This is credential-dependent, not platform-dependent.
Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Complete technical reference for Pilot Shell

# Pilot Shell Documentation

**Pilot Shell** is the professional development environment for Claude Code. It provides spec-driven development, persistent memory, quality hooks, reusable skills, and a modular rules system.
**Pilot Shell** makes Claude Code production-ready — spec-driven plans, enforced tests, persistent knowledge. It includes reusable skills, a modular rules system, and a local web dashboard.

## Quick Start

Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type * as Preset from "@docusaurus/preset-classic";

const config: Config = {
title: "Pilot Shell",
tagline: "The professional development environment for Claude Code",
tagline: "Make Claude Code production-ready — spec-driven plans, enforced tests, persistent knowledge",
favicon: "img/favicon.png",

url: "https://pilot-shell.com",
Expand Down
Binary file modified docs/img/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/extensions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/specifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/extensions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/memories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/requirements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/sessions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/specifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/site/public/console/usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/site/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Pilot Shell",
"short_name": "Pilot",
"description": "Claude Code is powerful. Pilot Shell makes it reliable.",
"description": "Make Claude Code production-ready.",
"start_url": "/",
"display": "standalone",
"background_color": "#000000",
Expand Down
Loading
Loading