Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created February 28, 2026 02:38
Show Gist options
  • Select an option

  • Save thanakijwanavit/92088edfdd097397dc2c9ef9e8448f5f to your computer and use it in GitHub Desktop.

Select an option

Save thanakijwanavit/92088edfdd097397dc2c9ef9e8448f5f to your computer and use it in GitHub Desktop.
Gas Town — Complete Knowledge Base (architecture, accounts, tools, workflows, patterns)

Gas Town — Complete Knowledge Base

Everything an agent (or human) needs to know about the Gas Town multi-agent orchestration system. Last updated: 2026-02-28


Table of Contents


1. System Overview

Gas Town is a multi-agent orchestration system that coordinates AI coding agents (Claude Code, Kimi Code, OpenClaw) to work on software projects in parallel. It uses:

  • tmux sessions for agent isolation and control
  • beads (bd) for git-native issue tracking
  • gt engine for patrol automation, mail, handoffs, and identity management
  • ais CLI for creating/monitoring/controlling agent sessions
  • Account rotation across 5 Claude + 3 Kimi accounts for rate limit management
┌─────────────────────────────────────────────────────┐
│                    Gas Town (gt)                     │
│                                                     │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐          │
│  │  Mayor   │  │  Deacon  │  │ Witness  │  Patrol  │
│  │ (HQ)     │  │ (5m loop)│  │ (health) │  Tier    │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘          │
│       │              │              │                │
│  ┌────┴──────────────┴──────────────┴────┐          │
│  │         Crew Sessions (tmux)          │          │
│  │  dev│planner│tester│deploy│designer│… │          │
│  └────┬──────────────────────────────────┘          │
│       │                                             │
│  ┌────┴─────────────────────────────────┐           │
│  │  AI Agents (Claude Code / Kimi Code) │           │
│  │  cc1│cc2│cc3│hataricc│nicxxx│kimi1│2 │           │
│  └──────────────────────────────────────┘           │
│                                                     │
│  ┌──────────────────────────────────────┐           │
│  │  Beads (bd) — Issue Tracking         │           │
│  │  .beads/issues.jsonl ↔ git sync      │           │
│  └──────────────────────────────────────┘           │
└─────────────────────────────────────────────────────┘

Version: gt 0.7.0 (dev) Platform: Linux 5.15.0-168-generic Location: /home/villa/gt/


2. Claude Code Accounts

5 Claude Code accounts, isolated via CLAUDE_CONFIG_DIR environment variable.

Account Dir Tier Primary Use
cc1 ~/.claude-accounts/cc1 Sonnet Fast parallel tasks, simple fixes
cc2 ~/.claude-accounts/cc2 Sonnet Fast parallel tasks, simple fixes
cc3 ~/.claude-accounts/cc3 Opus Complex reasoning, architecture (default)
hataricc ~/.claude-accounts/hataricc Opus Complex tasks, fallback
nicxxx ~/.claude-accounts/nicxxx Opus Complex tasks, fallback

Account Isolation

Each account has its own config directory. Set CLAUDE_CONFIG_DIR before launching:

# Launch Claude Code with a specific account
CLAUDE_CONFIG_DIR=~/.claude-accounts/cc3 claude

# Or use ais (preferred)
ais create my-task -a claude -A cc3 -c "fix the login bug"

Weekly Limits

Claude Code has weekly usage limits per account. Each resets on a rolling 7-day window. Use check-credits to see current usage across all accounts.

Rotation Strategy

  • Persistent agents (crew sessions): Priority failover — cc3 → hataricc → nicxxx
  • Polecat workers (batch tasks): Round-robin — cc1, cc2, opencode
  • Rate limit trigger: On 429/quota exceeded, kill session and respawn with next account

3. Kimi Code Accounts

3 Kimi Code accounts, isolated via KIMI_SHARE_DIR environment variable.

Account Dir Auth Type Notes
1 ~/.kimi-accounts/1 OAuth Interactive login required
2 ~/.kimi-accounts/2 API key Headless/server use
kimi2 ~/.kimi-accounts/kimi2 API key Additional capacity

Kimi vs Claude

  • Kimi is free but rate-limited
  • Good for simple/medium tasks, boilerplate, bulk operations
  • Use Claude for complex reasoning, architecture decisions
  • Kimi supports --yolo flag for auto-approve (equivalent to Claude's --dangerously-skip-permissions)

Account Management

# List accounts
kimi-account list

# Add API key account
kimi-account add 3 --api-key

# Add OAuth account
kimi-account add 4 --oauth

# Login to OAuth account
kimi-account login 1

# Check account health
kimi-account check 1

# Launch kimi with specific account
kimi-account run 2 --yolo

Known Quirk

KIMI_SHARE_DIR causes Kimi's get_share_dir() to auto-create the directory via mkdir(parents=True). Empty dirs with only device_id files may appear — safe to clean up with rm -rf.


4. CLI Tools

Tool Location Version Purpose
gt ~/go/bin/gt 0.7.0-dev Gas Town engine — patrols, mail, handoffs, identity
bd ~/.local/bin/bd 0.56.1 Beads issue tracking (git-native)
ais ~/.local/bin/ais 1.0.0 AI Session Orchestrator (tmux-based)
kimi-account ~/.local/bin/kimi-account Kimi multi-account wrapper
check-credits ~/.local/bin/check-credits Claude credit checker (all accounts)
claude ~/.npm/bin/claude Claude Code CLI
kimi ~/.local/bin/kimi Kimi Code CLI

5. AIS — AI Session Orchestrator

The main tool for managing AI agent tmux sessions.

Commands

ais create <name> -a claude|kimi -A <account> [-c "command"] [--yolo]
ais ls                          # List all managed sessions
ais inspect <name> [-n lines]   # Capture current pane output
ais inject <name> "text"        # Send text into session (tmux send-keys)
ais watch <name> [-i secs]      # Live-monitor with rate limit detection
ais logs <name> [-o file]       # Save full scrollback to file
ais kill <name|--all>           # Graceful shutdown (/exit then force-kill)
ais accounts                    # List available accounts and status

How It Works

  1. Create: Spawns a new tmux session with specific dimensions (160x50), sets environment variables (AIS_MANAGED=1, AIS_AGENT, AIS_ACCOUNT, AIS_DIR, AIS_CREATED), launches the agent binary with account isolation
  2. Inject: Uses tmux send-keys to type commands into the session. Optional -c flag on create uses a background sleep + send-keys to inject after load time (14s Claude, 8s Kimi)
  3. Inspect: Uses tmux capture-pane -p -S -<lines> to read current output. Supports --rate-limit flag for quick pattern matching
  4. Watch: Continuous loop — clear + capture + sleep. Detects rate limits via regex pattern
  5. Kill: Sends /exit + Enter (graceful), waits 10s, then tmux kill-session (force)

Session Metadata

Stored as tmux environment variables (no files, dies with session):

tmux show-environment -t <session> AIS_MANAGED   # "1"
tmux show-environment -t <session> AIS_AGENT      # "claude" or "kimi"
tmux show-environment -t <session> AIS_ACCOUNT    # account name/number
tmux show-environment -t <session> AIS_DIR        # working directory
tmux show-environment -t <session> AIS_CREATED    # ISO timestamp

Rate Limit Detection Pattern

rate.?limit|429|overloaded|quota.?exceeded|too many requests|credit balance is too low|insufficient_quota|hit your limit

Constants

CLAUDE_LOAD_TIME=14     # seconds for Claude to become ready
KIMI_LOAD_TIME=8        # seconds for Kimi to become ready
DEFAULT_WIDTH=160       # tmux pane width
DEFAULT_HEIGHT=50       # tmux pane height

6. Tmux Session Architecture

Active Sessions (14 persistent)

HQ Management Tier:

Session Purpose
hq-boot Bootstrap/initialization
hq-deacon Patrol daemon (5m interval loop)
hq-mayor Town oversight and coordination

Villa Backend v4 Crew:

Session Crew Role
vb4-crew-apihealth API health monitoring
vb4-crew-communication External communication, mail bridge
vb4-crew-contributor External contributor integration
vb4-crew-deployment AWS CloudFormation/SAM deployment
vb4-crew-designer Frontend/UX design
vb4-crew-dev General development
vb4-crew-planner Project planning/coordination
vb4-crew-tester QA/testing

Patrol Workers:

Session Purpose
vb4-furiosa Polecat worker (transient batch processor)
vb4-refinery Schema/code validation
vb4-witness Health/dependency monitoring

Tmux Best Practices for Agents

  • NEVER send Ctrl-C — kills Claude/Kimi processes. Always use /exit
  • Use -l flag for literal text: tmux send-keys -t <session> -l 'text'
  • Capture depth guidelines: -S -500 for rate limits, -S -200 for status, -S -50 for quick checks
  • UTF-8 sanitization: LC_ALL=C sed 's/[^[:print:][:space:]]//g' | iconv -f utf-8 -t utf-8 -c
  • Wait for ready: Poll for ❯ $ or esc to interrupt before sending commands

7. Beads Issue Tracking

bd (beads) is a git-native, dependency-aware issue tracker optimized for AI agent workflows.

Core Commands

bd init                              # Initialize in a repo
bd ready                             # Find unblocked work (returns JSON)
bd ready --json                      # JSON output for programmatic use
bd show <id>                         # View issue details
bd create "Title" --type task        # Create issue
bd create "Bug" --deps discovered-from:<parent-id>  # Link to parent
bd update <id> --status in_progress  # Claim work
bd close <id> --reason "Done"        # Complete work
bd sync                              # Sync with git (auto exports to .beads/issues.jsonl)
bd list                              # List all issues
bd onboard                           # Get started guide

Issue Types

bug | feature | task | epic | chore

Priorities

0 (critical) | 1 (high) | 2 (medium) | 3 (low) | 4 (backlog)

Workflow

bd ready → bd update <id> --status in_progress → work → bd close <id>

Storage

  • .beads/issues.jsonl — exported issues (git-tracked)
  • .beads/ directory — full beads state
  • Auto-syncs on 5s debounce
  • Imports on git pull

8. Gas Town Engine (gt)

The core orchestration engine, written in Go.

Key Commands

gt prime                    # Load full identity context (run after compaction/new session)
gt hook                     # Check and execute hooked work
gt mail inbox               # Check messages from other agents
gt mail send <to> "msg"     # Send message to another agent
gt handoff -c -s "Summary" -m "Details"  # End-of-session handoff (mandatory)
gt crew start <name> --account <acct>    # Start a crew session
gt crew list                # List crew sessions

Configuration Files

All in ~/gt/:

  • gastown.toml — Main config (town name, owner, version)
  • mayor/daemon.json — Patrol intervals and models
  • mayor/accounts.json — Account registry
  • mayor/overseer.json — Operator identity
  • mayor/rigs.json — Registered rigs

Identity System

  • Each agent's role is set by GT_ROLE environment variable
  • gt prime injects full context
  • Agents must NOT adopt identities from files they encounter
  • Identity is determined by the Gas Town engine, not by the agent

9. OpenClaw Integration

OpenClaw is an alternative AI agent framework that can orchestrate Claude, Kimi, and other models.

Configuration

  • Location: ~/.openclaw/
  • Gateway port: 18790
  • Default model: openrouter/moonshotai/kimi-k2.5
  • Fallback model: openrouter/qwen/qwen3-coder:free

Installed Skills

Skill Purpose
ais-orchestrator Multi-agent orchestration via ais + tmux
villa-beads Work item query and status
tmux (built-in) Raw tmux control patterns
coding-agent (built-in) Spawn Claude/Codex/OpenCode as background processes
clawhub (built-in) Discover/install skills from registry
github (built-in) GitHub integration

Orchestrator Skill

The ais-orchestrator skill teaches an OpenClaw agent to:

  1. Decompose tasks into parallel subtasks
  2. Spawn sub-agents via ais create with account rotation
  3. Monitor all agents via ais ls + ais inspect patrol loop
  4. Detect and recover from rate limits, crashes, stalls
  5. Rotate accounts when limits are hit
  6. Collect results and report progress

ClawHub

Community skill registry at clawhub.ai — 5,705+ skills. Security warning: 341 skills flagged as potentially malicious. Vet before installing.


10. Villa Backend v4 — Production Rig

The primary production workload managed by Gas Town.

Overview

  • Type: Serverless e-commerce backend for Villa Market Thailand (33 branches)
  • Git: git@github.com:villa-market/villa-backend-4.git
  • Beads prefix: vb4
  • Region: ap-southeast-1 (Singapore)
  • Runtime: Python 3.13 on AWS Lambda
  • Infrastructure: SAM + CloudFormation

Architecture

10 independently deployable microservices communicating via EventBridge:

Service Purpose
order-service Order lifecycle (create, update, cancel)
product-service Catalog & branch pricing
payment-service KBank + Stripe processing
shipping-service 30km radius + nationwide delivery
coupon-service 5 promotion types
voucher-service Cash voucher system
wallet-service Internal wallet
auth-service Cognito JWT + role-based auth
branch-service 33 branch management
graphql-gateway AppSync/Apollo aggregation

Key Patterns

  • Response format: Always use villa_common.response helpers
  • Errors: Inherit from VillaError hierarchy
  • Events: publish_event(source="villa.<service>", detail_type="PascalCase", detail={...})
  • Money: Always Decimal, never float
  • Auth: @require_auth and @require_role decorators
  • Tables: On-demand billing, service-owned, no cross-service access

Shared Lambda Layer

from villa_common.response import success, error, not_found, server_error
from villa_common.exceptions import ValidationError, NotFoundError
from villa_common.events import publish_event
from villa_common.validation import validate_length, sanitize_string
from villa_common.auth import require_auth, require_role
from villa_common.dax_client import get_dynamodb_resource, get_dax_client

Testing

  • Framework: pytest + moto (AWS mocking)
  • Coverage gate: 80% minimum
  • Fixtures: dynamodb, eventbridge, lambda_context, api_gateway_event
  • Markers: @pytest.mark.unit, @pytest.mark.integration

CI/CD

Workflow Purpose
local-test.yml PR/push: unit + integration tests
order-service-tests.yml Service-specific (80% gate)
deploy.yml SAM deploy to dev/staging/prod
security-scan.yml Bandit, CodeQL, GitLeaks, Checkov, Trivy (daily)

Deploy Commands

# Single service
cd services/<name> && sam build && sam deploy --config-env dev

# All services
./scripts/deploy-all.sh dev

# Tests
make test-all           # Everything
make test-unit          # Unit only (no infra needed)
make test-integration   # Integration (needs local-infra-up)

11. Multi-Agent Orchestration Patterns

Task Decomposition

  1. Break large task into independent subtasks
  2. Assign each subtask to a separate agent session
  3. Use Opus accounts for complex tasks, Sonnet for simple ones
  4. Use Kimi for free-tier bulk operations

Spawn Pattern

# Complex task — use Opus account
ais create fix-auth -a claude -A cc3 -c "fix the authentication bug in auth-service" --yolo

# Simple task — use Sonnet account
ais create add-tests -a claude -A cc1 -c "add unit tests for order-service" --yolo

# Bulk/simple — use free Kimi
ais create lint-fix -a kimi -A 2 -c "fix all flake8 warnings in services/" --yolo

Monitor Pattern

# Check all sessions
ais ls

# Inspect specific session
ais inspect fix-auth -n 50

# Watch for rate limits
ais watch fix-auth --until "rate.?limit|429"

# Quick rate limit check
ais inspect fix-auth --rate-limit

Recovery Pattern

# If agent hits rate limit:
ais kill fix-auth
ais create fix-auth -a claude -A hataricc -c "continue fixing auth bug" --yolo

# If agent stalls (no output for 5+ minutes):
ais inject fix-auth "/exit"
sleep 5
ais kill fix-auth
# Respawn with different account

Collect Results

# Save full scrollback
ais logs fix-auth -o /tmp/fix-auth-results.txt

# Inspect last N lines
ais inspect fix-auth -n 200

12. Account Rotation & Rate Limits

Detection

Rate limits are detected by pattern matching against tmux pane output:

rate.?limit|429|overloaded|quota.?exceeded|too many requests|
credit balance is too low|insufficient_quota|hit your limit

Rotation Strategies

Priority Failover (for persistent/important work):

cc3 (Opus) → hataricc (Opus) → nicxxx (Opus)

Round Robin (for batch/polecat work):

cc1 (Sonnet) → cc2 (Sonnet) → cc1 → cc2 → ...

Free Tier Offload (for simple tasks):

kimi account 1 → kimi account 2 → kimi account kimi2

Capacity Planning

Approximate concurrent capacity:

  • 3 Opus sessions (cc3, hataricc, nicxxx) — complex reasoning
  • 2 Sonnet sessions (cc1, cc2) — fast simple tasks
  • 2-3 Kimi sessions (accounts 1, 2, kimi2) — free tier bulk
  • Total: ~7-8 concurrent agents

Checking Credits

# All accounts
check-credits

# Specific accounts
check-credits cc1 cc3

# Results saved to /tmp/credit-check-latest.txt

13. Patrol System

Automated patrol daemons run on fixed intervals.

Patrol Agents

Agent Interval Model Purpose
deacon 5 min Opus Routine patrol cycle — check mail, hook work, sync
refinery 5 min Schema/code validation, linting
witness 5 min Health monitoring, dependency verification, polecat dispatch
account_rotator 1 min Rate limit detection and account rotation

Patrol Cycle (Deacon)

Every 5 minutes:

  1. gt hook — execute any hooked work
  2. gt mail inbox — check messages
  3. git pull --rebase — sync latest changes
  4. Check what changed (git log --oneline --since="6 minutes ago")
  5. Monitor health
  6. Report status
  7. gt handoff — record state for next cycle

Tmux Sessions for Patrols

  • hq-deacon — deacon patrol loop
  • vb4-witness — witness patrol
  • vb4-refinery — refinery patrol
  • vb4-furiosa — current polecat worker

14. Claude Code Plugins

Installed across all Claude Code accounts:

Plugin Purpose
superpowers Brainstorming, debugging, TDD, plan mode workflows
playwright Browser automation and testing
frontend-design UI/UX design generation
code-review Pull request review workflows
code-simplifier Code refactoring and cleanup
ralph-loop Iterative refinement loop
typescript-lsp TypeScript language server integration
claude-code-setup Setup automation recommendations

Plugin Installation

# Inside Claude Code
/plugin install superpowers@claude-plugins-official
/plugin install playwright@claude-plugins-official
# etc.

15. Credit Checking

Claude Credits

The check-credit.sh script spawns a temporary tmux session per account, runs /usage, and parses the output.

# Quick check (wrapper)
check-credits

# Full script with specific accounts
bash ~/gt/villa_backend_4/crew/dev/scripts/nudge/check-credit.sh cc1 cc3

# Results always saved to
cat /tmp/credit-check-latest.txt

Output format:

┌──────────────┬──────────┬──────────┬───────────┬──────────────────────────┐
│ Account      │ Week All │  Sonnet  │ Remaining │ Resets (GMT+7)           │
├──────────────┼──────────┼──────────┼───────────┼──────────────────────────┤
│ cc1          │   26%    │    0%    │   74% OK  │ Mar 06, 10:00am (GMT+7)  │
│ cc3          │    2%    │    0%    │   98% OK  │ Mar 06, 11:00am (GMT+7)  │
└──────────────┴──────────┴──────────┴───────────┴──────────────────────────┘

Kimi Credits

kimi-account check 1    # Check specific account
kimi-account check --all # Check all accounts

Known Limitation

check-credits cannot output directly to stdout when run from inside Claude Code (tmux spawning interferes with terminal capture). Output is always saved to /tmp/credit-check-latest.txt — read from there.


16. Gists & Published Resources

Index Gist

Gas Town — Useful Gists Index

AI Agent Orchestration Gists

Gist ID Files Description
Claude Code Tools c0877d83... 6 ais CLI, credit checkers, orchestrator skill, tmux guide, agent setup
Kimi Code Tools 4d0e343b... 7 ais CLI, kimi-account, credit checker, orchestrator skill, tmux guide

File Inventory

Claude Code gist:

  • ais.sh — AI Session Manager CLI
  • check-credit.sh — Full credit checker (spawns tmux per account)
  • check-credits — Quick wrapper for check-credit.sh
  • agent-setup.md — Plugin/skill setup for Claude, Kimi, OpenClaw
  • orchestrator-skill.md — OpenClaw SKILL.md for multi-agent orchestration
  • tmux-agent-control.md — Comprehensive tmux patterns guide

Kimi Code gist:

  • ais.sh — AI Session Manager CLI
  • kimi-account.sh — Multi-account manager
  • check-kimi-credit.sh — Kimi credit/status checker
  • kimi-multi-account-README.md — Setup guide
  • agent-setup.md — Plugin/skill setup
  • orchestrator-skill.md — OpenClaw orchestrator skill
  • tmux-agent-control.md — Tmux patterns guide

Infrastructure Gists

Gist Description
KimiGas Engine v2.0.0 Update instructions for KimiGas agents
Gastown Monitor + OpenClaw Bot Health checks, hourly handoffs, Discord reporting
OpenClaw Auto-Approve Auto-approve configuration
Discord Bot Guide AI agent Discord integration
Contributor Guide Villa Market Backend contributor guide

17. Published Repos (gastown-publish)

Repo Visibility Description
gastown-publish/ais public AI Session Orchestrator (being set up)
gastown-publish/kimigas public Kimi Code CLI agent (fork)
gastown-publish/openclaw-launcher public OpenClaw bootstrapper
gastown-publish/gastown-monitor public TUI dashboard for monitoring Gas Town
gastown-publish/homebrew-tap public Homebrew installation for kimigas
gastown-publish/gastown-manager private Manager infrastructure
gastown-publish/gastown-articles private Documentation/articles

18. Debugging & Operational Notes

Tmux Output Capture Sanitization

Always sanitize captured tmux output before parsing:

tmux capture-pane -t <session> -p -S -200 | \
  LC_ALL=C sed 's/[^[:print:][:space:]]//g' | \
  iconv -f utf-8 -t utf-8 -c

Never Ctrl-C

CRITICAL: Sending Ctrl-C to a Claude or Kimi session kills the process. Always use /exit:

# WRONG — kills the agent
tmux send-keys -t my-session C-c

# RIGHT — graceful exit
tmux send-keys -t my-session '/exit' Enter

Ghost Kimi Directories

KIMI_SHARE_DIR causes auto-creation of directories. Empty dirs with only device_id are harmless but can be cleaned up:

rm -rf ~/.kimi-accounts/ghost-dir

Claude Code Nested Session Error

Cannot run claude CLI from inside another Claude Code session. Use tmux-based tools (check-credits, ais) instead, which spawn separate tmux sessions.

Capture Depth Guidelines

Use Case Depth Flag Lines
Quick status check -S -50 50
Normal inspection -S -200 200
Rate limit detection -S -500 500
Full scrollback -S - All

Claude Code Ready Detection

Poll for these patterns to know Claude is ready to accept input:

# Ready patterns
❯ $
Try "
esc to interrupt

Login/Auth Detection

# Not logged in patterns
Select login method
log in to use

19. Mandatory Workflows

Session Start (Every Agent)

gt hook                    # Execute hooked work
gt mail inbox              # Check messages
git pull --rebase          # Sync latest
gt prime                   # Load identity (after compaction/new session)

Session End — Landing the Plane

MANDATORY — work is NOT complete until git push succeeds:

# 1. File issues for remaining work
bd create "Remaining: ..." --type task

# 2. Run quality gates
make test-unit  # or appropriate tests

# 3. Update issue status
bd close <id> --reason "Completed"

# 4. PUSH TO REMOTE (mandatory)
git pull --rebase
bd sync
git push
git status  # MUST show "up to date with origin"

# 5. Handoff
gt handoff -c -s "Summary" -m "Details of what was done and what's next"

Crew Duty Cycle (Every 20 minutes for persistent crews)

  1. Sync: git pull --rebase
  2. Monitor: Check what changed
  3. Execute: Do assigned work
  4. Report: Status to mayor/human
  5. Commit & Push: git add && git commit && git push
  6. Handoff: gt handoff -c -s "Cycle" -m "status details"

20. Quick Reference

Install Everything

# AIS CLI
curl -sL "https://gist.githubusercontent.com/thanakijwanavit/c0877d834e288de104b38f3f8cda233c/raw/ais.sh" \
  -o ~/.local/bin/ais && chmod +x ~/.local/bin/ais

# Kimi Account Manager
curl -sL "https://gist.githubusercontent.com/thanakijwanavit/4d0e343bd8e0fbeefa8c0c7e03d13b91/raw/kimi-account.sh" \
  -o ~/.local/bin/kimi-account && chmod +x ~/.local/bin/kimi-account

# Credit Checker
curl -sL "https://gist.githubusercontent.com/thanakijwanavit/c0877d834e288de104b38f3f8cda233c/raw/check-credit.sh" \
  -o ~/.local/bin/check-credit.sh && chmod +x ~/.local/bin/check-credit.sh
curl -sL "https://gist.githubusercontent.com/thanakijwanavit/c0877d834e288de104b38f3f8cda233c/raw/check-credits" \
  -o ~/.local/bin/check-credits && chmod +x ~/.local/bin/check-credits

Common Operations

# Check credits
check-credits

# Spawn a Claude agent
ais create my-task -a claude -A cc3 -c "do the thing" --yolo

# Spawn a Kimi agent
ais create bulk-fix -a kimi -A 2 -c "fix all warnings" --yolo

# List active agents
ais ls

# Monitor an agent
ais watch my-task

# Inject a command
ais inject my-task "run the tests now"

# Graceful shutdown
ais kill my-task

# Kill all managed sessions
ais kill --all

# Beads workflow
bd ready                   # Find work
bd update <id> --status in_progress
bd close <id>
bd sync && git push

Environment Variables

CLAUDE_CONFIG_DIR=~/.claude-accounts/<name>   # Claude account isolation
KIMI_SHARE_DIR=~/.kimi-accounts/<number>      # Kimi account isolation
GT_ROLE=<role>                                 # Gas Town agent role
AIS_MANAGED=1                                  # Marks tmux session as ais-managed

This document is maintained alongside the gastown-publish/ais repository and the Gist Index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment