aspenx

Agent integration

One Claude Code session per feature. It knows the feature's hostnames and databases, can't edit projects the feature doesn't touch, reports its state, and gets checked by a second, read-only QA session.

The session

Once the feature’s services are healthy, aspenx new opens a terminal tab running claude at the feature root. The tab opens in Ghostty, iTerm2 or tmux, whichever terminal in config names. The session’s first message is your --prompt, or the linked issue as “Implement <title> (<url>)” followed by the issue’s body.

--no-claude skips the session. A borrowed feature only gets one when you pass --prompt. aspenx go opens or focuses the session later.

The session sees every project directory. CLAUDE.local.md at the feature root imports .aspenx/FEATURE.md, so the session reads that file first. The monorepo’s own CLAUDE.md and skills still apply.

FEATURE.md

AspenX renders FEATURE.md from the template that the manifest’s feature_md names. The template is a Go text/template, FEATURE.md.tmpl by default, and a built-in one applies when that file is missing. AspenX renders it again whenever the feature changes shape: on new, up, touch, review on and off, pull, and pr --mine. It tells the session:

Whatever the template says, a borrowed feature also gets a “Borrowed from <user>” section. A feature branched off with pr --mine gets a “Branched off <user>’s <feature>” section.

Permissions

.claude/settings.local.json in the feature root starts from the main checkout’s local settings and keeps their rules and hooks. It adds a deny rule, Edit(/<path>/**), for every referenced project. That stops the session’s edit tools (Edit, Write, MultiEdit and NotebookEdit) from changing a referenced project. Bash can still reach those files. In the directories layout, aspenx doctor reports any change under a referenced path that got there another way.

The file also denies aspenx drop and aspenx touch through Bash, and the MCP server doesn’t offer them either. aspenx touch removes a project’s deny rule when it swaps the project to a branch worktree. The file pre-approves the .mcp.json server too.

Hooks and status

The same settings file installs hooks for SessionStart, UserPromptSubmit, PreToolUse, PostToolUse (edits only), Notification, Stop and SessionEnd. Each runs aspenx hook <event> by its absolute path, with a 5-second timeout. The hook always exits 0, so it never blocks the session. SessionStart, PostToolUse and Stop also send the dirty and ahead counts. The hook posts to the daemon’s socket, and the daemon turns the events into one state per feature:

State Meaning
working the session started, or is running tools or generating
waiting a permission prompt or a question is up: the app’s badge, the menu bar count and an AspenX notification, “<feature> is waiting for you”
idle the session finished its turn: an AspenX notification, “<feature> is ready for review”
ended the session ended, or its process is gone
none the daemon has never seen a session for the feature
unknown the daemon is not answering

When the daemon can’t tell, the state is unknown rather than a wrong guess. The mapping from hook events to states is one function in the daemon, so a change in Claude Code’s hooks needs one fix. ASPENX_HOOK_DEBUG=1 logs every hook to ~/.aspenx/logs/hooks.log.

The MCP server

.mcp.json starts aspenx mcp in the feature folder. The server only knows this one feature, and the session uses it to look things up without a shell. No tool takes a feature argument, and the server refuses requests about any other feature.

Tool Returns
status the feature’s live state, what aspenx ls --json shows for it
services each project’s compose services and how to reach them
health one check of every public project and the Mailpit through their host ports
logs the last lines of one project’s logs (mail for Mailpit), or of every project without one; tail 100 by default, 2000 at most
mail_list, mail_read the feature’s Mailpit inbox, with Mailpit search syntax (limit 20 by default, 200 at most), and one message with every link in it
restart_service restart one project’s containers and wait up to 3 minutes for health
db_reset re-clone the feature’s databases (one project’s, or all) while it stays up

The QA agent gets the same server with --read-only, which drops the last two.

The QA agent

aspenx qa invoice-pdf

starts a second, short-lived Claude session at the feature root with --permission-mode dontAsk. Its tools are limited to Read, Glob and Grep, plus two MCP servers: Playwright, driving headless Chromium at 1280×800, and the read-only aspenx mcp. It loads user settings only (--setting-sources user) and runs with ASPENX_HOOK_IGNORE=1, so the folder’s hooks never report it as the build session.

The QA session has no Edit, Write or Bash, so it can’t change a project, and git status in every project reads the same after a run. The feature must be up, and npx must be on PATH for Playwright. AspenX installs Playwright’s browser before each run.

QA settings live in ~/.aspenx/config.yml:

Key Default Effect
qa.enabled off shows the QA agent in the app; the CLI works either way
qa.model empty the model; empty means Claude Code’s default
qa.max_budget_usd 5 the most one run may spend
qa.timeout 20 minutes how long one run may take

--model, --budget, --timeout, --checklist and --no-notify override them for one run.

The agent works from .aspenx/qa/checklist.md. Each top-level list item is one check, written with -, *, + or a number. When the file has a heading named “Items”, only the list after it counts. AspenX writes the checklist once from the manifest’s qa.checklist template and never overwrites it. aspenx qa draft <feature> --send types a prompt into the build session asking it to write the checklist from the goal. Without --send, it prints the prompt instead. The agent also gets the combined diff of every touched project, the seeded logins, and the Mailpit inbox for email flows.

Each run writes .aspenx/qa/<run>.md, where the run id is a timestamp such as 2026-10-16T14-02-11. The report gives pass, fail or needs-human for each item, plus the error lines from the server log. The folder .aspenx/qa/<run>/ holds:

A run ends as pass, fail, needs-human, error or timeout, and the command exits 1 unless the run passes. aspenx qa sends a notification when the run ends, through the daemon when it’s running. aspenx ls shows the result in its QA column. The app’s QA tab, shown when qa.enabled is on, has a Send to Claude button on each failed item. It runs aspenx qa send, which writes .aspenx/qa/<run>/fix.md and types one line into the feature’s session.