> ## Documentation Index
> Fetch the complete documentation index at: https://schaltwerk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Your First Session

> Create and run your first AI agent in Schaltwerk

Once you've installed Schaltwerk, it's time to create your first session.

## Open Your Repository

<Steps>
  <Step title="Launch Schaltwerk">
    Open the app from your applications menu, or via terminal:

    **macOS:**

    ```bash theme={null}
    open -a Schaltwerk
    ```

    **Windows:** Launch from Start menu or double-click the desktop shortcut

    **Linux:**

    ```bash theme={null}
    schaltwerk
    ```

    > Prefer the CLI? Running `schaltwerk` always lands on the Home screen first. Pick a repository manually every time—no project is auto-selected on startup.
  </Step>

  <Step title="Open a project">
    On the Home screen, click **Open Repository** and select your Git repository.

    <Info>Schaltwerk verifies that the folder is a valid Git repository before opening it.</Info>
  </Step>

  <Step title="Recent Projects">
    The project is added to **Recent Projects** for quick access next time
  </Step>
</Steps>

<Tip>
  **Alternative:** Click **New Project** to create a new empty Git repository
</Tip>

## Create a Session

Sessions are where AI agents work. Each session runs in its own isolated [git worktree](https://git-scm.com/docs/git-worktree) with its own branch.

<Steps>
  <Step title="Press ⌘N">
    This opens the **New Session** dialog

    <img src="https://mintcdn.com/schaltwerk/f6q1RM8xeBMiAfLz/images/new-agent-modal.png?fit=max&auto=format&n=f6q1RM8xeBMiAfLz&q=85&s=63d3a95a585bb373d0d820a7fa36969b" alt="Start new agent dialog showing agent name field, initial prompt tabs, base branch selection, agent dropdown, model selector, and permission settings" width="1480" height="1420" data-path="images/new-agent-modal.png" />
  </Step>

  <Step title="Enter a task description">
    Choose your prompt source:

    * **Custom prompt** — Write your own task description
    * **GitHub issue** — Import an issue with its description, labels, and comments
    * **GitHub PR** — Import a PR with its context and discussion

          <img src="https://mintcdn.com/schaltwerk/f6q1RM8xeBMiAfLz/images/start-from-github-issue-or-pr.png?fit=max&auto=format&n=f6q1RM8xeBMiAfLz&q=85&s=2b652d1e3914fe8f287911217805cf9c" alt="GitHub issue search showing issue list with title, status, and labels" width="1434" height="410" data-path="images/start-from-github-issue-or-pr.png" />

    <Tip>
      GitHub import requires the `gh` CLI to be installed and authenticated. The issue/PR content becomes the agent's initial prompt.
    </Tip>
  </Step>

  <Step title="Select your agent">
    Choose which agent to use:

    * **GitHub Copilot** - Great for iterative tasks; requires `npm install -g @github/copilot` and trusting the worktree once
    * **Claude Code** - Best for complex refactoring and understanding large codebases
    * **OpenCode** - Open-source option
    * **Codex** - Fast, efficient, great for smaller tasks
    * **Gemini** - Alternative AI assistant
    * **Kilo Code** - Powerful CLI with architect and autonomous modes
    * **Qwen** - Alibaba's advanced AI coding assistant
    * **Factory Droid** - Specialized agent for code generation and automation
    * **Amp** - Advanced coding agent with powerful tools
    * **Terminal Only** - Manual work without AI agents, opens only a usable terminal

      <Info>For AI agents, make sure you've configured them in Settings. See [Agent Setup](/guides/agent-setup) for details. Terminal Only mode doesn't require configuration.</Info>
  </Step>

  <Step title="Choose base branch">
    Select which branch the session should start from (usually `main` or `develop`)
  </Step>

  <Step title="Press ⌘Enter to start">
    Schaltwerk will:

    1. Create a new git branch named `schaltwerk/<session-name>`
    2. Create an isolated [git worktree](https://git-scm.com/docs/git-worktree) at `.schaltwerk/worktrees/<session-name>/`
    3. Spawn two terminals (agent terminal on top, your shell below)
    4. Start the agent with your task description

           <img src="https://mintcdn.com/schaltwerk/KG1elAstw6eFgx9E/images/schaltwerk-agent-view.png?fit=max&auto=format&n=KG1elAstw6eFgx9E&q=85&s=8f1d9f5bc7431f03307dcd87269fce7c" alt="Full Schaltwerk interface showing sidebar with sessions, agent terminal on top displaying code analysis, and shell terminal below" width="3786" height="2220" data-path="images/schaltwerk-agent-view.png" />
  </Step>
</Steps>

## Watch Your Agent Work

The agent appears in the sidebar and starts working immediately.

<img src="https://mintcdn.com/schaltwerk/KG1elAstw6eFgx9E/images/session-card-and-filter.png?fit=max&auto=format&n=KG1elAstw6eFgx9E&q=85&s=88cdd04e614fe2e1ef3a5dd614da1cc1" alt="Session card showing 'tooltip-duplicate-fix' with Idle status, filter tabs for Specs/Running/Reviewed, and action buttons including code view, refresh, mark reviewed, archive, and cancel" width="928" height="340" data-path="images/session-card-and-filter.png" />

<AccordionGroup>
  <Accordion title="Top Terminal (Agent)">
    Shows the AI agent's output in real-time. Watch as it:

    * Reads and understands your codebase
    * Makes edits across multiple files
    * Runs tests and validates changes

    **Press `⌘T`** to focus this terminal
  </Accordion>

  <Accordion title="Bottom Terminal (Your Shell)">
    Your personal shell in the session's worktree. Use it to:

    * Run tests manually
    * Inspect changes with `git diff`
    * Execute build commands

    **Press `⌘/`** to focus this terminal
  </Accordion>

  <Accordion title="Run Mode">
    Configure a run script in **Settings → Run & Environment → Run Script**, then press **`⌘E`** to execute it in the bottom terminal.

    Perfect for starting dev servers, running test suites, or building the project.

    <img src="https://mintcdn.com/schaltwerk/KG1elAstw6eFgx9E/images/run-tab.png?fit=max&auto=format&n=KG1elAstw6eFgx9E&q=85&s=d752dcb1a3515b6b596d51c23be433e0" alt="Run tab showing build output with compilation progress, multiple terminal tabs, and Run button with ⌘E shortcut" width="1928" height="600" data-path="images/run-tab.png" />
  </Accordion>
</AccordionGroup>

## Review Changes

Once the agent is done (or you want to check progress):

<Steps>
  <Step title="Open the diff">
    Press `⌘G` to view all changes the agent made. The **Changes** tab shows all modified files with line counts:

    <img src="https://mintcdn.com/schaltwerk/f6q1RM8xeBMiAfLz/images/inline-sidebar-diff.png?fit=max&auto=format&n=f6q1RM8xeBMiAfLz&q=85&s=36ad9ff45b01a2794ad52c20817f2812" alt="Changes tab showing file list with Open diffs inline checkbox and line counts" width="1024" height="710" data-path="images/inline-sidebar-diff.png" />

    Toggle **Open diffs inline** to review directly in the sidebar, or leave it off to open a full-screen modal.
  </Step>

  <Step title="Review inline">
    Click a file to open its diff. With inline mode enabled, the diff opens right in the sidebar—no context switching. Click **Back to List** to return to the file list.

    <img src="https://mintcdn.com/schaltwerk/f6q1RM8xeBMiAfLz/images/inline-sidebar-comment.png?fit=max&auto=format&n=f6q1RM8xeBMiAfLz&q=85&s=e427414416ab0bb028e5b3da0071a527" alt="Inline diff view showing code changes with Add Review Comment form" width="1390" height="1134" data-path="images/inline-sidebar-comment.png" />
  </Step>

  <Step title="Add review comments">
    Select lines in the diff (click the + icons on the left) to add comments:

    * Type your feedback in the comment form
    * Click **Submit** to add the comment
    * Click **Finish Review** (or `⌘Enter`) to send all comments to the agent terminal

    The agent receives your formatted feedback and can address each issue.
  </Step>

  <Step title="Test the changes">
    Use the bottom terminal (`⌘/`) or Run Mode (`⌘E`) to:

    * Run your test suite
    * Start the dev server
    * Verify the changes work as expected
  </Step>
</Steps>

## Mark as Reviewed

When you're satisfied with the changes:

<Steps>
  <Step title="Press ⌘R">
    This marks the session as **Reviewed**

    The session moves to the "Reviewed" filter in the sidebar

    <img src="https://mintcdn.com/schaltwerk/KG1elAstw6eFgx9E/images/pr-merge-reviewed-sessions.png?fit=max&auto=format&n=KG1elAstw6eFgx9E&q=85&s=36e3d792312e87b6f495ca014e2174b9" alt="Reviewed session card with green checkmark, showing GitHub PR button, merge button, refresh button, and cancel button" width="956" height="358" data-path="images/pr-merge-reviewed-sessions.png" />
  </Step>

  <Step title="Session is ready for merge">
    You can now:

    * **Merge to main** with `⌘⇧M`
    * **Create a PR** with `⌘⇧P`
    * Continue working on it (edit files, run more commands)
  </Step>
</Steps>

## Merge or Create PR

<Tabs>
  <Tab title="Merge to Main">
    Press **`⌘⇧M`** to merge directly to your base branch.

    Schaltwerk will:

    1. Switch to the base branch
    2. Merge the session branch
    3. Push changes (if configured)

    <Warning>Only use direct merge if you're working solo or on trusted changes</Warning>
  </Tab>

  <Tab title="Create Pull Request">
    Press **`⌘⇧P`** to create a GitHub PR.

    Requirements:

    * GitHub CLI (`gh`) installed and authenticated
    * Connected project + push access to `origin`

          <img src="https://mintcdn.com/schaltwerk/KG1elAstw6eFgx9E/images/connect-github.png?fit=max&auto=format&n=KG1elAstw6eFgx9E&q=85&s=2d2dc32268614668738dde15e3bb4971" alt="GitHub CLI status showing installed, authenticated, repository name, default branch, account, with options to reconnect or refresh status" width="524" height="568" data-path="images/connect-github.png" />

    Schaltwerk opens a PR dialog where you can choose a strategy (**Squash changes** vs **Use existing commits**), adjust the title/body, pick a base branch, and optionally push to a custom PR branch name.

    See the full PR guide (including linking PRs and fetching review comments): [Pull Requests](/guides/pull-requests)
  </Tab>
</Tabs>

## Clean Up

After merging, clean up the session:

<Steps>
  <Step title="Press ⌘D">
    Cancels the session and removes the worktree

    <Warning>This is destructive! Only cancel after successfully merging.</Warning>
  </Step>

  <Step title="Confirm deletion">
    Schaltwerk will ask for confirmation before removing the worktree
  </Step>
</Steps>

<Tip>
  Want to keep the plan but scrap the current run? Press **`⌘S`** to convert the session back to a spec—this deletes the session worktree and branch (uncommitted changes are lost) while preserving the markdown so you can relaunch later.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Workflow Guide" icon="arrows-rotate" href="/workflow">
    Learn best practices for daily use
  </Card>

  <Card title="Keyboard Shortcuts" icon="keyboard" href="/guides/keyboard-shortcuts">
    Master the keyboard-driven workflow
  </Card>

  <Card title="Agent Setup" icon="robot" href="/guides/agent-setup">
    Configure agents, environment variables, and run mode
  </Card>

  <Card title="Core Concepts" icon="book" href="/core-concepts/sessions-and-specs">
    Understand sessions, specs, and the orchestrator
  </Card>
</CardGroup>
