# anomalyco/opencode
*public · TypeScript · ★ 182366 · 8 trails · 1 tour*

The open source coding agent.

## Trails
1. **New skills reach the model without a cache bust** — 7 markers · SquallLeonhart13
   **At rest.** The list of available skills lives near the top of the prompt, in the part that gets cached and reused every turn.
   
   **When it changes.** Instead of editing that cached list, a short "the
   https://app.principal-ade.com/trail/fca5efc6-335e-4c5b-943e-3dbc89c749ae
2. **Shared SSE stream keeps every v2 window synced** — 6 markers · SquallLeonhart13
   **Default.** OpenCode v2 runs one HTTP server on port `4096`; the TUI, desktop, and web clients all connect to that same backend rather than each owning its own.
   
   **Trigger.** Every client opens one S
   https://app.principal-ade.com/trail/790d358f-1d4a-4c57-b927-32a4317de340
3. **How instruction files become system prompt facts — loaded fresh and re-read every model step** — 7 markers · SquallLeonhart13
   **Origin.** System prompt facts are the instruction files (`AGENTS.md`, `CLAUDE.md`, `CONTEXT.md`) plus any `instructions` configured as paths or URLs, each labeled with its source.
   
   **Path.** They ar
   https://app.principal-ade.com/trail/c9717272-f867-499f-bccd-79e4e3276917
4. **How instruction files become system prompt facts** — 6 markers · SquallLeonhart13
   **Origin.** System prompt facts are the instruction files (`AGENTS.md`, `CLAUDE.md`, `CONTEXT.md`) plus any `instructions` configured as paths or URLs.
   
   **Path.** Each file is discovered, read, and la
   https://app.principal-ade.com/trail/57dd4c8b-64e7-4e6d-b3fe-360ac469e369
5. **Moving a session to a worktree: the git_worktree Strategy creates the copy, then MoveSession patches changes across and soft-resets the source** — 10 markers · SquallLeonhart13
   **Strategy.** `ProjectCopy.create` resolves the request's `strategy` id against a registry and dispatches to it; the only registered `Strategy` is `git_worktree`, whose `create` runs `git worktree add
   https://app.principal-ade.com/trail/81756f81-9416-4148-9f44-42fd2404dbca
6. **opencode console login uses RFC 8628 device-code polling, not a localhost callback** — 6 markers · SquallLeonhart13
   **Who talks to whom.** The `opencode` CLI on your machine is the only thing that polls; it polls the **opencode console server** — the `[url]` you pass to `opencode console login`, normalized by `norm
   https://app.principal-ade.com/trail/dc577428-6eb3-4180-9002-6494a2ef2c7b
7. **OpenCode: review-panel diffs auto-refresh on disk changes** — 7 markers · SquallLeonhart13
   **Default.** The session's review panel reads diffs from `vcsQuery`, a TanStack `createQuery` with `staleTime: Infinity` — once fetched, the diffs sit cached.
   
   **Trigger.** When a file changes on disk
   https://app.principal-ade.com/trail/0eaca6d8-7cb7-4fa4-a107-bf62b36a3e3f
8. **@opencode/llm — provider-agnostic LLM core (Effect)** — 16 markers · SquallLeonhart13
   **A provider-agnostic LLM library, built on Effect.**
   
   Few teams have dealt with the quirks between LLM providers at the scale we have. This package distills that into a single core with a uniform `LL
   https://app.principal-ade.com/trail/opencode-llm-architecture

## Tours
1. **opencode: How the AI Coding Agent Works** — 7 steps
   https://app.principal-ade.com/anomalyco/opencode

---
Repository: https://github.com/anomalyco/opencode
Interactive view: https://app.principal-ade.com/anomalyco/opencode
JSON: https://app.principal-ade.com/api/repos/anomalyco/opencode
To open a trail or tour locally in the interactive viewer, see https://app.principal-ade.com for the Principal CLI quickstart.
