Standard Daily Workflow: Working With an Agent
Most developers don't configure every knob up front — you start chatting on a real repository, observe how the agent behaves with your quota and codebase, teach it your recurring workflows as skills and rules, and use real cost data to lock down subagents and failover.
This guide walks through that standard day-to-day workflow from first chat to a self-improving, cost-controlled setup.
The compounding feedback loop
flowchart LR
S1["1. Start Chat &\nInitialize Project\nkompile chat • AGENTS.md\ncode-index • configure init"] --> S2["2. Run Real Tasks &\nWatch Quota / Behavior\n/usage • /cost\n/dashboard-* • /insights"]
S2 --> S3["3. Codify What Works\nskill_manager • script_manager\nrole_manager • memory • draft"]
S3 --> S4["4. Control Subagents\n& Failover From Real Spend\n/subagent-breakdown\n/subagent-config • /model failover"]
S4 --> S5["5. Scale & Share\n/workflow • multi_task • Judge\n/gc • kompile sources / peer"]
S5 -.->|"Every session starts smarter"| S2Stage 1: Start in chat & initialize your project
Open your repository and start in whichever surface fits you best (CLI vs. Web Harness):
cd /path/to/your/repo
kompile chat # Terminal TUI (runs SetupWizard on first launch)
# or
kompile chat --web # Multi-project browser workspace on :8081Once your first chat connects, set up the three project foundations that pay off on every future turn:
- Initialize project configuration: Run
kompile configure init(or/setupinside chat) so project-scoped settings live in.kompile/. - Build the local code index: Run
kompile code-index(or prompt the agent to calllocal_code_index action=index). This lets the agent jump straight to symbols and semantic matches viacode_search/code_graphinstead of burning tokens scanning directories. - Seed
AGENTS.md: Ask the agent itself to inspect your build system, test commands, and layout and draft a conciseAGENTS.mdat the repo root:"Inspect this repository's build tool, test commands, module layout, and coding conventions, then draft a concise
AGENTS.mdfor future sessions." - Check your baseline: Run
kompile explain(or/explaininside chat) to verify active providers, LSP servers, subagent defaults, and installed harnesses in one zero-secret snapshot.
Stage 2: Work normally & observe quota and behavior
Use the agent on real bugs, features, and refactors for a few sessions — and check how it actually behaves under your subscription or API budget:
/usage # Live vendor quota meters (Claude, Codex, agy, OpenCode Go, OpenRouter)
/cost # Current session tokens, cache hit rate, and dollar estimate
/dashboard-summary # High-level overview of turns, tools, judge verdicts, and spend
/dashboard-tokens # Token distribution across main thread vs. subagents
/dashboard-tools # Which tools are called most (spot noisy loops or oversized reads)
/subagent-breakdown # List recent subagents; /subagent-breakdown <id|latest> shows exact token sources(In the browser, open the /insights tab for cross-session reports and headless /cost queries; from the shell, run kompile usage cost or kompile stats --last=7d.)
What to look for while observing
- Prompt-cache hit rate: Healthy coding loops reuse the prefix cache heavily; repeated full-file shell dumps or unstable prompts break caching and inflate burn.
- Tool discipline: Confirm the agent is reading targeted line ranges (
read/read_batch,grep_batch,lsp) and running builds viabuild— Kompile's Enforcer catches and redirects raw shell substitutes automatically. - Quota velocity: Watch
/usageduring heavy refactors. If a single parallel fan-out eats a large chunk of your 5-hour/weekly quota, it is time to separate lead vs. worker models (Stage 4).
Stage 3: Teach the agent permanently (Skills, Scripts, Roles, Memory & Drafts)
Whenever you notice yourself giving the same multi-step instructions twice — or correcting the same mistake — prompt the agent directly to turn that knowledge into permanent Kompile assets.
1. Prompt the agent to create reusable skills (skill_manager)
Instead of re-typing release checklists, PR review rubrics, or debugging playbooks, ask the agent to create a skill:
"Use
skill_manager(create_skill,project_scope=true) to create a/release-checkskill that runs our unit tests withbuild, checkslsp action=checkon modified files, verifies version bumps, and posts aprogressreport."
That writes .kompile/skills/release-check.md (or a full package .kompile/skills/release-check/SKILL.md with supporting reference docs when layout="package"). In every future session, typing /release-check expands the exact procedure. See the dedicated Skills & Skill Manager guide.
2. Register repeatable scripts (script_manager)
Kompile's script enforcer blocks ad-hoc python3 -c / node -e one-liners so automation stays reviewable and repeatable. When an agent writes a useful verification or parsing script, prompt it:
"Register that checker with
script_manager(create_script,project_scope=true,cache_results=true) so future sessions run it via thescripttool and reuse cached green runs when inputs haven't changed."
3. Define specialized worker roles (role_manager)
For recurring delegation patterns (codebase explorer, security auditor, test writer, doc updater), prompt the agent to save a named role:
"Use
role_managerto create a read-onlysecurity-auditorrole withread,grep,glob,code_search, andlsptools so subagent audits can never edit files."
4. Persist standing facts & guardrails (memory & Enforcer)
- Durable project & feedback lessons: Tell the agent "Remember this in
memory" whenever you correct a subtle convention, environment gotcha, or architecture rule — Kompile auto-injects relevant memories as<memory_context>on future turns (Persistent Memory). - Hard mechanical rules: Promote critical invariants into Enforcer rules (
kompile configure enforcer) when you want deterministic pre-tool enforcement.
5. Stage speculative or reviewable edits with draft
When you want an agent (or read-and-draft subagents) to prepare changes while waiting on a build window — or let you review a diff before touching your working tree — ask it to work in a draft instead of editing live files:
"Stage this refactor as a Kompile
draftfirst so I can inspectdraft action=showand verify it before applying."
Every draft is stored as a JGit commit in .kompile/drafts.git, attributed to the exact session, agent, and model, and applied atomically only if files haven't drifted or been locked. See the dedicated Draft Workflow guide.
Stage 4: Use your cost data to control subagents & failover
Once you have a few sessions of real /cost, /usage, and /subagent-breakdown numbers, lock down who runs what so parallel subagents stay fast and economical:
# 1. Ban expensive frontier models from ever being dispatched as subagents
/subagent-config ban *opus*
/subagent-config ban *fable*
/subagent-config ban *astra*
/subagent-config ban *neon*
# 2. Pin fast, economical worker defaults (explicit credential name — never borrowed silently)
/subagent-config route openai/gpt-5.6-luna auth=oauth credential=default
/subagent-config role-route explorer fireworks/<fast-open-weight-model>
# 3. Cap concurrency, token spend, and dollar spend per subagent
/subagent-config per-session 4
/subagent-config budget 500000
/subagent-config cost-budget 2.00
/subagent-config preload-tools read,grep,glob,edit,write,bashEverything persists in ~/.kompile/config/subagent-config.json. Once configured:
resolve_modelautomatically omits banned models before any agent launchestask,multi_task, orquorum_task.SubagentAdmissionrefuses dispatches that violate your bans or concurrency caps.- Resumed durable children (
subagent_resume) keep their cumulative spend totals — only you can grant a fresh budget via/subagent-config refresh <subagent-id>.
Switch vendors mid-conversation or add failover ladders
You can switch vendors, credentials, or models live at any point in a session with /auth (/provider) — or /model <vendor>:<model> in the Web Harness — while keeping your transcript and owned background tasks intact. To automate quota handoffs before hitting a limit, configure backup rungs so a quota wall switches smoothly at a replay-safe request boundary:
/auth # Switch vendor, auth route, credential, and model live mid-chat
/model failover # Main chat failover ladder (SessionModelLadder)
/subagent-config failover # Independent subagent failover ladder(In the Web Harness, both ladders have visual draft editors in /settings.)
Stage 5: Scale up to multi-model workflows & quality gates
With skills, roles, and cost-capped subagents in place, you can run structured multi-agent sessions confidently:
- Multi-model teams (
/workflow): Pair a frontier lead (e.g., Opus / Astra / Sol / Neon) with economical parallelmulti_taskworkers (Luna, Sonnet, Haiku, Hydrogen, Fireworks, Together) and an independent cross-family reviewer viaquorum_taskor The Judge. - Live steering & reactive monitors: Press
Ctrl+Bto background long subagents, pressEnterwhile busy to queue follow-up thoughts, and inspect every worker's mandatory summary via/progress-reports-subagents. For long builds, CI watches, or blocked file locks, let agents rely on Kompile's event-driven Monitors & Reactive Wake-Ups (processcompletion monitors,process_notify,edit_coordinator monitor_editpaired withdraft, andwait_for_activity) rather than polling — inspect or cancel wake-ups anytime with/process-monitors,/resource-monitor, or the Web Harness/processes(Cancel wake-up) view. - Track test health over time: Run
/test-milestonesto watch pass/fail history across sessions and catch regressions immediately — see Automatic Test Milestone Recording.
Stage 6: Maintain, resume & share across machines
- Keep long sessions clean: Tune
/auto-compactso multi-hour threads summarize gracefully before hitting context ceilings. - Reclaim disk space periodically: Run
/gc(dry-run report first, then/gc run --yes) or audit visually in the Web Harness/storagetab. - Pick up effortlessly: Use
kompile chat --continue,kompile resume, orkompile resume-allafter terminal crashes or reboots — or hand off sessions across vendors (Import, Resume & Vendor Switching). - Compound across machines: Push your curated skills, roles, memories, and portable configs to a team blob store or another workstation via Peers & Sources (
kompile sources push/kompile peer sync) so every machine benefits from everything you have taught your agents.
Related guides
- How a Kompile Session Works — What you see from auth/model or resume through a standard agent turn (memories, reminders, guarded tools, verification)
- Agent Skill (
SKILL.md) — PublicSKILL.md(https://getkompile.github.io/kompile/SKILL.md) teaching agents how to act in and configure Kompile when you ask - Skills & Skill Manager — Creating, updating, packaging, and sharing reusable
/skills - Draft Workflow (
draft&draft_batch) — Version-controlled JGit drafts, 3-way rebase, and atomic audited applies - Monitors & Reactive Wake-Ups — Process completion monitors,
process_notify, edit-lock watchers, resource waiters, and/process-monitors - Subagents & Orchestration & Cost & Quota Estimation
- The Enforcer & The Judge
- Peers & Sources — Syncing skills, roles, and memories across machines