Trigger and scope
Trigger on: VCL files, .vcl extensions, XVCL files, .xvcl extensions, falco CLI, VCL unit tests, VCL linting/simulation/formatting, VCL REPL, beresp/bereq/req.http variables, subroutine scopes, backend/ACL/director/table declarations, edge dictionaries, validating VCL in Terraform plans, or running/testing XVCL scripts locally.
Do NOT use for: generic non-Fastly VCL, Fastly Compute/WASM, Fastly API/dashboard ops, CDN comparison, cache purging, or authoring Terraform resources.
Falco — VCL Development Tool & Reference
Falco is a Fastly VCL development tool for linting, testing, simulating, and formatting VCL code. Equally important, the falco source code is the most complete machine-readable specification of Fastly's VCL dialect — its parser, interpreter, and type system document every variable, function, type, and scope rule in VCL.
Official VCL documentation: https://www.fastly.com/documentation/guides/full-site-delivery/fastly-vcl/about-fastly-vcl/
Falco documentation: https://github.com/ysugimoto/falco
Using Falco Source as VCL Reference
If you need to understand how VCL works — what variables exist, which scopes they're available in, what functions are built-in, how types coerce — the falco source code is your best reference. It's a complete Go implementation of Fastly's VCL 2.x and is more precise than prose documentation.
If the falco source is not available locally, recommend cloning it:
Once available locally, read the source files directly to answer VCL questions. See understanding-vcl-from-source.md [blocked] for a detailed guide on which files to read for different VCL topics.
Install
Commands
Common flags (all commands)
Quick reference
Lint before deployment:
Run tests:
Development with watch mode:
Run VCL locally (this is how you "run" or "test locally" — use simulate, not just lint):
Format all VCL:
Terraform integration:
Common VCL Issues
Falco catches these, but understanding them prevents wasted lint-fix cycles:
- Type mismatch:
set req.http.X-API = true— HTTP headers are STRING, not BOOL. Use"true". - Missing time suffix:
set beresp.ttl = 86400— RTIME values needssuffix:86400s. - Wrong scope:
beresp.*only exists invcl_fetch. Invcl_deliver, useresp.*. - Deprecated:
req.request→ usereq.method. Falco accepts both, but always change toreq.methodwhen fixing VCL. - Synthetic strings:
synthetic "text"needs long-string syntax:synthetic {"text"}. - Backend naming: Use
F_prefix:backend F_origin { ... }, notbackend origin. - No modulo operator: VCL has no
%. Usesubstr()on a hash orrandomint()for splitting. req.url.pathis read-only in tests: Useset req.url = "/path"in test subroutines, notset req.url.path.- Vary placement: Vary must be set in
vcl_fetch, not justvcl_deliver. Setting Vary after the object enters the cache is too late — the cache key won't include the Vary dimensions.
Configuration
Create .falco.yaml in project root for persistent settings:
Environment variables
Required when using -r, --remote flag.
Configure API credentials locally, outside chat. Never ask for an API key in a conversation or print its value.
References
Source Code as VCL Reference (Quick Lookup)
When you have access to the falco source code locally (default: ~/src/falco), use these paths to answer specific VCL questions:
For a comprehensive guide, see understanding-vcl-from-source.md [blocked].


