AGENTS.md instructions for /Users/tanishqpalandurkar/Projects/yyork
--- project-doc ---
Agent workflow
User will assign one PRD at a time to an agent to implement. All the PRDs are available in the ./prds dir.
At any time if you think you could do a better job if a CLI tool was available to you and it would take you lesser tokens to do the task in presence of that tool, explicitly ask user to install it. Do not install it directly on your own as there are security related issues regarding this way of installation.
I want to wire in orchestrator into yyork now that would spawn the worker agents for me instead of me running the yyork spawn cmd which was the original idea of agent orchestrator if you may remember.
Assistant
I’ll trace the current yyork spawn flow and the existing orchestration hooks before editing. I’ll also do a quick memory pass so I don’t miss prior decisions about the orchestrator boundary.
Assistant
The repo already has two pieces that matter: a CLI-backed spawn engine and an AO workspace reader that imports ~/.agent-orchestrator metadata. I’m reading both sides now so the integration lands at the ownership boundary instead of duplicating spawn logic.
Assistant
Current yyork still starts workers through session.Engine directly, while the server intentionally stopped reading AO metadata in favor of SQLite. I’m checking the HTTP surface and the separate agent-orchestrator repo next to decide whether yyork should call AO as a subprocess or API.
Assistant
The memory note matches what I’m seeing live: AO owns a richer session manager and runtime/plugin layer, while yyork has its own smaller spawn engine. I’m going to verify the current AO CLI/API shape from the installed checkout before choosing the call path.
Assistant
There’s a large pre-existing dirty worktree, so I’m keeping edits narrow. The key mismatch is clear now: yyork currently ignores ao.WorkspaceProvider at runtime, so AO’s orchestrator and its worker metadata will not appear in yyork even if AO is running.
Assistant
The PRD explicitly says the AO reader was left compiling but deprecated for v1. Since your request is to bring the original orchestrator flow back, I’m going to re-enable AO as the runtime workspace source and then bridge stop/list behavior so yyork can supervise AO-spawned workers.
Assistant
Re-enabling AO display alone would be incomplete: the dashboard’s stop button would still call yyork’s SQLite stopper and become a no-op for AO sessions. I’m checking AO’s session-stop command and then I’ll add a small adapter so yyork routes AO sessions to AO’s control surface.
Assistant
The frontend still has older e2e coverage around /api/workspace, but the current data layer was moved to /api/sessions. I’m going to switch the home workspace query back to /api/workspace so orchestrator rows can flow through instead of flattening everything into worker-only SQLite DTOs.
Assistant
Plan from here:
Repoint yyork runtime reads to AO’s ~/.agent-orchestrator workspace source so orchestrator and AO-spawned workers show in the app.
Switch the home workspace query back to /api/workspace, preserving the existing generated workspace contract.
Add AO-backed stop/rename adapters so sidebar actions operate on AO metadata instead of silently hitting the old SQLite-only path.
Keep yyork spawn as a compatibility shim to ao spawn --prompt ..., so the old command no longer creates a separate yyork-owned session universe.
Run focused Go and web tests for the touched surfaces.
Assistant
I’m about to edit internal/ao, internal/app, server session handlers, and the home workspace data module. I’ll keep this as an adapter layer around AO rather than importing AO’s TypeScript internals into yyork.
Assistant
The AO CLI itself only supports ao session kill <session> without a project flag; internally it scans configured projects by ID. I’ll still resolve the selected project in yyork first so missing or ambiguous sidebar selections fail locally before invoking AO.
Assistant
The AO controller adapter is in place. Next I’m wiring it into the server so workspace reads, stop actions, and rename actions all target the same AO state directory.
Assistant
I hit a context mismatch because this checkout already has nearby edits; I’m applying the app wiring against the exact current block now.
Assistant
I’m adding the project-aware server hooks now. The route will still support the old SQLite-backed engine, but when AO is configured it will use AO’s metadata and ao session kill.
Assistant
The server now has generic extension points for project-aware stop and metadata rename. I’m updating the handlers to use those extension points while keeping the SQLite path intact for existing tests.
Assistant
Frontend workspace parsing is next. I’m removing the worker-only /api/sessions adapter and parsing the existing /api/workspace shape directly, which is what the sidebar and terminal routes already understand.
Assistant
The data layer now consumes /api/workspace. I’m threading the selected project id through stop and rename calls so AO sessions are resolved against the right project metadata.
Assistant
I’m moving the CLI surface next. yyork spawn will become a compatibility wrapper around ao spawn, and yyork session list / yyork stop will read and control AO sessions instead of SQLite rows.
Assistant
The CLI now routes through AO, but the help text still describes the old yyork-owned worktree path. I’m updating that copy so the command surface tells the truth.
Assistant
I’m adding focused tests for the AO controller path before running the suite, especially to make sure stop resolves project-scoped sessions and rename writes the same metadata file AO reads.
Assistant
The new AO tests need one import fix; I’m correcting that now.
Assistant
The core wiring is done. I’m adding one small frontend unit assertion for the new project query behavior, then I’ll format and run focused checks.
Assistant
Backend and frontend code paths are patched. I’m running formatters now so the compiler sees the final shape.
Assistant
The raw shell doesn’t have gofmt on PATH here, which matches the repo’s direnv setup. I’ll rerun Go formatting through direnv exec after the web formatter returns.
Assistant
The web formatter was run from the package directory, so the repo-prefixed paths were wrong for that command. I’m rerunning both formatters with the package-local paths and the repo’s direnv environment for Go.
Assistant
Formatting passed. I’m doing a quick read of the edited blocks before running tests, because the server now has mixed SQLite and AO paths and I want to catch obvious interface mismatches first.
Assistant
The edited blocks look structurally consistent. I spotted one stale comment about rename being SQLite-only; I’ll clean that while tests run if anything else shakes out.
Assistant
I’m cleaning stale handler comments now so future readers don’t think rename is still SQLite-only.
Assistant
One more behavior issue: AO workers can be spawned by the orchestrator in a separate process, so yyork’s SSE bus will not see those creations. I’m adding low-frequency workspace polling while keeping SSE for yyork-originated stop/rename updates.
Assistant
I’m updating the README’s basic flow so it reflects the AO-backed setup rather than telling you to run yyork spawn as the main path.
Assistant
Docs are aligned. I’m rerunning formatting on the final touched files, then I’ll run the focused checks.
Assistant
Running focused backend tests first: AO adapter, server handlers, CLI wrapper surface, and app wiring compile.
Assistant
Backend focused checks passed. I’m running the workspace data unit test and TypeScript check now, since the frontend query shape changed from /api/sessions back to /api/workspace.
Assistant
Focused frontend checks passed. I’m running the full Go test suite now because the CLI and server interfaces changed in shared packages.
Assistant
Full Go tests passed, and the frontend unit/type checks passed. I’m doing one final diff review now to make sure the final response separates my changes from the large pre-existing dirty worktree.
Assistant
The diff confirms the repo was already carrying broad unrelated changes in these same files. My changes are the AO adapter, AO workspace source wiring, frontend /api/workspace query, project-aware stop/rename calls, and README basic-flow adjustment; I’m doing one whitespace check now.
Assistant
One CLI detail needs tightening: if yyork spawn is just an AO compatibility wrapper, it should not force yyork’s old claude-code default over AO’s project config. I’m changing --agent to be an override only.
Assistant
That default-agent override is fixed. I’m formatting and rerunning the CLI/backend checks affected by that small change.
Assistant
The final focused backend rerun passed. I’m doing a last whitespace check and then I’ll summarize the exact integration points.
Assistant
I noticed the stop handler comment still mentions the old engine-only cleanup. I’m correcting that comment so it matches the AO-backed behavior.
Assistant
Implemented the AO-backed path.
yyork now reads live AO workspace state from ~/.agent-orchestrator, so the project orchestrator and AO-spawned workers flow into the dashboard via /api/workspace instead of the old SQLite-only session list. Stop and rename actions are project-aware and route AO sessions through a new AO controller adapter in internal/ao/control.go.
Key changes:
App wiring uses ao.NewWorkspaceProvider() and AO-backed stop/rename in internal/app/app.go.
Server stop/rename supports project-aware AO sessions in internal/server/sessions.go.
Home workspace query is back on /api/workspace with light polling for orchestrator-spawned workers in workspace.ts.
yyork spawn --prompt ... is now a compatibility wrapper around ao spawn --prompt ...; it no longer creates yyork-owned sessions in parallel.
README basic flow now starts from ao start --no-dashboard then yyork.
Verified:
direnv exec . go test ./...
pnpm --dir web exec vitest run src/features/home/data/workspace.unit.spec.ts
pnpm --dir web exec tsc --noEmit
git diff --check on touched files
I did not run ao start or spawn real agents.
User
yo yyork gots to be independent off of agent-orchestrator. We are ripping them off based on their concept because they don't have the engineering rigor as of us.
Assistant
Got it. I took “wire in orchestrator” too literally as AO integration; that is the wrong direction. I’m going to back out the AO dependency I introduced and make yyork’s own existing spawn engine grow the orchestrator concept instead.
Assistant
The independent version needs a yyork-owned orchestrator session, not an AO reader. I’m going to remove the AO-backed adapter from my last pass, restore yyork’s store-backed runtime, then add a first-class yyork orchestrator session that is persisted in the same SQLite/Zellij system as workers.
Assistant
A key detail: if the orchestrator runs inside its own worktree and calls yyork spawn, workers must still branch from the original project, not from the orchestrator worktree. I’m going to carry the original project path in the session environment and have yyork spawn respect it.
Assistant
I’m removing the AO runtime adapter entirely now. internal/ao/workspace.go can stay as deprecated compatibility code per the old PRD, but nothing in the active app/CLI path should call it.
Assistant
The yyork-owned design is: session.Engine gets a Kind on spawn, SQLite metadata records kind/role, StoreWorkspaceSource splits orchestrators from workers, and the orchestrator gets YYORK_PROJECT_PATH so worker spawns still target the original repo. I’m applying that now.
Assistant
I’ll pivot this to a yyork-owned orchestrator path and remove the active agent-orchestrator wiring. First I’m checking the current diff and the exact files that still mention AO so I can unwind the mistaken integration cleanly.
Assistant
The active CLI still calls ao, and the README still documents ao start --no-dashboard. The yyork engine already has the start of the right shape, so I’m going to finish the native orchestrator spawn flow and then clean the server comments/duplicates.
Assistant
I found one additional mismatch: the server got generic AO fallback hooks for stop/rename. Since the app is back on yyork’s own engine/store, I’m removing that extra fallback rather than leaving dead extension points that imply an external controller.
Assistant
I’m going to edit four areas now: CLI command wiring, store-to-workspace classification, server stop/rename cleanup, and README/web copy. Then I’ll run the Go and web checks that cover those surfaces.
Assistant
The terminal/send code already treats orchestrators as attachable candidates in some places, but the core workspace lookup only checks workers. I’ll include orchestrators in the server-facing lookup so a native orchestrator row can be opened, sent to, and stopped like workers.
Assistant
The sidebar labels orchestrators as “Orchestrator” already, so I’ll keep the stored worker id stable as the session id and rely on kind=orchestrator for UI grouping. That avoids inventing a second id format for native sessions.
Assistant
Before editing, I’m checking the engine tests because the new Kind and environment fields should be locked down there, not just in CLI help.
Assistant
I’m applying the CLI patch first: no ao import, no shelling to ao, spawn goes through the existing engine, and orchestrator becomes a real yyork command that starts a coordinator session.
Assistant
Next I’m changing the workspace adapter so SQLite rows with metadata.kind=orchestrator land in workspace.orchestrators; workers stay in workspace.sessions. This is the bridge that makes the dashboard treat the native orchestrator as a first-class terminal.
Assistant
I’m adding focused tests at the store adapter and engine levels so future changes don’t silently collapse orchestrators back into worker rows or drop the environment the orchestrator relies on for nested spawns.
Assistant
The workspace adapter calls the managed Zellij config path during Workspace(), so the new test will set HOME to a temp directory to avoid touching your real ~/.yyork while exercising the full adapter.
Assistant
I’m simplifying the server back to yyork-native control: stop delegates to session.Engine, rename persists in SQLite, and the engine/store are responsible for publishing and returning current state.
Assistant
I’m also making the shared Workspace lookup include orchestrators, matching the terminal and send resolution logic. That keeps project-scoped session lookup consistent across native worker and orchestrator rows.
Assistant
I’m cleaning the remaining user-facing CLI wording so “Agent Orchestrator” is no longer presented as a dependency or parity target. The planned commands can stay as conceptual future surface, but not as AO ownership.
Assistant
The CLI tests only asserted spawn/session/stop/send as implemented. I’m extending that to cover orchestrator help so the command stays real without accidentally starting the dashboard in tests.
Assistant
I’m updating the frontend polling comments now; the behavior is still needed because orchestrator-spawned worker sessions can be created outside the dashboard process, but the language should refer to yyork orchestrators, not AO.
Assistant
I’m replacing the README’s ao start --no-dashboard flow with the native yyork flow: run the dashboard, spawn an orchestrator, and let that session use yyork spawn for worker delegation.
Assistant
The major code edits are in. I’m scanning again for active AO references, then I’ll format and run the focused checks. Some test fixtures still use “AO” as sample data, so I’m looking for code-path references rather than fixture labels.
Assistant
There are still stale AO words in comments and empty-state UI copy. I’m updating those now; internal/ao remains as deprecated compatibility code, but it won’t be referenced by the active app/CLI path.
Assistant
The active code scan is clean aside from the deprecated internal/ao package and test fixtures. I’m formatting the touched Go files now, then I’ll run the focused Go package tests first to catch compile and behavior issues quickly.
Assistant
Formatting passed. I’m running the Go package tests for CLI, session, server, app, and durability provider now; these cover the spawn/orchestrator/control path I touched.
Assistant
The focused Go packages pass. I’m checking the agent launch implementations now to confirm the inline orchestrator prompt actually reaches both supported agent plugins in the way the engine sends it.
Assistant
Both built-in plugins prefer SystemPromptFile over inline instructions, so I’m correcting the orchestrator flag help to call that file a replacement prompt rather than an add-on.
Assistant
The help copy is corrected and formatted. I’m rerunning the focused Go tests after that small CLI change, then I’ll move to the full repo checks.
Assistant
Focused tests are still green. I’m running the full Go test suite now because the CLI/session changes touch shared store and launch behavior.
Assistant
Full Go tests pass. I’m checking web-side references to the old empty-state text before running the targeted workspace test and TypeScript compile.
Assistant
The targeted web test and TypeScript compile pass, but the Playwright e2e spec still expects the old empty-state copy. I’m updating those assertions so the broader browser suite won’t fail on the new yyork wording.
Assistant
The stale empty-state strings are gone and TypeScript still passes. I’m doing one more source scan for accidental active AO references, then I’ll run git diff --check.
Assistant
The remaining scan hits are test fixture ids and project names like agent-orchestrator_live. I’ll leave those sample ids alone to avoid a broad fixture churn, but I am renaming the one e2e test title that still says “AO workspace.”
Assistant
I’m reviewing the final diff in the touched backend files now, mainly to catch accidental behavior changes from the earlier AO-backed attempt before I do the last verification pass.
Assistant
The final review didn’t show active AO wiring reintroduced. I’m running the last whitespace check now, then I’ll summarize the exact changes and verification.
Assistant
Whitespace is clean. I’m checking the final worktree status and the specific files changed by this pass so I don’t overstate unrelated dirty work that was already present.
Assistant
The active app/CLI path no longer imports or shells to ao. I’m pulling the exact memory citation lines now because earlier context for the original yyork spawn behavior came from saved project memory, and the final needs to mark that cleanly.
Assistant
I’m doing a quick CLI help smoke check for the new command surface so I can report the actual verbs and avoid relying only on unit tests.
Assistant
The help smoke check shows orchestrator as a real command with no AO wording. I noticed the README flow could imply typing cd into the foreground server process, so I’m making that example explicit about using another shell.
Assistant
I made the README example clearer. I’m doing a final whitespace check after that doc edit.
Assistant
I’m grabbing line numbers for the main code references so the final can point at the actual implementation rather than just naming files.
Assistant
Implemented the pivot: yyork now has a native yyork orchestrator command and the active app/CLI path no longer imports or shells out to ao.
What changed:
Added native orchestrator CLI flow in internal/cli/commands.go. It spawns a normal yyork session with kind=orchestrator, default coordination prompt, and delegates workers via yyork spawn.
Restored yyork spawn, send, session list, and stop to use yyork’s own SQLite/Zellij/session engine path instead of agent-orchestrator.
Extended the spawn engine to carry Kind, inline system prompt, YYORK_PROJECT_PATH, YYORK_SESSION_ID, and YYORK_SESSION_KIND into spawned sessions in internal/session/engine.go.
Made the workspace adapter split store rows into workspace.orchestrators vs workspace.sessions based on metadata in internal/session/workspace_source.go.
Simplified stop/rename back to yyork-native engine/store behavior in internal/server/sessions.go.
Updated README/basic flow and web empty-state wording to avoid AO ownership language.
Verified:
direnv exec . go test ./internal/cli ./internal/session ./internal/server ./internal/app ./internal/durabilityprovider
direnv exec . go test ./...
pnpm --dir web exec vitest run src/features/home/data/workspace.unit.spec.ts
pnpm --dir web exec tsc --noEmit
direnv exec . go run . --help
direnv exec . go run . orchestrator --help
git diff --check
I did not run the full Playwright e2e suite.
User
what's the purpose of yyork orchestrator cmd lil bro?
Here's what the intended user experience was:
User runs yyork [projectPAth] to start the app, they get an orchestrator agent (claude-code | code whatever is the default based on config) that they prompt to spawn agents like "I need these {tasks} done, delegate to your worker agents to accomplish them in isolation.", "spawn a worker agent to {task}" etc.
propose a plan where do we stand right now in order to provide this experience to our users, then what engineering is required to do so.
keep your plan concise. too much token fries my brain for no good.
Assistant
I’ll ground this in the current code first, then I’ll give you a short plan. I’m checking the CLI startup path, current orchestrator command, and whether there’s already config-backed default-agent selection.
Assistant
Current shape is clear: yyork starts only the dashboard/API, while yyork orchestrator is a separate manual spawn command. There is a basic config loader, but the server/CLI engine path is not yet using it to choose the default orchestrator agent.
Assistant
<proposed_plan>
Native Orchestrator Startup UX
Summary
Current yyork orchestrator is a manual MVP shim: it spawns a kind=orchestrator session through yyork’s own engine. It is not the intended user UX.
Desired UX: user runs yyork [projectPath], dashboard opens, yyork ensures a project orchestrator exists, and the user prompts that orchestrator to delegate isolated workers.
Key Changes
Change root CLI to yyork [projectPath].
If path is provided, resolve it to an absolute git repo.
If omitted and cwd is a git repo, use cwd.
If no project is resolvable, start dashboard only.
Add app startup “ensure orchestrator” behavior.
After stale-session reconciliation, find an existing live kind=orchestrator for the project.
If none exists, spawn one automatically using the configured default agent.
Do not spawn duplicates.
Add config-backed default agent.
Use ~/.yyork/config.yaml key default_agent.
Allowed values: claude-code, codex.
Fallback: claude-code.
Use this default for auto-orchestrator and yyork spawn when --agent is omitted.
Keep yyork orchestrator only as a hidden/manual repair command, backed by the same ensure-orchestrator logic.
UX/Data Flow
Auto-orchestrator gets the existing orchestrator system prompt: inspect, plan, delegate via yyork spawn --prompt ..., follow up via yyork send, inspect via yyork session list.
Workers spawned from the orchestrator keep targeting the original repo through YYORK_PROJECT_PATH.
Dashboard should show and select the orchestrator terminal first for that project, so the user can immediately type the delegation prompt.
Test Plan
CLI: yyork /path/to/repo passes project path into app config; no-arg uses cwd only when cwd is a git repo.
App/session: auto-spawns one orchestrator when absent; reuses existing live orchestrator; does not duplicate.
Config: default_agent is loaded, validated, and falls back to claude-code.
Workspace/UI: orchestrator appears under workspace.orchestrators and is selected by default.
Regression: yyork spawn --prompt ... still manually spawns workers.
Assumptions
One orchestrator per project is enough for v1.
The orchestrator is terminal-first; no separate chat UI is required yet.
yyork orchestrator remains for debugging/repair, not public onboarding.
</proposed_plan>
User
I think we can reuse the spawn cmd for spawning the orchestrator agent. we can add a --type option whose's valid values are "orchestrator" | "worker". based on the passed arg, we can chose what should be the system prompt ƒor the spawned agent.
Assistant
I’ll fold that into the plan. Quick check first: I’m verifying the current spawn/orchestrator split so the revised plan maps to the actual code shape instead of inventing a second path.
Assistant
<proposed_plan>
yyork spawn --type Orchestrator Plan
Summary
Today: yyork orchestrator is just a separate manual shim around the same spawn engine.
Better direction: delete the public separate command and make yyork spawn the single session creation API.
User UX target stays: yyork [projectPath] starts app and auto-ensures an orchestrator; orchestrator delegates workers by running yyork spawn --type worker --prompt ....
yyork spawn --type orchestrator --prompt "..." for manual/repair use.
Default --type=worker to preserve existing yyork spawn --prompt ....
Map --type to session.SpawnRequest.Kind.
worker: normal worker system prompt behavior, no default system prompt unless user passes --system-prompt-file.
orchestrator: use yyork’s orchestrator system prompt unless --system-prompt-file is passed.
Update root app startup:
yyork [projectPath] resolves the project.
app startup ensures exactly one live kind=orchestrator session for that project.
auto-spawn uses the same internal spawn helper as yyork spawn --type orchestrator.
Keep YYORK_PROJECT_PATH in spawned sessions so orchestrator-created workers target the original repo.
Engineering Work
CLI: add --type enum validation to spawn; remove or hide orchestrator from help.
App: add ProjectPath to app.Config; root command passes optional positional project path into it.
Session orchestration: add an EnsureOrchestrator(projectPath) helper that reuses existing rows before spawning.
Config: add/load default_agent, fallback claude-code, use it for auto-orchestrator and spawn default agent.
Docs/UI copy: document yyork [projectPath] and yyork spawn --type.
Test Plan
yyork spawn --prompt x creates a worker.
yyork spawn --type worker --prompt x creates a worker.
yyork spawn --type orchestrator --prompt x creates an orchestrator with orchestrator system prompt.
invalid --type fails with a clear error.
yyork /repo starts app and auto-spawns one orchestrator when missing.
repeated yyork /repo does not duplicate orchestrator.
</proposed_plan>
User
one thing that is left to design is how does user would get to know about this orchestrator?
Assistant
I’ll ground that in the current UI first. I’m checking how workspace.orchestrators is rendered today and where the first-run/empty-state surfaces live, then I’ll propose the smallest UX that makes the orchestrator obvious.
Assistant
<proposed_plan>
Orchestrator Discovery UX
Summary
Users should not learn about “orchestrator” from a CLI flag.
In the app, the orchestrator should feel like the project’s primary control thread: first visible, selected by default, and always reachable.
Current State
Backend can represent orchestrators via workspace.orchestrators.
Sidebar already renders an Orchestrator row when one exists.
Missing pieces: auto-selecting it, first-run visibility, and empty-state framing.
Key UX Changes
On yyork [projectPath], auto-ensure the project orchestrator and navigate to its terminal by default.
Sidebar: pin Orchestrator as the first row under the project, above worker groups, with terminal/agent styling distinct from worker rows.
Terminal header: show Orchestrator • <project name> so the user understands they are talking to the coordinator.
Empty worker board: when no workers exist but orchestrator exists, show a compact “No workers yet” state with an Open Orchestrator action.
Agent startup prompt: orchestrator should greet with a short actionable line like: “Tell me the tasks to delegate, and I’ll spawn isolated workers.”
Engineering Changes
Workspace layout selects orchestrator terminal as default when no explicit route/selection exists.
Sidebar keeps orchestrator visible even when worker groups are empty.
Empty-state logic distinguishes:
no project/session data
orchestrator exists, no workers yet
workers exist
Auto-spawn flow should store enough metadata for UI labels: kind=orchestrator, title=Orchestrator, project path/name.
Tests
First load with only orchestrator selects its terminal.
Sidebar shows Orchestrator before worker groups.
Empty worker board offers Open Orchestrator.
Existing worker selection routes still win over default orchestrator selection.
</proposed_plan>
User
not this "Terminal header: show Orchestrator • so the user understands they are talking to the coordinator."
not this "Empty worker board: when no workers exist but orchestrator exists, show a compact “No workers yet” state with an Open Orchestrator action." as well.
not this "Agent startup prompt: orchestrator should greet with a short actionable line like: Tell me the tasks to delegate, and I’ll spawn isolated workers." as well.
update in the plan
Assistant
<proposed_plan>
Orchestrator Discovery UX
Summary
Users should not need to learn a separate “orchestrator command.”
In the app, the orchestrator should be discoverable as the project’s primary agent thread: created automatically, visible in the sidebar, and selected by default.
Current State
Backend can represent orchestrators via workspace.orchestrators.
Sidebar already renders an Orchestrator row when one exists.
Missing pieces: auto-selecting it and making it consistently visible as the first project session.
Key UX Changes
On yyork [projectPath], auto-ensure the project orchestrator.
When the app opens with no explicit terminal/session route, select the orchestrator terminal by default.
Sidebar: show Orchestrator as the first row under the project, above worker groups.
Keep worker empty states generic; do not add an Open Orchestrator CTA.
Do not add special terminal-header labeling for the orchestrator.
Do not add a scripted greeting/startup prompt beyond the orchestrator’s normal task prompt/system instructions.
Engineering Changes
Workspace layout default-selection logic should prefer the active project’s orchestrator when no route-selected session exists.
Sidebar ordering should keep project orchestrator rows above worker groups.
Auto-spawn flow should store kind=orchestrator, title=Orchestrator, and project metadata so the existing UI can render it naturally.
yyork spawn --type orchestrator remains available for repair/manual use; the main discovery path is app auto-creation plus sidebar visibility.
Tests
First load with only an orchestrator selects its terminal.
Sidebar shows Orchestrator before worker groups.
Existing terminal/session routes still override default orchestrator selection.
Worker empty states remain unchanged.
</proposed_plan>
User
PLEASE IMPLEMENT THIS PLAN:
Orchestrator Discovery UX
Summary
Users should not need to learn a separate “orchestrator command.”
In the app, the orchestrator should be discoverable as the project’s primary agent thread: created automatically, visible in the sidebar, and selected by default.
Current State
Backend can represent orchestrators via workspace.orchestrators.
Sidebar already renders an Orchestrator row when one exists.
Missing pieces: auto-selecting it and making it consistently visible as the first project session.
Key UX Changes
On yyork [projectPath], auto-ensure the project orchestrator.
When the app opens with no explicit terminal/session route, select the orchestrator terminal by default.
Sidebar: show Orchestrator as the first row under the project, above worker groups.
Keep worker empty states generic; do not add an Open Orchestrator CTA.
Do not add special terminal-header labeling for the orchestrator.
Do not add a scripted greeting/startup prompt beyond the orchestrator’s normal task prompt/system instructions.
Engineering Changes
Workspace layout default-selection logic should prefer the active project’s orchestrator when no route-selected session exists.
Sidebar ordering should keep project orchestrator rows above worker groups.
Auto-spawn flow should store kind=orchestrator, title=Orchestrator, and project metadata so the existing UI can render it naturally.
yyork spawn --type orchestrator remains available for repair/manual use; the main discovery path is app auto-creation plus sidebar visibility.
Tests
First load with only an orchestrator selects its terminal.
Sidebar shows Orchestrator before worker groups.
Existing terminal/session routes still override default orchestrator selection.
Worker empty states remain unchanged.
Assistant
I’ll implement this end to end. I’m first re-reading the current CLI/app/session/UI paths so the edits stay tight and don’t trample the existing dirty worktree.
Assistant
The current implementation matches the plan gap: app startup never gets a project path and never spawns an orchestrator; the UI already has an orchestrator row but terminal default selection falls back to workers. I’m checking tests and helper types next so I can wire this with focused coverage.
Assistant
The CLI currently still exposes yyork orchestrator, and the home route only selects a terminal when the URL is already /terminal/.... I’m going to consolidate spawning behind spawn --type, pass project path into app startup, auto-ensure an orchestrator, then default the UI route to that orchestrator when there is no explicit route.
Assistant
The app’s / route is the board, and /terminal/$sessionId is the terminal route. To make the orchestrator selected on app open without changing terminal headers or empty-state CTAs, I’ll redirect from the base route to the orchestrator terminal when one exists and no explicit route is present.
Assistant
I’m going to use the existing session engine for the actual spawn and put duplicate-prevention there. That keeps the app startup path small: resolve project, reconcile stale rows, ensure one orchestrator, serve workspace.
Assistant
I found an older e2e around “restore last active terminal” that conflicts with blindly redirecting / to the orchestrator. I’ll preserve explicit terminal routes and stored worker selection, and only default to the orchestrator when there is no route-selected or selected worker.
Assistant
I’m adding the backend primitive now: a single EnsureOrchestrator path in the session engine plus a default orchestrator system prompt. The CLI and app will both use that instead of having separate orchestration logic.
Assistant
The engine now sets the orchestrator title to exactly Orchestrator and defaults system instructions based on Kind. I’m updating tests to lock both that and duplicate-prevention.
Assistant
Next I’m changing the CLI surface: spawn gets --type=worker|orchestrator, the separate orchestrator command disappears from help, and root accepts an optional project path for app startup.
Assistant
The root command now has the intended shape: yyork [projectPath] and yyork spawn --type .... I’m wiring the app startup to auto-ensure the orchestrator for that resolved project path.
Assistant
I’m updating the CLI tests so the public help now teaches spawn --type instead of a separate orchestrator command, and so invalid type fails before any engine work.
Assistant
I’m keeping the UI changes minimal: default route selection only. No terminal header changes, no empty-state CTA, no greeting text.
Assistant
That first UI patch exposed the ordering dependency in the layout calculations. I’m tightening it so the default project id is computed once and then reused for both orchestrator defaulting and board selection.
Assistant
I’m adding the UI regression test for the exact discovery behavior: only an orchestrator in the workspace should put the user into that terminal automatically, while existing explicit routes continue to win.
Assistant
I spotted a formatting typo in the new Playwright test closure; I’m fixing that before running checks.
Assistant
The typo is exactly the test terminator. I’ll patch it to the normal });.
Assistant
I’m updating the docs to show the actual user-facing flow now: start yyork for a project, then use spawn --type for manual worker/orchestrator repair cases.
Assistant
The implementation pieces are in place. I’m formatting the Go files now, then I’ll run focused tests to catch compile and behavior issues.
Two test issues surfaced: macOS reports temp git roots through /private/var, and root positional args mean yyork start is now parsed as a possible path rather than an unknown command. I’m adjusting the tests to match the new CLI contract.
Assistant
I’m rerunning gofmt and the focused backend tests after the test corrections.
Assistant
Focused backend tests are green. I’m running TypeScript compile now because the workspace-layout default route change is the riskiest frontend edit.
Assistant
TypeScript passes. I’m running the focused workspace unit test and then the full Go suite.
Assistant
Go and focused unit tests pass. I’m checking the web test scripts to run the narrow browser spec if there’s an existing command that starts the app correctly.
Assistant
There is a normal Playwright webServer config, so I’m running the single new browser scenario instead of the whole e2e suite.
Assistant
The new browser test failed because it was asserting on the topbar tab before the app exposed that tab in this scenario. I’m reading the Playwright error context to see what actually rendered, then I’ll align the test and implementation.
Assistant
The failure was a fixture schema miss (recap required), plus the topbar no longer exposes a literal Terminal tab in this layout. I’m adjusting the test to assert the actual terminal panel and socket instead.
Assistant
I’m rerunning the single browser test after fixing the fixture and assertions.
Assistant
The new browser scenario passes. I’m doing the final TypeScript check and whitespace check now, then I’ll review the diff for accidental extra surface changes.
Assistant
The final checks are clean. I’m doing a quick CLI help smoke check so I can confirm the user-facing surface is now yyork [projectPath] plus spawn --type, not yyork orchestrator.
Assistant
The help smoke check confirms the separate orchestrator command is gone from public help. I’m cleaning two flag descriptions so spawn --type orchestrator doesn’t still read worker-only.
Assistant
I’m formatting that tiny CLI copy change and rerunning the CLI package test.
Assistant
All targeted checks pass after the copy cleanup. I’m doing a final diff/whitespace review now.
Assistant
I’m picking up from the implementation state and doing a quick verification pass before I close this out. I’ll keep it focused: status, any obvious stale references, then the checks that matter for this change.
Assistant
The checkout is already very broad and dirty, so I’m staying on the orchestrator-specific files and not touching unrelated churn. I found a few stale fixture/compat labels saying “Project orchestrator”; I’m checking whether they affect runtime or just tests/stories before deciding whether to normalize them.
Assistant
The compat AO workspace provider still emits the old title, and some fixtures mirror it. Since the UX contract now says the row is simply Orchestrator, I’m going to normalize those labels rather than leave two competing names in tests/stories.
Assistant
One issue did turn up: the default project fallback currently checks projects[0] before workspace.activeProjectId, but the backend’s project list can come from a map. I’m changing that so orchestrator auto-selection honors the active project first.
Assistant
That patch keeps the visible orchestrator name consistent and fixes the active-project precedence. I’m formatting the Go file and then I’ll rerun the targeted checks.
Assistant
No stale “Project orchestrator” or hidden orchestrator-CTA strings are left in the checked source paths. Next I’m checking the UI test coverage around the root route so this doesn’t regress through route/default-selection behavior.
Assistant
I’m adding two narrow browser assertions rather than relying only on the implementation: one for sidebar order with a worker present, and one proving a direct terminal route still wins over the new orchestrator default.
Assistant
The route resolver matches a unique terminal session by ID without needing ?project=, so the override test can stay simple. I’m patching the e2e file now.
Assistant
The tests now cover the two route/sidebar rules from the plan. I’m going to run the focused e2e block first, then the backend/frontend compile checks.
Assistant
The new route/default tests passed; the sidebar-order assertion was too tightly scoped to a navigation landmark that doesn’t contain that row in this layout. I’m loosening the locator to the same global row locator the existing test already uses.
Assistant
I’ve corrected the locator issue and am rerunning the same three focused browser tests now.
Assistant
The route/default tests still pass. The existing project-tree test doesn’t actually expose an exact Orchestrator button at that point, so I’m reading the Playwright error snapshot to see what the accessible row name is before adjusting the assertion.
Assistant
The failure was not ordering; the fixture was invalid under the current workspace schema because both mocked sessions lacked recap. I’m fixing that fixture, then rerunning the focused set.
Assistant
The project-tree fixture is schema-valid now. I’m rerunning the same browser trio.
Assistant
The row’s visible text is Orchestrator, but its accessible button name is Open Orchestrator terminal; worker rows are similarly named by title. I’m aligning the test with the actual accessible names and keeping the visual ordering assertion.
Assistant
The locator now follows the actual a11y name on the sidebar row. Rerunning the focused browser tests again.
Assistant
Two of the three focused browser tests are already green; the remaining project-tree test is still running, so I’m waiting on that result instead of starting another check in parallel.
Assistant
The remaining failure is Playwright click mechanics: the row resolves and is visible, but the browser reports it outside the viewport during the click action. The old test used dispatchEvent for this row, so I’m keeping that style while retaining the new ordering assertions.
Assistant
I’ve restored the non-gesture dispatch for that row and am rerunning the focused browser set.
Assistant
That test had an older Terminal tab assertion; the current layout doesn’t expose that tab in this state. The terminal panel assertion is the right behavior check, so I’m removing the stale tab assertion.
Assistant
The stale tab assertion is gone. I’m rerunning the focused browser tests one more time.
Assistant
There was a second copy of that tab assertion in the same test. Removing that exact block now.
Assistant
That duplicate assertion is gone. Rerunning the same focused browser group.
Assistant
The focused browser coverage is green now. I’m running the backend suite, TS compile, focused unit tests, and whitespace check as the final verification pass.
Assistant
All final checks passed. I’m doing one last status/diff scan limited to the files I touched so the close-out can be precise.
Assistant
The implementation surface is as expected: app startup owns auto-ensure, spawn --type owns manual repair/spawn, and the default system prompt lives under session rather than tying yyork to another project. I’m checking the remaining CLI path resolver before finalizing.
Assistant
One more product mismatch: manual repair via yyork spawn --type orchestrator should not require a user prompt. I’m changing prompt validation so workers still require --prompt, while orchestrator repair can rely solely on the built-in system prompt.
Assistant
spawn --type orchestrator can now pass validation without --prompt, while default worker spawn still rejects a missing prompt before touching the project/store. I’m adding a small validation test for that distinction.
Assistant
The CLI validation test is in place. I’m formatting the CLI package and rerunning the affected checks.
Assistant
Formatting is done and there are no stale “prompt required” help strings for orchestrator. I’m rerunning Go plus the CLI help smoke; frontend checks don’t need to be repeated for this last CLI-only change.
Assistant
Go and CLI help are green after the prompt-validation change. I’m doing a final status check now.
Assistant
The code currently uses claude-code as the default agent in the new app-start orchestrator path. I’m checking whether yyork already has a real default-agent config source so this follows existing config instead of hard-coding unnecessarily.
Assistant
There’s no user-facing default-agent setting in the current config package, so using the existing claude-code default is the repo’s current behavior. I’m checking the agent launchers once for no-prompt orchestrator compatibility.
Assistant
Implemented.
Key changes:
yyork [projectPath] now resolves the git root and app startup auto-ensures a project orchestrator.
yyork spawn --type worker|orchestrator is wired; worker still requires --prompt, orchestrator repair does not.
Orchestrator sessions store kind=orchestrator, role=orchestrator, title=Orchestrator, plus project/session env metadata for nested worker spawns.
Root workspace load now defaults to the active project’s orchestrator terminal unless an explicit terminal/session route exists.
Sidebar keeps Orchestrator above worker groups; no special terminal header, empty-state CTA, or scripted greeting was added.
Main files: internal/app/app.go, internal/session/engine.go, internal/session/orchestrator.go, internal/cli/commands.go, web/src/features/home/pages/workspace-layout.tsx, web/e2e/root.spec.ts.
Verified:
direnv exec . go test ./...
pnpm --dir web exec tsc --noEmit
pnpm --dir web exec vitest run src/features/home/data/workspace.unit.spec.ts src/features/home/domain/session-workspace.unit.spec.ts
pnpm --dir web exec playwright test e2e/root.spec.ts -g "orchestrator session is reachable|root route selects the project orchestrator|terminal session route overrides"
git diff --check
direnv exec . go run . --help
direnv exec . go run . spawn --help
The Playwright run still logs Vite proxy ECONNREFUSED noise for mocked API/files/events paths, but the targeted tests pass.
User
Selected text:
Selection 1
The Playwright run still logs Vite proxy ECONNREFUSED noise for mocked API/files/events paths, but the targeted tests pass.
My request for Codex:
fix this using another thread in codex.
Assistant
I’ll spin this off instead of continuing the fix inline here. First I’m locating the Codex thread tool so I can hand the exact task and context to a new thread.
Assistant
I’m creating a separate worktree thread from the current working tree so it can see the orchestrator changes and fix only the noisy test/proxy issue without trampling this thread’s context.
Assistant
Created a separate Codex worktree thread to fix the Playwright/Vite proxy ECONNREFUSED noise, starting from the current working tree so it sees the orchestrator changes.
now I want you to use the iab where you act as my chauffer and tell me what is the visual result of the code changes you have made.
Assistant
I’ll use the in-app browser for this. First I’m loading the Browser skill instructions, then I’ll start/open the local app and inspect the orchestrator UX visually.
Assistant
I’m going to run the frontend with mocked workspace data so the browser shows the exact orchestrator states without spawning a real agent. This avoids touching the live yyork store or starting Claude/Codex just for a visual check.
Assistant
The Vite frontend is starting on a dedicated local port. I’ll connect the in-app browser once it reports ready.
Assistant
The frontend is up at http://127.0.0.1:5177/. I’m connecting the in-app browser now and will keep it visible while I inspect the screen.
Assistant
The in-app browser API doesn’t expose network route stubbing directly, so I’m going to stand up a tiny local fake yyork API on 127.0.0.1:7331. Vite will proxy to it, which lets the real frontend render the orchestrator state cleanly in the IAB.
Assistant
I found the exact API shapes the frontend expects. I’m starting a tiny fake backend for /api/workspace, /api/events, files, and terminal WebSocket so the real app can render without proxy errors.
Assistant
The fake backend is listening, so Vite can load the real frontend with clean API responses. I’m bringing the IAB up now and navigating to the demo state.
Assistant
The browser did not have a selected tab yet, so I’m opening a fresh IAB tab explicitly.
Assistant
The app is open in the IAB. I’m taking a snapshot/screenshot now so I can describe the visible result accurately instead of guessing from the code.
Assistant
The screenshot call timed out, but the page is still open. I’m switching to a DOM/visible-state read first, then I’ll retry a lighter screenshot if needed.
Assistant
The first visible read confirms the new default: the app opened straight into Orchestrator terminal. The sidebar is currently not in the snapshot, likely because the stored layout has it collapsed, so I’m going to expand/reset the viewport state and inspect the project tree too.
Assistant
I don’t want to infer sidebar state from the absence of text, so I’m listing the visible button labels and layout dimensions from the page. Then I’ll use the app’s own controls to reveal the project tree if it is collapsed.
Assistant
Visible-state read confirms the sidebar content exists off-canvas and the current URL is already /terminal/orchestrator-demo. I’m clicking the app’s Expand project sidebar control so you can see the project tree result in the IAB.
Assistant
Now the sidebar is visible in the IAB: Orchestrator sits directly under the yyork project, with the Working group and Worker task below it. I’m checking console/network noise next so I can report whether the fake API kept the page clean.
Assistant
The browser console has no proxy connection errors; it only shows an unrelated React warning about a script tag in a rendered component. I’m also checking the local server output for backend proxy noise.
Assistant
No proxy noise is showing in either server output. I’ll try one lighter screenshot now; if capture still hangs, I’ll stick to the live DOM/visible-state observations.
Assistant
The screenshot captured the visual state: sidebar expanded, Orchestrator selected, worker group below it, and the terminal opened as the default view. I’m stopping the temporary Vite and fake API servers now so they don’t hold ports.
Assistant
IAB visual result:
Root opened straight into the orchestrator terminal route: /terminal/orchestrator-demo.
Sidebar expanded view shows:
Project: yyork
First session row: Orchestrator, selected/highlighted
Then Working group with count 1
Then worker row: Worker task
Main panel is just the terminal, with no special orchestrator header copy or greeting added.
Empty/pinned area stayed generic: No pinned sessions.
No Open Orchestrator empty-state CTA appeared.
I used a fake local API so this rendered the real frontend without spawning a real Claude/Codex agent. No Vite proxy errors showed during the IAB run; only one unrelated React warning about a script tag appeared in the browser console.
alright now run yyork ~/Projects/skills and show me around
Assistant
I’ll run the real yyork ~/Projects/skills now, then point the in-app browser at the app and walk the visible UI. This will use yyork’s actual startup path, so if it needs to create the project orchestrator it may spawn a real agent session.
Assistant
yyork is not on the non-interactive shell PATH here. I’m going through the repo’s dev environment instead, which is how this checkout exposes the CLI locally.
Assistant
The dev alias routes through portless and the yyork.localhost name is already owned by another running process. I’m bypassing that alias and starting the local Go server directly on 127.0.0.1:7331 for ~/Projects/skills.
Assistant
The failed portless run exited cleanly. I’m checking the API port and then starting go run . ~/Projects/skills --open=false so I can drive it through the IAB.
Assistant
Port 7331 is free and ~/Projects/skills is a git repo, so the direct server path should work. Starting it now.
Assistant
The real server is starting. I’m waiting for startup output before opening the browser, because orchestrator creation can do some setup work before the listener is ready.
Assistant
No banner yet, but the process is alive. I’m checking whether it has bound the HTTP port or is still in orchestrator/session setup.
Assistant
The yyork server is listening on 127.0.0.1:7331. I’m opening that in the in-app browser and then I’ll describe what’s on screen.
Assistant
The IAB is on the real yyork server. I’m reading the visible page state now and will expand/navigate only if the UI needs it.
Assistant
The app loaded, but visually it is on the board rather than the orchestrator terminal. The sidebar does show skills with an Orchestrator row under Working; I’m waiting a moment and checking whether the default terminal redirect kicks in or if persisted route/layout state is keeping the board visible.
Assistant
Important visual finding: the real skills run did create an orchestrator, but the UI is rendering it as a worker card under Working, not as the separate first Orchestrator row. I’m checking the raw workspace response to confirm whether this is frontend rendering or backend session metadata.
Assistant
Raw backend data is correct: /api/workspace has h502hg in orchestrators with kind=orchestrator, and no skills workers in sessions. The page looks stale against that response, so I’m reloading the app and re-reading the visible state.
Assistant
This is the embedded dashboard from go run ., not the live Vite frontend bundle. The backend state is correct, but the embedded UI is stale relative to the code changes. I’m keeping the real yyork backend running and opening the current frontend source through Vite against it, which is the right way to see the visual result of the changes in this checkout.
Assistant
The current frontend is starting. I’ll open it once Vite is ready; it will proxy to the real skills yyork backend on 7331.
Assistant
Vite is ready. I’m moving the IAB to the current frontend and checking the real skills view again.
Assistant
Now we’re seeing the current source correctly: it auto-navigated to /terminal/h502hg, selected the skills orchestrator, and put it above worker groups. I’m taking a screenshot so I can give you a visual walkthrough tied to what’s actually on-screen.
Assistant
The terminal is attached to Zellij and is currently showing Zellij’s startup tips over the Claude Code pane. I’m going to dismiss that overlay with Escape so we can see the actual orchestrator session.
Assistant
The overlay is dismissed at the DOM level and focus is in the terminal. I’m grabbing the viewport again so I can describe the actual current screen.
Assistant
This is the live orchestrator terminal: Claude Code is attached inside Zellij, no custom yyork greeting/header was added, and the sidebar has Orchestrator as the selected primary row for skills. I’m clicking the skills board next to confirm the worker board stayed generic.
Assistant
The board view is clean: the orchestrator is not counted as a worker card anymore, so all worker columns are 0. I’m capturing that view too.
Assistant
I ran it and have the IAB on the live skills view.
One caveat: plain yyork was not on this shell’s PATH, and direnv exec . yyork ~/Projects/skills hit an existing yyork.localhost portless registration. So I started the real backend with direnv exec . go run . ~/Projects/skills --open=false, then opened the current frontend source through Vite at http://127.0.0.1:5177.
Visual result:
It auto-created/loaded the skills orchestrator session h502hg.
Current source correctly auto-navigates to /terminal/h502hg.
Sidebar shows skills with Orchestrator as the primary row directly under the project.
The terminal is a normal Claude Code session inside Zellij. No custom yyork header, no scripted greeting.
Board view for skills has all worker columns at 0, so the orchestrator is no longer rendered as a worker card.
yyork also appears as another project in the sidebar because there are existing yyork sessions in the store.
I left the real backend and Vite frontend running so you can keep poking around in the IAB.
why it is not running on yyork.localhost. what am i doing wrong that you keep forgetting yar
Assistant
You’re not doing anything wrong. I bypassed the repo’s portless path after yyork.localhost reported it was already owned by another process, then I forgot to steer back to the named URL once I had the app running. I’m checking the registered process now and will put the IAB on the correct yyork.localhost route if it’s live.
Assistant
The named route is alive: http://yyork.localhost redirects to https://yyork.localhost through portless. The reason you’re seeing 127.0.0.1:5177 is my fallback, not your setup. I’m switching the IAB to the portless URL now.
Assistant
https://yyork.localhost is serving, but it is a different already-running yyork dev stack: its workspace API says active project is skills, but it currently returns 0 orchestrators and 4 sessions. That means the registered yyork.localhost process is stale relative to the code I just ran on 7331/5177. I’m opening it so we can see exactly what that live named route shows.
Assistant
That confirms the problem: the named URL is real, but it is the old portless-owned dev stack. It is showing the stale behavior where h502hg appears as a worker card instead of the new orchestrator row. I’m going to check the local yyork/portless help before using --force, because I don’t want to guess that flag’s behavior.
Assistant
The running yyork.localhost owner is a pnpm dev stack that has been up for about 27 hours. Its backend is yyork dev from an older Go build temp path and its frontend is a Vite process, so that explains the stale UI on the named URL. I’m waiting for the help output now so I can restart the named stack correctly.
Assistant
--force is exactly the takeover flag: it kills the existing process and takes over the route. I’m going to use that now for yyork.localhost with ~/Projects/skills.
Assistant
The standalone portless binary is not exposed directly in this shell, but the repo’s yyork dev shortcut wraps it. I’m checking the package script wiring so I pass --force through the right layer.
Assistant
The repo script is dev: portless run; when you pass ~/Projects/skills to that wrapper, it becomes a command argument to portless, not a yyork project-path argument. That’s part of the confusion. I’m checking portless.json/dev wiring now so I can use the named route without fighting the wrapper.
Assistant
The underlying bug is sharper now: pnpm dev/portless runs yyork dev, and yyork dev currently has no project-path argument, so it can own yyork.localhost but not model the exact yyork ~/Projects/skills product path. For this walkthrough I’m going to keep the real yyork ~/Projects/skills backend on 7331, then make yyork.localhost proxy the current Vite frontend to that backend.
Assistant
I stopped my temporary direct Vite server. Now I’m taking over yyork.localhost with portless and wiring it to the real skills backend.
Assistant
yyork.localhost has been taken over and the stale 27-hour process was killed. I’m waiting for Vite to finish binding, then I’ll reload the IAB at the named URL.
Assistant
The named route is now backed by the current frontend. I’m reloading the IAB at https://yyork.localhost and verifying the orchestrator state.
Assistant
yyork.localhost is fixed now and the IAB is on https://yyork.localhost/terminal/h502hg. The route is no longer 127.0.0.1:5177. I’m expanding the skills project in the sidebar so the visual state matches what you were asking for.
Assistant
You’re not doing anything wrong. I did two wrong things:
I saw yyork.localhost was already registered by an old portless process, then I bypassed it with raw 127.0.0.1:5177.
I forgot that in this repo the expected visual surface is always the portless route, not the raw Vite port.
The old yyork.localhost process had been running for ~27 hours, so it was serving stale code. That’s why it showed h502hg as a worker card. I took it over with portless --force, and the IAB is now at:
https://yyork.localhost/terminal/h502hg
Current visible state:
skills is expanded in the sidebar.
Orchestrator is the primary row under skills.
Main panel is Orchestrator terminal panel.
The raw 127.0.0.1:5177 route is no longer the one I’m showing you.
One real engineering gap remains: the dev shortcut path (pnpm dev / portless / yyork dev) does not currently accept ~/Projects/skills as a project path the same way product yyork ~/Projects/skills does. We should wire that next so yyork.localhost naturally exercises the same project-path startup path.
look always remember to use the $portless skill and use yyork.localhost when working on yyork project
User
Portless
Replace port numbers with stable, named .localhost URLs. For humans and agents.
Why portless
Port conflicts: EADDRINUSE when two projects default to the same port
Memorizing ports: which app is on 3001 vs 8080?
Refreshing shows the wrong app: stop one server, start another on the same port, stale tab shows wrong content
Monorepo multiplier: every problem scales with each service in the repo
Agents test the wrong port: AI agents guess or hardcode the wrong port
Cookie/storage clashes: cookies on localhost bleed across apps; localStorage lost when ports shift
Hardcoded ports in config: CORS allowlists, OAuth redirects, .env files break when ports change
Sharing URLs with teammates: "what port is that on?" becomes a Slack question
Browser history is useless: localhost:3000 history is a mix of unrelated projects
Installation
Install globally (recommended) or as a project dev dependency. Do NOT use npx or pnpm dlx for one-off execution.
bash
# Global (available everywhere)
npm install -g portless
# Or per-project dev dependency
npm install -D portless
When installed per-project, invoke via package.json scripts or npx portless (since the package is local, npx will not download anything).
Quick Start
bash
# Install globally (or add -D to a project)
npm install -g portless
# Run your app (auto-starts the HTTPS proxy on port 443)
portless run next dev
# -> https://<project>.localhost
# Or with an explicit name
portless myapp next dev
# -> https://myapp.localhost
The proxy auto-starts when you run an app. You can also start it explicitly with portless proxy start. Auto-start reuses the configuration (port, TLS, TLD) from the most recent proxy run, so a restart or reboot does not silently revert to defaults. Explicit env vars always take priority.
Assistant
Using the portless skill for this. I’m also going to persist this as a local memory note because you said “always remember,” and this is exactly the kind of repo-specific workflow preference I should carry forward.
Assistant
The skill confirms the rule: stable .localhost URLs are the canonical human/browser surface, and --force is the correct takeover when a stale route exists. I’m writing the memory note now.
Assistant
The notes directory exists. I’ll add one small memory note with the exact yyork/portless preference.
Assistant
Got it. I added a memory note for this.
Going forward on yyork:
I’ll use the repo-local portless skill first.
I’ll treat https://yyork.localhost as the canonical browser URL.
I won’t default to raw 127.0.0.1:<port> for IAB walkthroughs.
If yyork.localhost is stale or already owned, I’ll inspect/take over the portless route instead of quietly switching to a raw Vite port.
I’m checking the live source rather than relying on memory, because there are two different concepts here: the initial user prompt and the system/developer instructions passed to the agent.
Assistant
The live row has no stored prompt key, which confirms startup did not send an initial user prompt. I’m checking the Claude launch wiring for the exact flag shape.
Assistant
For the auto-created orchestrator, we pass no initial user prompt.
What yyork passes is only an appended system/developer instruction via Claude Code’s --append-system-prompt:
text
You are the yyork project orchestrator.
Your job is to break user goals into scoped worker tasks and delegate implementation to yyork worker agents.
Prefer inspecting context first, then spawn workers with yyork spawn --type worker --prompt "<task>".
Workers spawned from this session automatically target the original project through YYORK_PROJECT_PATH.
Use yyork session list to inspect sessions, yyork send --session <id> "<message>" to follow up, and yyork stop <id> to stop work.
Stay out of implementation branches unless explicitly asked; focus on coordination, triage, and delegation.
Source: internal/session/orchestrator.go
The startup path calls EnsureOrchestrator with only ProjectPath, so Prompt is empty: internal/app/app.go. Claude receives that as --append-system-prompt, and no -- <prompt> positional prompt is added unless cfg.Prompt is non-empty: internal/plugin/agent/claudecode/claudecode.go.
I also checked live session h502hg: its store metadata has kind/role/title, but no prompt key.
I’ll verify this from code, not just eyeball the screenshots. The terminal shell should be the same component/path; any visible difference should either be label/route plumbing or Zellij/agent state inside the pane.
Assistant
So far the frontend only branches on kind for the accessible label and command-palette wording. I’m checking the terminal panel/style path to confirm there is no CSS/layout branch for orchestrator.
Assistant
The component renders the same <Terminal>/<XTermTerminal> with the same ao-terminal class for both. I’m checking the live workspace rows now to compare their attach commands and session metadata.
Assistant
Yeah, there should not be a special visual terminal treatment for orchestrator.
I checked the code: both worker and orchestrator go through the same TerminalPanel, same .ao-terminal class, same xterm/wterm renderer, same WebSocket attach flow, and same Zellij attach config. The only frontend branch is the accessibility label:
orchestrator: Orchestrator terminal
worker: <workerId> terminal
That is not a visible header/style.
What you’re seeing in the screenshots is coming from inside the attached Zellij/Claude session, not from yyork rendering it differently:
Different Zellij session ids: h502hg vs k94avd
Different Claude pane title/content: orchestrator has its coordinator/system context; worker has the task prompt
Different pane/status accent colors are Zellij/terminal output bytes, not a React style branch
Source points:
Same terminal component/style: terminal-panel.tsx
Only kind-specific terminal difference is label: terminal-panel.tsx
Same Zellij attach command builder, no kind branch: workspace_source.go
So: yyork’s terminal shell is not intentionally different. The visible difference is the running agent/session content inside the terminal.
User
also what happened to the colors? All of sudden it(terminal rendering) all looks monochromatic.
Assistant
I’ll treat https://yyork.localhost as the source of truth here and inspect the live terminal rendering plus the terminal theme code. The screenshots suggest this is likely terminal palette/theme plumbing, not orchestrator-specific UI.
Assistant
I’m going to anchor this on the actual renderer path, not guess from the screenshots. The likely issue is terminal backend/color handling, not orchestrator-specific UI.
Assistant
The source points to a concrete change: the panel now defaults to xterm.js, and xterm is applying a high contrast correction on top of yyork’s ANSI palette. That can make unrelated ANSI colors converge toward the foreground color, which reads as grayscale/monochrome in dark mode.
Assistant
I’m using the in-app Browser workflow for the live page only to confirm what renderer the current tab is using; the repo evidence already shows where the behavior is coming from.
Assistant
I’ve got the code-side cause. I’m doing one light browser read now so I can tell whether the current visible tab is on the xterm path or someone manually flipped it back to wterm.
Assistant
The browser connection already had some state from the earlier inspection, so I’m reusing that rather than resetting the session.
Assistant
The browser API is connected; I’m keeping this read-only and checking only the selected yyork tab’s renderer state.
Assistant
The page sandbox blocked direct localStorage access by shorthand. I’ll use a safer read off window and keep the check bounded.
Assistant
The colors changed because you’re now on https://yyork.localhost, and that origin has no saved terminal backend preference. Current live tab has:
ao-terminal-backend = null and .xterm is mounted.
So yyork falls back to the default in terminal-panel.tsx: xterm, not wterm.
The monochrome look is from xterm’s color handling, mainly this setting in xterm-terminal.tsx:
minimumContrastRatio: 4.5
That makes xterm auto-adjust ANSI colors to hit contrast targets. Combined with Zellij sending ANSI palette indexes from zellijconfig.go, several colors get pushed closer to foreground white/gray, so it reads flattened.
So: not orchestrator-specific. The renderer path changed because yyork.localhost has separate localStorage from the old raw port URL, and the xterm default is more aggressive about contrast than the old wterm rendering. The right code fix is probably to lower/disable minimumContrastRatio for dark mode, while keeping the light-mode guard.
User
so what you are gonna do about it then?
Assistant
I’m going to patch the xterm path so dark-mode terminals preserve the ANSI palette instead of letting xterm flatten it. I’ll keep the light-mode contrast protection, then run the focused frontend checks and reload yyork.localhost to verify the live renderer.
Assistant
I’m using the repo-local portless convention for verification, but the code edit itself is isolated to the xterm terminal component.
Assistant
I’m about to edit only web/src/features/home/components/organisms/xterm-terminal.tsx: compute whether the terminal host is in dark mode, then use xterm’s default contrast ratio in dark mode and keep the stricter ratio for light mode.
Assistant
The patch is in. I’m checking the project scripts and then I’ll run the smallest useful verification set around this component.
Assistant
Typecheck and the targeted terminal-panel browser tests passed. Prettier wants to reflow the helper, so I’m applying the formatter to this one file and then I’ll re-run the same checks.
Assistant
The file is formatted. I’m re-running the checks and then I’ll reload the live yyork.localhost tab to confirm xterm is still active and using the dark-mode contrast path.
Assistant
Checks are clean. I’m reloading the visible https://yyork.localhost terminal now so the patched xterm component mounts fresh against the same live session.
Assistant
The browser scripting session had a stale variable name, so I’m retrying the same reload with scoped bindings.
Assistant
The live tab came back on https://yyork.localhost/terminal/h502hg, still using xterm, with color-scheme: dark; that means the new path is taking the lowered contrast setting. I’m grabbing one screenshot to visually sanity-check the result.
Assistant
The screenshot now shows the Zellij tab/status accents back as colored green/blue/magenta instead of all washing toward white. I’m doing one final diff check so I can report the exact change cleanly.
Assistant
The final diff is only in the xterm wrapper file for this fix, although that file already had prior uncommitted changes in this dirty checkout. I’m checking whitespace just on the touched file now.
Assistant
I patched the xterm renderer instead of papering it over by switching back to wterm.
The fix is in xterm-terminal.tsx: it now detects color-scheme: dark and sets xterm minimumContrastRatio to 1 only in dark mode. Light mode keeps 4.5 so low-contrast colors still do not disappear on white backgrounds.
Live https://yyork.localhost/terminal/h502hg is still using xterm, still dark mode, and the Zellij/Claude accents are visibly colored again: green tab/status, blue line, magenta focus marker.
Verified:
pnpm --dir web exec tsc --noEmit
pnpm --dir web exec vitest run src/features/home/components/organisms/terminal-panel.browser.spec.tsx
pnpm --dir web exec prettier --check src/features/home/components/organisms/xterm-terminal.tsx
why does the project list is diff here? you see in one ss, yyork comes before skills dir and in another ss, skills comes before yyork's dir? why is that?
I’m checking where the sidebar order is derived now (UI sort vs backend order), then I’ll map that to why one snapshot shows yyork first and another shows skills first.
Assistant
I found the likely source: project rows are populated from a Go map and then iterated directly into an array, which is intentionally not ordered. I’m confirming with the workspace-source test quickly and then I’ll answer with the exact cause and why it flips between renders.
Assistant
I can confirm from code that ordering is backend-derived, but I can also read the exact visible row labels in your current tab so we can map it directly. I’m doing a tiny DOM read only.
Assistant
This is expected from current code, not a terminal rendering/model issue.
yyork vs skills swapping is coming from projects ordering in workspace payload:
Backend builds projectIndex as a map[string]Project and then appends to a slice with range over the map: internal/session/workspace_source.go.
Go map iteration is not ordered, so project order can change across runs/reloads.
UI does not reorder there; it renders workspace.projects directly: web/src/features/home/pages/workspace-layout.tsx -> web/src/features/home/components/organisms/project-orchestrator-sidebar.tsx.
So any screenshot can show different project row order if the map-to-slice order differs.
If you want a stable list, sort projects once before send or before render (alphabetical by project.name or id), and both screenshots will stay consistent.
what are my options to mk it ordered from the backend?
Assistant
Here are your backend-only options in order of practicality:
Deterministic insertion-order list (recommended minimal change)
Keep a separate []string of project IDs in first-seen order while iterating rows, then build projects from that ordered list instead of ranging over the map.
Deterministic and preserves user-visible “activity-ish” order from session rows.
Implement in internal/session/workspace_source.go.
Alphabetical order
Build from projectIndex then sort.Slice by project.Name (or project.ID).
Very predictable and expected UX for many users.
Implement in internal/session/workspace_source.go.
Explicit activity order via DB timestamp
Sort projects by latest created_at (or last updated) per project using stored rows before returning.
Needs a little more data shaping but gives “most recent project first” behavior.
Either derive from current row walk or extend data source query to compute a per-project max timestamp.
API-level canonical ordering
If the frontend should always get sorted output, enforce it at API boundaries in a single homeWorkspaceQuery path and keep downstream untouched.
You’d still sort in backend, but at the adapter layer that returns JSON to UI.
Given your current shape (projects is already map-derived), option 1 is the cleanest and least invasive.
If you want, I can implement option 1 and add a regression test in internal/session/workspace_source_test.go so this never regresses.
could backend sort it in the order of datetime the project was added?
Assistant
I’ll verify the exact Session row timestamp fields so I can give you the precise backend approach and avoid guessing.
Assistant
Got it. I’ll implement this backend-side now so project ordering is stable and based on when the workspace/project was first added, then verify with an API-focused test check so the sidebar receives deterministic order.
Assistant
I found the backend source. I’ll add deterministic ordering there and update/add tests so this can’t regress.
Assistant
I’ll make the ordering deterministic in StoreWorkspaceSource by computing a per-project “first session created” timestamp from persisted created_at, then sorting projects by that timestamp before returning. Then I’ll adjust unit tests to cover ordering and tie-break behavior.
Assistant
I’m going through direnv and running the repository formatter/tests in the dev shell so we don’t get toolchain false negatives.
Assistant
I’ll tighten one edge case in the comparator so zero timestamps don’t accidentally override real values, then re-run tests.
Assistant
Yes—done. I implemented it on backend so project order is deterministic by project add timestamp.
I updated internal/session/workspace_source.go to:
Track per-project addedAt from persisted session CreatedAt.
Sort projects by that timestamp (currently oldest → newest, with name tiebreaker).
Keep returning the list as Projects so frontend gets ordered data directly.
I also added coverage in internal/session/workspace_source_test.go to assert ordering by add time.
Verification: direnv exec . go test ./internal/session passes.
If you want newest-first instead, I can flip one comparator line (Before → After) and re-run tests.
In non-interactive environments (no TTY, or CI=1), portless exits with a descriptive error instead of prompting. Task runners like turborepo should pre-start the proxy.
Integration Patterns
Zero-config (recommended)
Bare portless works out of the box. It runs the "dev" script from package.json through the proxy, inferring the app name from the package name, git root, or directory:
bash
portless # -> runs "dev" script, https://<project>.localhost
pnpm dev # -> works without portless, plain "next dev"
Use an optional portless.json to override defaults (name, script, port):
portless # from repo root: start all packages with a "dev" script
cd apps/web && portless # start just one package
portless --script start # run "start" instead of "dev"
The apps map is optional and only provides name overrides. Unlisted packages auto-discover with inferred names.
Without an apps map, hostnames follow <package>.<project>.localhost. The project name comes from the most common npm scope (e.g. @myorg/web and @myorg/api produce myorg), falling back to the workspace root directory name. If a package's short name matches the project name, it uses the bare <project>.localhost.
Turborepo
For turborepo projects, use portless as the dev script with the real command in a separate script:
pnpm dev runs turbo, which runs portless in each package. Portless detects the package manager and runs pnpm run dev:app through the proxy.
package.json scripts
You can still use portless directly in scripts:
json
{
"scripts": {
"dev": "portless run next dev"
}
}
The proxy auto-starts when you run an app. Or start it explicitly: portless proxy start.
Multi-app setups with subdomains
bash
portless myapp next dev # https://myapp.localhost
portless api.myapp pnpm start # https://api.myapp.localhost
portless docs.myapp next dev # https://docs.myapp.localhost
By default, only explicitly registered subdomains are routed (strict mode). Start the proxy with --wildcard to allow any subdomain of a registered route to fall back to that app (e.g. tenant1.myapp.localhost routes to the myapp app). Exact matches always take priority over wildcards.
Git worktrees
portless run automatically detects git worktrees. In a linked worktree, the branch name is prepended as a subdomain prefix so each worktree gets a unique URL:
bash
# Main worktree (no prefix)
portless run next dev # -> https://myapp.localhost
# Linked worktree on branch "fix-ui"
portless run next dev # -> https://fix-ui.myapp.localhost
No config changes needed. Put portless run in package.json once and it works in all worktrees.
Bypassing portless
Set PORTLESS=0 to run the command directly without the proxy:
bash
PORTLESS=0 pnpm dev # Bypasses proxy, uses default port
How It Works
portless proxy start starts an HTTPS reverse proxy on port 443 as a background daemon. Auto-elevates with sudo on macOS/Linux; falls back to port 1355 if sudo is unavailable. Use --no-tls for plain HTTP on port 80. Configurable with -p / --port or the PORTLESS_PORT env var. The proxy also auto-starts when you run an app.
portless <name> <cmd> assigns a random free port (4000-4999) via the PORT env var and registers the app with the proxy
The browser hits https://<name>.localhost; the proxy forwards to the app's assigned port
.localhost domains resolve to 127.0.0.1 natively in Chrome, Firefox, and Edge. Safari relies on the system DNS resolver, which may not handle .localhost subdomains on all configurations. Run portless hosts sync to add entries to /etc/hosts if needed.
Most frameworks (Next.js, Express, Nuxt, etc.) respect the PORT env var automatically. For frameworks that ignore PORT (Vite, VitePlus, Astro, React Router, Angular, Expo, React Native), portless auto-injects the correct --port flag and, when needed, a matching --host CLI flag.
State directory
Portless stores its state (routes, PID file, port file) in ~/.portless. Override with the PORTLESS_STATE_DIR environment variable.
Environment variables
Variable
Description
PORTLESS_PORT
Override the default proxy port (default: 443 with HTTPS, 80 without)
PORTLESS_APP_PORT
Use a fixed port for the app (skip auto-assignment)
PORTLESS_HTTPS
HTTPS on by default; set to 0 to disable (same as --no-tls)
PORTLESS_LAN
Set to 1 to always enable LAN mode (auto-detects LAN IP)
PORTLESS_TLD
Use a custom TLD instead of localhost (e.g. test)
PORTLESS_WILDCARD
Set to 1 to allow unregistered subdomains to fall back to parent
PORTLESS_SYNC_HOSTS
Set to 0 to disable auto-sync of /etc/hosts (on by default)
PORTLESS_TAILSCALE
Set to 1 to share apps on your Tailscale network (same as --tailscale)
PORTLESS_FUNNEL
Set to 1 to share apps publicly via Tailscale Funnel (same as --funnel)
PORTLESS_STATE_DIR
Override the state directory
PORTLESS=0
Bypass the proxy, run the command directly
HTTP/2 + HTTPS
HTTPS with HTTP/2 is enabled by default (faster page loads for dev servers with many files). First run generates a local CA and adds it to the system trust store. After that, no prompts and no browser warnings.
bash
portless proxy start --cert ./c.pem --key ./k.pem # Use custom certs
portless proxy start --no-tls # Disable HTTPS (plain HTTP)
portless trust # Add CA to trust store later
On Linux, portless trust supports Debian/Ubuntu, Arch, Fedora/RHEL/CentOS, and openSUSE (via update-ca-certificates or update-ca-trust). On Windows, it uses certutil to add the CA to the system trust store.
--lan advertises <name>.local hostnames over mDNS so any device on the same Wi-Fi can reach your apps. Portless auto-detects your LAN IP and follows network changes automatically, but you can pin a specific address with --ip <address> or the PORTLESS_LAN_IP environment variable. Set PORTLESS_LAN=1 to default to LAN mode every time the proxy starts.
Portless remembers LAN mode via proxy.lan, so if you stop a LAN proxy and start again, it stays in LAN mode. All proxy settings (port, TLS, TLD, LAN) are persisted and reused on auto-start unless overridden by explicit flags or env vars. Use PORTLESS_LAN=0 for one start to switch back to .localhost mode. If a proxy is already running with different explicit LAN/TLS/TLD settings, portless warns and asks you to stop it first.
LAN mode depends on the system mDNS helpers that portless launches: macOS includes dns-sd, while Linux uses avahi-publish-address from avahi-utils (install via sudo apt install avahi-utils or your distro’s tooling).
Next.js: add your .local hostnames to allowedDevOrigins:
Expo / React Native: portless always injects --port. React Native also gets --host 127.0.0.1. Expo gets --host localhost outside LAN mode, but in LAN mode portless leaves Metro on its default LAN host behavior instead of forcing --host or HOST.
Tailscale sharing
Share dev servers with teammates on your Tailscale network using --tailscale, or expose to the public internet with --funnel:
bash
portless myapp --tailscale next dev
# -> https://myapp.localhost (local)
# -> https://devbox.yourteam.ts.net (tailnet)
portless myapp --funnel next dev
# -> https://myapp.localhost (local)
# -> https://devbox.yourteam.ts.net (public internet)
Tailscale HTTPS certificates must be enabled before --tailscale or --funnel can register HTTPS URLs. Funnel must also be enabled for the tailnet and node before --funnel can register the public URL. If either setting is missing, portless exits before starting the child process.
Each --tailscale app is root-mounted on its own Tailscale HTTPS port (443, then 8443, 8444, etc.) so no framework basePath configuration is needed. Set PORTLESS_TAILSCALE=1 to share every app by default. portless list shows both local and tailnet URLs. Tailscale serve registrations are cleaned up when the app exits. Requires tailscale CLI installed and connected, with Tailscale HTTPS certificates enabled.
OS startup service
Use the service command when users want the proxy to start automatically after reboot:
bash
portless service install
portless service status
portless service uninstall
The service uses the default clean URL behavior: HTTPS on port 443 with .localhost names. macOS and Linux install a root-owned service so port 443 can bind at boot. Windows installs a Task Scheduler startup task that runs as SYSTEM. Installation and removal may require administrator privileges. portless clean automatically removes the service.
CLI Reference
Command
Description
portless
Run dev script through proxy
portless
From monorepo root: run all workspace packages
portless --script <name>
Run a specific package.json script (default: dev)
portless run [cmd] [args...]
Infer name from project, run through proxy (auto-starts)
portless run --name <name> <cmd>
Override inferred base name (worktree prefix still applies)
portless <name> <cmd> [args...]
Run app at https://<name>.localhost (auto-starts proxy)
portless get <name>
Print URL for a service (for cross-service wiring)
portless get <name> --no-worktree
Print URL without worktree prefix
portless list
Show active routes
portless trust
Add local CA to system trust store (for HTTPS)
portless clean
Remove state, CA trust entry, and /etc/hosts block
portless prune
Kill orphaned dev servers from crashed sessions
portless prune --force
Kill orphans with SIGKILL instead of SIGTERM
portless proxy start
Start HTTPS proxy as a daemon (port 443, auto-elevates)
portless proxy start --no-tls
Start without HTTPS (plain HTTP on port 80)
portless proxy start --lan
Start in LAN mode (mDNS .local, auto-follows LAN IP changes)
portless proxy start -p <number>
Start the proxy on a custom port
portless proxy start --tld test
Use .test instead of .localhost
portless proxy start --foreground
Start the proxy in foreground (for debugging)
portless proxy start --wildcard
Allow unregistered subdomains to fall back to parent route
portless proxy stop
Stop the proxy
portless service install
Start the HTTPS proxy when the OS starts
portless service status
Show service and proxy status
portless service uninstall
Remove the startup service
portless alias <name> <port>
Register a static route (e.g. for Docker containers)
portless alias <name> <port> --force
Overwrite an existing route
portless alias --remove <name>
Remove a static route
portless hosts sync
Add routes to /etc/hosts (fixes Safari)
portless hosts clean
Remove portless entries from /etc/hosts
portless <name> --app-port <n> <cmd>
Use a fixed port for the app instead of auto-assignment
portless <name> --tailscale <cmd>
Share the app on your Tailscale network (tailnet)
portless <name> --funnel <cmd>
Share the app publicly via Tailscale Funnel
portless <name> --force <cmd>
Kill the existing process and take over its route
portless --name <name> <cmd>
Force <name> as app name (bypasses subcommand dispatch)
portless <name> -- <cmd> [args...]
Stop flag parsing; everything after -- is passed to child
portless --help / -h
Show help
portless run --help
Show help for a subcommand (also: alias, hosts, clean)
portless --version / -v
Show version
Reserved names:run, get, alias, hosts, list, trust, clean, prune, proxy, and service are subcommands and cannot be used as app names directly. Use portless run <cmd> to infer the name, or portless --name <name> <cmd> to force any name including reserved ones.
portless.json
Optional config file. Portless looks for it in the current directory.
Field
Type
Default
Description
name
string
inferred from package.json
Base app name (worktree prefix still applies)
script
string
"dev"
Name of a package.json script to run
appPort
number
auto-assigned
Fixed port for the child process
proxy
boolean
auto-detected
Whether to route through the proxy (false for tasks)
apps
object
Overrides for workspace packages, keyed by relative path
turbo
boolean
true
Set false to use direct spawning instead of turborepo
Each apps entry has the same shape (name, script, appPort, proxy). When apps is present, top-level fields apply only in single-app mode.
package.json "portless" key
Instead of a separate portless.json, you can add a "portless" key to your package.json. A string value is shorthand for setting the name:
json
{ "portless": "myapp" }
An object supports all per-app fields (name, script, appPort, proxy):
The proxy auto-starts when you run an app with portless <name> <cmd>. If it doesn't start (e.g. port conflict), start it manually:
bash
portless proxy start
Port already in use
Another process is bound to the proxy port. Either stop it first, or use a different port:
bash
portless proxy start -p 8080
Framework not respecting PORT
Portless auto-injects the right --port flag and, when needed, a matching --host flag for frameworks that ignore the PORT env var: Vite, VitePlus (vp), Astro, React Router, Angular, Expo, and React Native. SvelteKit uses Vite internally and is handled automatically.
For other frameworks that don't read PORT, pass the port manually:
Webpack Dev Server: use --port $PORT
Custom servers: read process.env.PORT and listen on it
Permission errors
The default ports (80 for HTTP, 443 for HTTPS) require sudo on macOS and Linux. Portless auto-elevates with sudo when needed. If sudo is unavailable, it falls back to port 1355 (no sudo needed). On Windows, no elevation is required.
bash
portless proxy start --https # Auto-elevates with sudo for port 443
portless proxy start -p 1355 --https # No sudo needed (URLs include :1355)
portless proxy stop # Stop (use sudo if started with sudo)
Safari can't find .localhost URLs
Safari relies on the system DNS resolver for .localhost subdomains, which may not resolve them on all macOS configurations. Chrome, Firefox, and Edge have built-in handling.
Fix:
bash
portless hosts sync # Adds current routes to /etc/hosts
portless hosts clean # Remove entries later
Auto-syncs /etc/hosts for route hostnames by default. Set PORTLESS_SYNC_HOSTS=0 to disable.
Browser shows certificate warning with --https
The local CA may not be trusted yet. Run:
bash
portless trust
This adds the portless local CA to your system trust store. After that, restart the browser.
Remove portless from the machine
bash
portless clean
Stops the proxy if needed, removes the portless CA from the trust store (when portless added it), deletes known files under state directories, and removes the portless /etc/hosts block. May require sudo on macOS/Linux.
Proxy loop (508 Loop Detected)
If your dev server proxies requests to another portless app (e.g. Vite proxying /api to api.myapp.localhost), the proxy must rewrite the Host header. Without this, portless routes the request back to the original app, creating an infinite loop.
Fix: set changeOrigin: true in the proxy config (Vite, webpack-dev-server, etc.):
Portless automatically sets NODE_EXTRA_CA_CERTS in child processes so Node.js trusts the portless CA. If you run a separate Node.js process outside portless, point it at the CA manually: NODE_EXTRA_CA_CERTS=~/.portless/ca.pem. Alternatively, use --no-tls for plain HTTP.
Tailscale not working
If --tailscale or --funnel fails:
bash
tailscale status # Check if connected
tailscale up # Connect to your tailnet
openssl (for --https cert generation; ships with macOS and most Linux distributions; on Windows, install via winget install -e --id ShiningLight.OpenSSL.Dev or use the copy bundled with Git for Windows)
tailscale CLI (optional, for --tailscale and --funnel)