# Agent context

Source: https://athas.dev/docs/agent-context

Give agents useful project context, set repository rules, and understand ignore-file boundaries.

Give an agent the relevant files, a concrete task and a way to verify the result. Context and
permissions are separate: an instruction file describes how to work; it does not grant access.

## Provide a focused task

A useful request states the expected behavior, constraints and verification:

```text
Fix the settings form so invalid URLs show an error before saving.
Use the existing validation and field components. Keep unrelated changes.
Run the relevant form tests and summarize the changed files.
```

Attach selected code through **Add Selection to Agent Chat**, and include the error or failing
check. Let the agent inspect the project instead of pasting an entire repository into a prompt.

## Project and user instructions

The built-in agent loads project instructions from `AGENTS.md`, `CLAUDE.md`, `.athas/rules`, and
`.cursor/rules`. Put shared conventions and test commands near the project they describe.
Set cross-project **User rules** under **Settings > AI > Agents**.

External agents use their own configuration and supported instruction formats. Check that agent's
instructions rather than assuming it reads every format Athas understands.

## Exclude automatic context

Root `.athasignore`, `.aiignore`, and `.cursorignore` files exclude paths from automatic context,
Tab completion and built-in workspace tools. Use them for generated or irrelevant files.

These are context filters, not a security sandbox. External agents, terminal commands and MCP
tools follow their own access rules. Keep secrets out of the workspace context and inspect permission
requests before allowing actions.

## Review results

Inspect file edits, command output and relevant tests before accepting a change. Use a
[worktree](https://athas.dev/docs/git-worktrees) to isolate larger tasks. See [Athas Agent](https://athas.dev/docs/athas-agent),
[External agents](https://athas.dev/docs/external-agents) and [MCP servers](https://athas.dev/docs/mcp) for each execution path.
