# Agent Skills and shell context

> Use portable SKILL.md Agent Skills and inject live shell/git context into clai prompts.

Canonical URL: https://www.clai.chat/docs/guides/skills-and-shell-context/ · Version: 1.0 · Updated: 2026-10-21

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

`clai` supports portable Agent Skills (`SKILL.md`) and customizable shell context templates so your prompts automatically carry project instructions and environment facts.

## Agent Skills (SKILL.md)

`clai` discovers `SKILL.md` files using progressive disclosure from:

- `<clai-config-dir>/skills/<skill-name>/SKILL.md` (default skills)
- `~/.agents/skills/<skill-name>/SKILL.md` (configured via `skills.json` `globalSkillDirs`)
- `./agents/skills/<skill-name>/SKILL.md` and `.claude/skills/<skill-name>/SKILL.md` (repository-scoped `projectSkillDirs`)

Enable skills for a query with `-s '*'` (`-skills '*'`), or set `"enabled": true` in `skills.json` or `"use_skills": true` in a profile. When enabled, `clai` injects compact skill descriptors into context and the model loads matching skills on demand via `load_skill`:

```sh
clai -s '*' q "Review pending changes in this repository"
clai -s none q "Run this query with skills disabled"
```

## Shell contexts (-asc)

Shell contexts (`<clai-config-dir>/shellContexts/<name>.json`) evaluate shell variables and commands—such as current working directory, OS, shell, and git status—and inject them into the system prompt when you pass `-asc <name>` (`-add-shell-context <name>`):

```sh
clai setup 4
clai -asc minimal q "Give me a one-liner to clean untracked build artifacts"
```
