Installation
Effect ships as a single package, effect, that contains the entire core
library — the Effect type, Schema, Stream, Layer, and much more.
Installing that one package is all you need to start. This page walks you through
creating a fresh, strict TypeScript project and running a first program.
Requirements:
- TypeScript 5.8 or newer (Effect v4 is developed and built against TypeScript 6.x — use the latest release for the best results)
- A runtime: Bun, Node.js 18+, or Deno
Create a project
Section titled “Create a project”-
Create a project directory and move into it:
Terminal window mkdir hello-effectcd hello-effect -
Initialize the project and install TypeScript and Effect:
Terminal window bun init -ybun add effectbun add -d typescriptTerminal window npm init -ynpm install effectnpm install --save-dev typescript tsxTerminal window pnpm initpnpm add effectpnpm add -D typescript tsx -
Generate a
tsconfig.jsonand make sure strict mode is on:bun initalready creates atsconfig.jsonwithstrictenabled. Verify it contains:{"compilerOptions": {"strict": true}}Terminal window npx tsc --initThen open
tsconfig.jsonand confirm:{"compilerOptions": {"strict": true}}Terminal window pnpm tsc --initThen open
tsconfig.jsonand confirm:{"compilerOptions": {"strict": true}}
Write a first program
Section titled “Write a first program”Create a source file:
mkdir -p srctouch src/index.tsAdd the following to src/index.ts. The program is described as a value, then
handed to a runtime to actually run:
import { Console, Effect } from "effect"
// `Effect.gen` builds an effect in imperative style. Nothing runs yet — this is// just a description of the work to be done.const program = Effect.gen(function* () { yield* Console.log("Hello, Effect!")})
// `Effect.runPromise` executes the program and returns a Promise. This is the// boundary between the Effect world (descriptions) and the outside world.Effect.runPromise(program)Run it
Section titled “Run it”bun run src/index.tsnpx tsx src/index.tspnpm tsx src/index.tsYou should see Hello, Effect! printed to the console. That confirms your
project is set up correctly.
Give your coding agent the source
Section titled “Give your coding agent the source”If you write Effect with a coding agent (Claude Code, Cursor, and friends), the
single highest-leverage thing you can do for code quality is to let the agent
read Effect’s actual source. Agents are far better at exploring real code —
following usage patterns, tracing abstractions, learning from existing examples —
than at working from human-oriented prose or fragmented web-search snippets.
Reading from node_modules usually isn’t enough: the code there is
compiled/flattened, and most agents are tuned to skip gitignored directories.
The cleanest way to make the source explorable is to vendor it into your repo
as a git subtree.
Unlike a submodule, a subtree is just a normal directory — no separate init step,
no .gitmodules, nothing you or the agent has to think about.
-
Vendor the Effect source under
repos/effectas a single squashed commit:Terminal window git subtree add \--prefix=repos/effect \https://github.com/Effect-TS/effect.git \main \--squash--squashcollapses the upstream history into one commit rather than importing thousands of commits into your project. Keep all vendored repos under one directory (repos/) so a single line in your agent instructions can point at them. -
Keep your editor out of the vendored copy. In
.vscode/settings.json, excluderepos/**from search, file watching, and auto-imports so you never get suggestions or auto-imports from the reference source:.vscode/settings.json {"typescript.preferences.autoImportFileExcludePatterns": ["repos/**"],"javascript.preferences.autoImportFileExcludePatterns": ["repos/**"],"files.exclude": { "repos/**": true },"files.watcherExclude": { "repos/**": true },"search.exclude": { "repos/**": true }} -
Make the agent aware of the source and how to use it — in
AGENTS.md(or whichever instructions file your agent reads). Be explicit that it is read-only reference, not part of your application:AGENTS.md ## Vendored repositoriesThis project vendors external repositories under `repos/`.- Use them as read-only reference material when working with related libraries.- Prefer examples and patterns from the vendored source over guesses or web search.- Do not edit files under `repos/` unless explicitly asked.- Do not import from `repos/` — application code imports from normal dependencies.When writing Effect code, inspect `repos/effect/` for idiomatic usage, tests,module structure, and API design, and treat it as the source of truth forEffect patterns. Always read `repos/effect/LLMS.md` first.
To pull in upstream changes later, run the matching pull — each update lands as
one reviewable commit:
git subtree pull \ --prefix=repos/effect \ https://github.com/Effect-TS/effect.git \ main \ --squashNext steps
Section titled “Next steps”Now that everything runs, the Quickstart builds a small but realistic program with services, typed errors, and a Layer. To learn how the package is organized and how to reach the unstable modules (HTTP, CLI, RPC, and more), see Importing Effect.