Problem
When users have long or complex prompts, pasting them directly into CLI args causes issues:
- Shell escaping corrupts special characters
- Terminals truncate long text
- The prompt that reaches the agent may not match what the user intended
- Only the first 100 chars are logged at INFO level, making it hard to verify what was actually sent
Proposed Solution
Add a --file / -f flag to autopilot start that reads the prompt from a file.
# Write your prompt in a file
autopilot start --file my-task.txt
# Equivalent to --prompt but avoids shell corruption
autopilot start -f instructions.md
File format
Plain text — the entire file content becomes the prompt. No special format required.
Prompt file protection (two layers)
Since the agent has full write access (--allow-all), we need to protect the prompt file from being modified, committed, or pushed:
- Git exclusion: Dynamically append the file's repo-relative path to
.git/info/exclude (local-only, never committed). Prevents the file from being staged even if the agent runs git add ..
- Agent instruction: Prepend an explicit instruction to the agent prompt: "Do NOT read, modify, rename, or delete the file
<path>. It contains the task instructions and must remain unchanged."
Full prompt logging
Replace the truncated %.100s log in agent.py with full prompt logging at INFO level, so users have complete visibility into what the agent is actually executing. Also log prompt metadata (source, length) at task start.
Mutual exclusivity
--file, --prompt, and --issue are mutually exclusive — exactly one must be provided.
Implementation
- Add
--file / -f argument to start subparser in cli.py
- Update
cmd_start() prompt resolution — read file, validate exists + non-empty
- Add
prompt_file column to persistence schema (schema migration)
- Append file path to
.git/info/exclude (idempotent)
- Add protection instruction to
implement_prompt(), plan_and_implement_prompt(), fix_prompt() in prompts.py
- Pass
prompt_file through orchestrator.py → prompt construction
- Log full prompt at INFO level in
agent.py
- Log prompt source + length in
cmd_start()
- Tests: happy path, file not found, empty file, mutual exclusivity, git exclude, prompt construction
- Update README and CLI docstring
Related
🤖 autopilot-loop
Problem
When users have long or complex prompts, pasting them directly into CLI args causes issues:
Proposed Solution
Add a
--file / -fflag toautopilot startthat reads the prompt from a file.File format
Plain text — the entire file content becomes the prompt. No special format required.
Prompt file protection (two layers)
Since the agent has full write access (
--allow-all), we need to protect the prompt file from being modified, committed, or pushed:.git/info/exclude(local-only, never committed). Prevents the file from being staged even if the agent runsgit add ..<path>. It contains the task instructions and must remain unchanged."Full prompt logging
Replace the truncated
%.100slog inagent.pywith full prompt logging at INFO level, so users have complete visibility into what the agent is actually executing. Also log prompt metadata (source, length) at task start.Mutual exclusivity
--file,--prompt, and--issueare mutually exclusive — exactly one must be provided.Implementation
--file / -fargument tostartsubparser incli.pycmd_start()prompt resolution — read file, validate exists + non-emptyprompt_filecolumn to persistence schema (schema migration).git/info/exclude(idempotent)implement_prompt(),plan_and_implement_prompt(),fix_prompt()inprompts.pyprompt_filethroughorchestrator.py→ prompt constructionagent.pycmd_start()Related
--issueflag (both improve prompt input UX)🤖 autopilot-loop