Customization
Project Instruction Files
Swival can load two project-local instruction files from the base directory during startup. CLAUDE.md is injected as <project-instructions>...</project-instructions>, and AGENT.md is injected as <agent-instructions>...</agent-instructions>. If both files exist, Swival loads both in that order.
Each file is capped at 10,000 characters. These instructions are appended to the built-in system prompt, which makes them a practical place to encode house rules such as test commands, coding conventions, and dependency policies.
This is a Go project using Chi for routing. Tests use testify.
Always run `go test ./...` after making changes.
Don't add dependencies without asking.
Use --no-instructions when you do not want Swival to read either file.
swival --no-instructions "task"
If you set --system-prompt, project instruction files are also skipped because you are providing the full prompt text directly.
System Prompt Control
The built-in prompt is stored in swival/system_prompt.txt and defines default behavior, tool policy, and coding expectations.
You can replace it completely with --system-prompt.
swival --system-prompt "You are a security auditor. Only report vulnerabilities." "Audit src/"
You can also remove the system message entirely with --no-system-prompt.
swival --no-system-prompt "Just answer: what is 2+2?"
--system-prompt and --no-system-prompt are mutually exclusive.
When a system message is present, Swival appends the current local date and time to that system content.
Sampling And Reproducibility
--temperature and --top-p control response sampling.
swival --temperature 0.3 --top-p 0.9 "task"
If you do not set --temperature, provider defaults apply. --top-p defaults to 1.0.
--seed passes a deterministic seed when the provider supports it.
swival --seed 42 "task"
Seeded runs are usually more stable, but identical output is still not guaranteed across all providers, model versions, and hardware environments.
Turn And Token Limits
--max-turns limits how many agent-loop iterations are allowed.
swival --max-turns 10 "quick task"
The default turn limit is 100. If the loop reaches this limit without a final answer, Swival exits with code 2.
--max-output-tokens limits tokens generated per model call.
swival --max-output-tokens 16384 "task"
The default is 32768. If prompt size and context constraints require it, Swival clamps output budget downward automatically.
--max-context-tokens sets requested context length.
swival --max-context-tokens 65536 "task"
For LM Studio, this can trigger a model reload. When both --max-context-tokens and --max-output-tokens are set, --max-output-tokens must be less than or equal to context length.