VTCode
AGENTS.md903 starsChanged 27 days agoApache-2.0View on GitHub
Keep this file under 12 KiB (enforced: root plus the largest module AGENTS.md must fit VT Code's 16 KiB instruction budget, scripts/check_docs_links.py). Details belong in docs/, skills, .vtcode/memory/, or crate AGENTS.md files; universal model behavior is compiled in crates/codegen/vtcode-core/src/prompts/runtime_guidance.rs. Instruction files are user-controlled context, not a security boundary. Repo-only: do not copy into other projects or shipped prompts.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- vinhnx/vtcodeword for word, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- vinhnx/vtcode★ 903100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- rust-skillsAGENTS.md
- src/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- rust-skillsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Read and apply: use read-and-apply, rust-skills/agentic-testing, and verification-discipline.
- Very specific: line 12
Verify with ./scripts/check-dev.sh + cargo nextest run.
- Distinctive: line 19
Keep changes surgical: know which files the increment owns, preserve APIs and unrelated work, stage explicit reviewed paths, and check each …
- Distinctive: line 21
Prefer direct single-agent execution.
- Very specific: line 24
Prefer compact_str::CompactString (aliased as CompactStr in vtcode_core::types) over String for small string fields.
- Distinctive: line 27
Treat the sandbox/exec boundary as a primary adversarial surface: use sandbox-aware launch paths and add adversarial regression coverage …
- Very specific: line 30
DO NOT read or modify user's TODO.md (docs/project/TODO.md).
- Distinctive: line 34
When a bug appears in VT Code's own behavior, fix VT Code — do not work around it yourself.
- Very specific: line 35
Before proposing a fix, read the trajectory log at .vtcode/logs/trajectory.jsonl, .vtcode/checkpoints, <repo>/.vtcode/sessions to see what …
- Very specific: line 36
Every self-bug fix must land in the shipped surfaces the release binary carries — runloop/tool logic and compiled prompts …
- Very specific: line 56
Every crate has its own AGENTS.md with crate-specific conventions, next to its Cargo.toml (the root binary's is src/AGENTS.md).
- Very specific: line 58
After significant changes, use the audit-module-agents skill.
- Very specific: line 67
Prefer ./scripts/check-dev.sh (10-30s) over ./scripts/check.sh (2-5m) for iteration.
- Very specific: line 90
Test layout: small suites in-module.
- Very specific: line 91
Test visibility: keep fixtures in their test module and use the narrowest pub(super).
- Very specific: line 92
Test evidence: assert independently derived outcomes with asymmetric inputs and both sides of boundaries.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- markdownlint-disable MD013 -->AGENTS.md
Keep this file under 12 KiB (enforced: root plus the largest module AGENTS.md must fit VT Code's 16 KiB instruction budget, scripts/check_docs_links.py). Details belong in docs/, skills, .vtcode/memory/, or crate AGENTS.md files; universal model behavior is compiled in crates/codegen/vtcode-core/src/prompts/runtime_guidance.rs. Instruction files are user-controlled context, not a security boundary. Repo-only: do not copy into other projects or shipped prompts.
Core Workflow (repo-only)
- Orient: repository instructions, relevant source/tests, and task-relevant entries in
.vtcode/memory/(search, do not concatenate). For self-bugs, read.vtcode/logs/trajectory.jsonl,.vtcode/checkpoints,.vtcode/sessions. - Research hard problems only: DeepWiki MCP for
vinhnx/vtcode(baseline) andopenai/codex(upstream); verify claims against the checkout or pinned upstream source, attribute sources, stay within the original authorization. See the reference workflow. - Read and apply: use
read-and-apply,rust-skills/agentic-testing, andverification-discipline; implement the smallest complete DRY/KISS improvement; preserveThreadEvent, the harness config split, sandbox/approval boundaries, rollback, durable history, and unrelated work. Adapted upstream code keeps Apache-2.0 attribution (root notes). - Verify with
./scripts/check-dev.sh+cargo nextest run; record durable learnings in.vtcode/memory/(local-only, gitignored). Interview the user on plan open questions via the interactive question tool (one at a time, recommended answer first) instead of assuming defaults.
Rules
- Conventional Commits (
type(scope): subject). - 4-space indentation,
snake_casefns,PascalCasetypes,anyhow::Result<T>+.with_context(). Follow the Rust style adoption matrix for flexible borrows, targetedmust_use, API conventions, and exceptions. - CI sets
RUSTFLAGS: "-D warnings"and uses--locked. Match locally withcargo check --lockedwhen relevant. - Keep changes surgical: know which files the increment owns, preserve APIs and unrelated work, stage explicit reviewed paths, and check each scoped commit's staged diff.
- Hard ceiling: no tracked text file may exceed 1000 lines (
python3 scripts/check_file_length.py --mode enforce, gated bycheck-dev.sh/check.sh/pre-commit hook). Park generated/vendored outliers inscripts/file_length_allowlist.txtasglob=MAX_LINES; never allowlist first-party source without a split plan. - Prefer direct single-agent execution. Do not impose orchestrator/worker or other multi-agent topologies: forced delegation burns usage limits and usually yields worse results. Delegate only when independent/parallel work or context isolation clearly helps.
vtcode-exec-events::ThreadEventis the authoritative runtime event contract — do not invent parallel types.- Harness config is split across
agent.harness,automation.full_auto,context.dynamic— do not add a new top-level harness subsystem. - Prefer
compact_str::CompactString(aliased asCompactStrinvtcode_core::types) overStringfor small string fields. UseCow<'static, str>for mostly-static return strings. - Shape-suffix naming: encode data shape in names; document a dimension key for feature vectors; promote structured tuples to named structs.
clippy.tomlallowsunwrap/panic/indexing in tests only. Avoid Rustunsafe(workspace lints warn onunsafe_code); where it is unavoidable, keep the block minimal and justify it with a// SAFETY:comment (undocumented_unsafe_blocks).- Treat the sandbox/exec boundary as a primary adversarial surface: use sandbox-aware launch paths and add adversarial regression coverage for command injection, path/symlink escape, environment leakage, and fail-closed behavior.
- All built-in themes must meet WCAG AA 4.5:1 contrast for foreground and all accent fields against background. Validate with
cargo nextest run -p vtcode-ui -E 'test(theme)'. See.vtcode/memory/gotchas.mdfor catppuccin-latte special-case. - Every new major feature must update docs: user-facing behavior in
docs/development/plus its quick-reference; tool surface in prompt guidance (vtcode-core/src/prompts/guidelines/) and schema (vtcode-utility-tool-specs); runtime contract inThreadEvent. - DO NOT read or modify user's TODO.md (docs/project/TODO.md). This file is for the user's personal task management and should remain private and untouched by the agents.
Self-Debugging (VT Code fixing itself)
- When a bug appears in VT Code's own behavior, fix VT Code — do not work around it yourself. Patch the VT Code source that caused the bug; never substitute a manual workaround, wrapper script, or config shim in place of a source fix.
- Before proposing a fix, read the trajectory log at
.vtcode/logs/trajectory.jsonl,.vtcode/checkpoints,<repo>/.vtcode/sessionsto see what actually happened (tool calls, errors, retries) rather than guessing from the symptom. - Every self-bug fix must land in the shipped surfaces the release binary carries — runloop/tool logic and compiled prompts (
crates/codegen/vtcode-core/src/prompts/) — not only in workspace-local files (AGENTS.md, docs), which affect this repository alone. Changing compiled guidance requires updating its budget/presence test.
Detailed Guides
- Development, testing, evals: README, SETUP, testing, pty-testing, eval, desktop workspace.
- CI/release + models: ci-cd, toolchain/MSRV, CHANGELOG, ADDING_MODELS, WORKFLOW, CHECKLIST.
- Architecture + tools/security: code-organization, async, perf, grep-guide, grep-ref, COMMAND_SECURITY, security.
- WebMCP + harness: webmcp, agent-loop, harness INDEX, CORE_BELIEFS, INVARIANTS, LEGIBILITY.
- Prompt/runtime + planning/automation + loop: runtime-guidance, planning, full-auto, EXECUTION_POLICY, loop-eng.
Workspace
Cargo workspace, 25 crates. Rust stable, MSRV 1.99.1, edition 2024. default-members = root, vtcode-core, vtcode-ui only.
Crate roles live in each crate's Cargo.toml description and ARCHITECTURE. Not obvious from the code: vtcode-desktop is a non-publishable GPUI app while vtcode-desktop-protocol is published (the vtcode binary depends on it); vtcode-llm and vtcode-skills are partial extractions from vtcode-core.
New reusable logic: put it in an existing small crate or a new one. Keep it out of vtcode-core by default unless tightly coupled to the core runtime.
Per-Module Guidance
Every crate has its own AGENTS.md with crate-specific conventions, next to its Cargo.toml (the root binary's is src/AGENTS.md); list them with git ls-files '*AGENTS.md'.
After significant changes, use the audit-module-agents skill. Keep each module AGENTS.md to about 30 short lines (none over 600 characters; enforced) and put longer detail in docs/development/maintainer-notes/<crate>.md.
Project Memory
Session-independent knowledge lives in .vtcode/memory/ (gitignored, repo-local only): gotchas.md, issues.md, library.md, decisions.md, and scratch.md. Read these files when context is needed. Write durable learnings there. Harness/agent-logic-only openai/codex pattern lives in library.md (2026-09-24). See .vtcode/memory/README.md for format rules.
Build & Verification
- CI: overlap independent setup steps, keep Cargo steps sharing
target/sequential, and keySwatinem/rust-cacheper target in cross-target matrices (ci-cd). - Prefer
./scripts/check-dev.sh(10-30s) over./scripts/check.sh(2-5m) for iteration. - Release builds keep
debug-assertionsandoverflow-checkson: a violated invariant must crash loud. Gate expensive diagnostics behind#[cfg(debug_assertions)].
| Change | Command |
| Fast gate | ./scripts/check-dev.sh |
| + tests (quick) | ./scripts/check-dev.sh --test |
| + tests (changed crates) | ./scripts/check-dev.sh --changed |
| + workspace | ./scripts/check-dev.sh --workspace |
| + lints | ./scripts/check-dev.sh --lints |
| Harness PTY/TUI | ./scripts/check.sh harness |
| Release/PR | ./scripts/check.sh |
| Unsafe-docs gate | ./scripts/check.sh unsafe-docs |
| Ast-grep rules | vtcode check ast-grep |
| Hawk dead-code/visibility | ./scripts/hawk.sh |
| Hawk (deny warnings) | ./scripts/hawk.sh --deny |
| Ast-grep scan | ast-grep scan (requires sgconfig.yml + rules/) |
Testing
- Runner:
cargo nextest run(parallel, fast). Always use nextest — nevercargo test. - Single test/crate:
cargo nextest run test_name/cargo nextest run -p vtcode-core. Profiles:default(full),quick(TDD, skips integration/e2e/slow),changed(delta since HEAD~1),ci(retries flaky, no fail-fast). - Harness regressions:
cargo nextest run -p vtcode-core -E 'binary(/pty_tests/)';cargo nextest run -p vtcode-bash-runner -E 'binary(/pipe_tests/)';cargo nextest run --locked -p vtcode -E 'test(inline_events)'. - Test layout: small suites in-module; larger ones in a private
#[cfg(test)] mod tests;after all items (foo.rsandfoo/mod.rsboth loadfoo/tests.rs). Integration tests intests/, script tests inscripts/tests/. - Test visibility: keep fixtures in their test module and use the narrowest
pub(super); never widen APIs, add dependencies, or change production behavior just for tests. - Test evidence: assert independently derived outcomes with asymmetric inputs and both sides of boundaries; for Tokio task IDs,
tokio::spawnthe tested future (root notes). - Verification scope: focused locked nextest filters with a nonzero match count, then broaden by risk; report passed, failed, and excluded tests. Docs-only edits need Markdown and diff checks.
Skills & Special Workflows
- Project skills live in
.agents/skills/<name>/SKILL.md; onlyrust-skillsis linked into.claude/skills/. Where an agent does not load.agents/skills/, read the namedSKILL.mddirectly. - LLM providers: use the
adding-llm-providersskill. The/modelpicker usesModelId::all_models();builtin_model_presets()is used byModelsManager. Both may need updates. - New workspace crates: use the
adding-workspace-crateskill. This affects more thanCargo.toml; all workspace path dependencies needversionfields. - Structural code work:
ast-grep(never thesgalias) for code shape and codemods,rgfor prose and config. GitHub: preferghover webfetch; on 403 rununset GITHUB_TOKEN && gh auth switch -u vinhnx(root notes). - Cap large output with
| head -c 4000, but never pipe verifier commands (it masks their exit status); in VT Code passmax_output_tokens.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

