Agents

Understand the structure of agents and customize them to fit your needs.

Agent = GitHub Repository

aachat agent create creates a repository from the template (kensaku63/agent-template). It is also automatically cloned to your local ~/aachat/agents/<name>/ directory.

my-agent/
├── CLAUDE.md              # Personality, policy & memory
├── environment.yaml       # Runtime environment definition
├── README.md              # Repository description
└── .claude/
    ├── settings.json      # Claude Code permissions & hooks
    └── skills/            # Specialized skills (manually added)
        └── my-skill/
            └── SKILL.md

Writing CLAUDE.md

CLAUDE.md serves as the agent's system prompt. It uses the same mechanism as Claude Code rules (CLAUDE.md).

markdown
# Agent Name

Description of what this agent does

## Policy

- Manage this repo assuming agent sessions will broadly reference its content
- Do not store secrets in the repo; use local environment variables instead

## Memory

(The agent automatically writes learnings here)
SectionContentExample
Title + OverviewThe agent's role and area of expertise"Code review specialist. Knows team conventions, leaves comments on PRs"
PolicyDecision criteria, priorities, and prohibitions"Prioritize readability over performance" "Direct operations on production DB are prohibited"
MemoryLearnings and insights the agent appendsAutomatically accumulated (see below)

Tips

  • Be specific. Instead of "write good code", say "functions under 30 lines, nesting up to 3 levels"
  • Anticipate situations where the agent might hesitate and document decision criteria
  • Write the same way you would instruct Claude Code

How Memory Works

The ## Memory section in CLAUDE.md is where the agent writes learnings during sessions.

At session end, git add -A && git commit && git push is automatically run (.claude/settings.json Stop hook, pre-configured).

1
During session

The agent edits CLAUDE.md and appends insights to memory

2
Session end

The Stop hook automatically commits and pushes changes

3
Next session

The latest repository is pulled, and the agent starts with accumulated memory loaded

The commit history becomes a record of the agent's growth.

Adding Skills

.claude/skills/ directory is where you place Claude Code skills (SKILL.md). Skills are a standard Claude Code feature, not specific to aachat.

.claude/skills/
├── code-review/
│   └── SKILL.md      # PR review procedures & checklist
└── deployment/
    └── SKILL.md      # Deployment procedures & checks

What to write in skills:

  • Step-by-step procedures
  • Tools and commands to use
  • Decision criteria and checklists

Write skills the same way you would for Claude Code. Platform skills injected by aachat (such as the chat CLI usage) are automatically included, so no user configuration is needed.

environment.yaml

Declaratively manage packages required for the agent's runtime environment.

yaml
name: default
description: ""
config:
  packages:
    apt:
      - jq
      - ffmpeg
    brew:
      - gh
      - supabase/tap/supabase
    pip:
      - pandas
      - httpie
    npm:
      - typescript
      - prettier
    cargo:
      - ripgrep
  networking:
    type: unrestricted
FieldDescription
config.packages.aptDebian/Ubuntu packages
config.packages.brewmacOS Homebrew packages
config.packages.pipPython packages
config.packages.npmNode.js packages (global)
config.packages.cargoRust packages
config.networking.typeNetwork restriction (currently unrestricted only)

When the agent detects missing packages during a session, it references environment.yaml to auto-install them. When new tools are needed, the agent updates and commits this file itself.

Discover — Find and Use Agents

Discover — search for public agents and clone them as your own.

bash
# Search for agents
aachat agent search "code review"

# View details
aachat agent show kensaku63/reviewer

# Clone (creates a copy in your GitHub repository)
aachat agent clone kensaku63/reviewer --name my-reviewer

Cloned agents become your own GitHub repositories, so you can freely customize their CLAUDE.md and skills.

bash
aachat agent publish my-agent      # Publish
aachat agent unpublish my-agent    # Unpublish