# Starting Claude Code

`x` starts Claude Code beside the ticket, with the ticket as its task. In iTerm on macOS
it opens in a pane of its own. If `tmux` is on your `PATH` there, the agent runs in a tmux session
of its own instead and goes on when nobody looks at it: the pane beside the tool shows it
only while the focus is on its ticket, and closes otherwise. Elsewhere, also in iTerm
inside tmux, screen or zellij, Claude Code takes over the terminal until it ends.

[![On the left the CLI tool with the ticket list and the open ticket #10, on the right Claude Code in the pane beside it, which has read that ticket and asks before changing it.](/docs/images/cli-agent-beside-ticket-v1-en.png)](/docs/images/cli-agent-beside-ticket-v1-en.png)

*Example with invented data.*

## Choosing the folder

By default the agent starts in the folder you started `lalabase` in. A project gets its
own folder through `config.toml`, with the project's id as the key:

```toml
[profiles.default.folders]
00000000-0000-4000-8000-000000000031 = "~/dev/website"
```

## Keeping track of agents

The tool shows what each agent is doing, in the ticket list, in the ticket and across all
organisations. The sign before the ticket names the state:

| Sign | State |
|---|---|
| `!` | waiting for your approval |
| `A` | waiting for you |
| `✕` | lost, its process is gone |
| spinner | working |
| `⠂` | starting |
| `✓` | ended |

`A` opens the agents. `x` on a ticket with an agent jumps to its own pane in iTerm, or
starts it again once it has ended or is lost. An agent in tmux has no pane of its own:
while it runs, `x` only says so. `d` removes an agent that ended or is lost and, after
asking, ends one that waits for you in tmux. An agent at work is left alone.

What an agent may do is covered under [rights and data](https://lalabase.com/docs/en/cli/agents/rights-and-data).
