This file provides guidance to coding agents like Claude Code (claude.ai/code) and OpenCode when working with code in this repository.
Always commit and push changes after completing a task. Follow these rules:
- After making code changes, always commit with a descriptive message
- Push commits to the current feature branch
- NEVER push directly to
main- always use feature branches and PRs - Before pushing, verify the current branch is not
main - Open PRs against the
mainbranch - After pushing, check if a PR exists for the branch. If not, create one with
gh pr create --base main - After creating a PR, always wait for explicit user approval before merging. Never merge PRs autonomously.
Checkout main, pull latest, and create your feature branch from there:
git checkout main && git pull origin main && git checkout -b <branch-name>pnpm install # Install dependencies
pnpm dev # Start dev server
pnpm build # Fetch agent data + production build
pnpm lint # Run ESLint- Next.js 16 with App Router, React 19
app/- Pages and API routesapp/api/agent/- AI agent endpoint (Claude Haiku 4.5 via ToolLoopAgent)app/api/fs/- File serving endpointapp/components/- Terminal UI componentsapp/components/lite-terminal/- Custom terminal emulator with ANSI supportapp/components/terminal-parts/- Terminal commands, input handling, markdown
lib/- Core business logic:lib/agent/- AI agent configuration (system instructions, response handling)lib/recoup-api/- Recoup-API integration (sandbox creation, snapshot persistence)lib/sandbox/- Vercel Sandbox management (create, restore, snapshot)
- AI: Vercel AI SDK (
aipackage), ToolLoopAgent with Claude Haiku 4.5 - Terminal:
just-bash(TypeScript bash interpreter), customLiteTerminalemulator - Sandbox:
@vercel/sandboxfor isolated execution environments - Auth: Privy (
@privy-io/react-auth) - Styling: Tailwind CSS 4, Geist design system
- SRP (Single Responsibility Principle): One exported function per file
- DRY (Don't Repeat Yourself): Extract shared logic into reusable utilities
- KISS (Keep It Simple): Prefer simple solutions over clever ones
- YAGNI: Don't build for hypothetical future needs
- File Organization: Domain-specific directories (e.g.,
lib/sandbox/,lib/recoup-api/)
NEXT_PUBLIC_PRIVY_APP_ID- Privy authenticationNEXT_PUBLIC_VERCEL_ENV- Environment detection (productionvs other) for API URL routing