Skip to content
Development
Agent

worktrees

- `src/main/core/projects/worktrees/worktree-service.ts` - `src/main/core/projects/project-manager.ts` - `src/main/core/terminals/runLifecycleScript.ts` - `.emdash.json`

From plugin
emdash
5.4k24 skills24 agents

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

- `src/main/core/projects/worktrees/worktree-service.ts` - `src/main/core/projects/project-manager.ts` - `src/main/core/terminals/runLifecycleScript.ts` - `.emdash.json`

Agent definition

worktrees.md

Worktrees

Main Files

  • `src/main/core/projects/worktrees/worktree-service.ts`
  • `src/main/core/projects/project-manager.ts`
  • `src/main/core/terminals/runLifecycleScript.ts`
  • `.emdash.json`

Current Behavior

  • task worktrees are created under the project's DB-backed worktree directory setting
  • branch prefix defaults to `emdash` and is configurable in app settings
  • generated task branch names use the configured prefix plus a random suffix by default; app repository settings can disable only the random suffix
  • selected gitignored files are preserved into worktrees
  • worktree creation is managed by the project provider pattern

`.emdash.json`

`.emdash.json` stores optional shareable project settings. Supported runtime keys:

  • `preservePatterns`
  • `scripts.setup`
  • `scripts.run`
  • `scripts.teardown`
  • `shellSetup`

Base project settings are DB-backed Project Settings, not runtime `.emdash.json` keys:

  • `worktreeDirectory`
  • `defaultBranch`
  • `baseRemote`
  • `pushRemote`
  • `tmux`
  • `workspaceProvider`

Rules

  • do not hardcode worktree paths; use service helpers
  • use lifecycle config for repo-specific bootstrap and teardown behavior
  • `shellSetup` runs inside each PTY before the interactive shell starts
  • tmux wrapping has an app level default but is also project-configurable in Project Settings and affects PTY lifecycle behavior.
  • `preservePatterns` never copies tracked files or `.emdash.json`
Read more
Ships withemdash

Emdash is the Open-Source Agentic Development Environment (🧡 YC W26). Run multiple coding agents in parallel. Use any provider.

Get the whole plugin
Stats
5,373
Stars
554
Forks
Active
Maintenance
TypeScript
Language
Apache-2.0
License
21h ago
Last commit
11mo ago
Created

Repo: generalaction/emdash