# Putting it all together

> Six habits from daily clai use: aliases for quick questions, a profile per job, conversations that live in a directory, agents that start agents, daily scripts, and other agents' sessions.

Canonical URL: https://www.clai.chat/docs/guides/putting-it-all-together/ · Version: 1.0 · Updated: 2026-10-26

Full site index: https://www.clai.chat/llms.txt

clai is not meant to be typed out in full every time. The flags are the
building blocks; the way of work is a handful of aliases, one profile per
job and a few scripts, so the command you type is short and says what you
want. The landing page plays the six habits below as one recorded take.
Each section here has the commands from that take, with nothing left out.

## Alias the everyday questions

Most questions are one question and one answer, asked without leaving the
shell. Two aliases cover that: `ask` starts a conversation and `rask`
replies to the last one. A third, `why`, takes a failure on stdin: `-i`
puts what is piped in where the prompt has `{}`.

```sh
alias ask='clai q' rask='clai -re q'
alias why='clai -i q "What failed, and the fix? Two lines. {}"'
ask 'Command to drop a stale terraform state lock? One line.'
rask 'And where do I find the lock ID, without touching state? One line.'
go test ./... 2>&1 | why
```

Put them in `~/.bashrc` or `~/.zshrc`. [Chats and multi-vendor import](/docs/guides/chats-and-vendors/)
has more on replying.

## One profile per job

A profile is one JSON file in `profiles/` with the model, the system
prompt, the tools and the command bans for one kind of work. An alias then
makes the profile a command. The `ops` profile below investigates with
`cmd`, `cat`, `git`, `go` and `ls`, and its `cmd-ban` list stops
`git commit`, `git push`, `rm` and `terraform apply` whatever the
model asks for.

```sh
jq -c '{model, tools, "cmd-ban"}' ~/.config/.clai/profiles/ops.json
alias ops='clai -p ops q'
ops 'Commit the working tree.'
```

A ban is merged from every source and never removed by another, so a
profile's bans hold even when a flag adds tools. See [Profiles and setup](/docs/guides/profiles/).

## Pick it up tomorrow

A query belongs to the directory it ran in. Come back to the same
directory, in another shell or the next morning, and `-dre` replies to that
conversation, not to whatever you asked last somewhere else.

```sh
ops 'Plan per-key windows for this limiter; read limiter.go first. Three short steps.'
clai -p ops -dre q 'Where did we stop? One line.'
```

## Agents that start agents

A lead agent can hand work to workers, and the workers are clai too. With
the `clai_run` tool the lead starts a worker as a separate clai process,
with its own profile and its own context, and `clai_wait_for_workers` and
`clai_result` collect what each found. Start every worker before waiting,
so they run at the same time.

```sh
clai -p lead q 'Call clai_run twice before you wait: one investigator for why go test fails, one for whether api/ needs the same fix. Then two lines.'
```

The `lead` profile allows only `clai_run`, `clai_check`, `clai_result`
and `clai_wait_for_workers`; each `investigator` gets read-only tools. The
same split works for a large change: one worker per package, and the lead
merges their results. For a long command that should keep running while
the agent carries on, the async tools (`async_cmd`, `async_cmd_await`,
`async_cmd_logs`) start it in the background and wait for it later. See
[MCP servers and builtin tools](/docs/guides/mcp-and-tools/) and the [tools reference](/docs/reference/tools/).

## A daily job is a script

Work that repeats belongs in a script, not in a chat. This one turns the
morning stand-up's transcript into notes with decisions and owners; the
transcript itself comes from `clai a t`.

```sh
#!/bin/sh
# Every morning: transcript in, notes out. The transcript is made with
#   clai a t -af json standup.wav > standup.txt
clai -p scribe -i q 'Notes from this stand-up: {}' < "$1" > notes.md
```

```sh
./standup.sh standup.txt && cat notes.md
```

## Bring the other agents in

Sessions from Claude Code, Codex and the other agents clai reads are rows
in `clai chat list`, beside clai's own. The list is interactive; its key
presses can follow as arguments. Pressing `c` on a foreign row clones the
session into clai and binds it to the current directory, so `-dre` carries
on from where the other agent stopped, on any model.

```sh
clai chat list n q | grep claude-code
clai chat list n 11 c > /dev/null
clai -dre q 'Where did this session stop? One line.'
```

[Chats and multi-vendor import](/docs/guides/chats-and-vendors/) lists every
agent clai imports from.
