Ask (General Q&A)
frg ask answers a question about your codebase without requiring an Issue ID, PR ID, or Ticket ID. Use it to explore architecture, conventions, and implementation details; it is read-only. To make changes, use frg run.
Prerequisites
- A valid Telerik license. See Licensing.
- A supported coding agent, installed and authenticated. Check it with
frg status. - No work-item context is required.
Subcommands at a glance
frg ask has no subcommands. Every workflow group also has its own ask subcommand that answers with that group's context. Pick the one that matches your question:
| Command | Answers questions about | Required context | Output | Default role |
|---|---|---|---|---|
frg ask | The codebase in general | None | answer.md in the ask directory (see below) | software_engineer |
frg issue ask | The current issue | Issue ID | .forge/work/job_<issue_id>/issue/answer.md | product_manager |
frg code ask | The implementation and plan | Issue ID | .forge/work/job_<issue_id>/code/answer.md | software_engineer |
frg pr ask | The pull request | Issue ID, PR ID | .forge/work/job_<issue_id>/pr/pr_<pr_id>/answer.md | software_engineer |
frg docs ask | Project documentation | Issue ID | .forge/work/job_<issue_id>/docs/answer.md | technical_writer |
frg backlog ask | Backlog strategy | None | .forge/work/backlog/answer.md | product_manager |
frg ticket ask | The current support ticket | Ticket ID | .forge/work/ticket_<ticket_id>/answer.md | sre |
frg sec ask | Security findings and remediation | Security scanner | .forge/work/<job_id>/answer.md | security_analyst |
Where frg ask writes files
frg ask resolves the directory for question.md and answer.md from the current context:
Issue ID set? ── yes ──► .forge/work/job_<issue_id>/ask/
│ no
Ticket ID set? ── yes ──► .forge/work/ticket_<ticket_id>/ask/
│ no
└────────────────► .forge/work/ask/
Typical flow
question ──► frg ask ──► answer.md ──► follow-up frg ask (same session) ──► frg ask --clear (new topic)
-
Ask a broad question:
bashfrg ask "What is the overall system architecture?" -
Read the answer (no Issue ID or Ticket ID set):
bashcat .forge/work/ask/answer.md -
Follow up with details, pointing the agent at relevant files:
bashfrg ask --context-file docs/architecture.md "How is authentication implemented?" -
Start a fresh session when you change topic:
bashfrg ask --clear "How are database migrations run?"
frg ask
frg ask [OPTIONS] [QUESTION]
| Option | Description | Default |
|---|---|---|
[QUESTION] | Question to ask. If omitted, Forge reads question.md from the ask directory. | None |
-a, --agent <NAME> | Coding agent for this run: claude_code, github_copilot, or opencode. | Agent in agents.toml |
-r, --role <ROLE> | Overrides the default role: product_manager, software_engineer, software_architect, technical_writer, security_analyst, sre. Cannot be combined with --custom-agent. | software_engineer |
--custom-agent <NAME> | Selects a custom agent configuration inside your coding agent. Cannot be combined with --role. Forge does not check that the name exists. | None |
-m, --model <MODEL> | Overrides the model configured in agents.toml. Valid values depend on the agent. | Model in agents.toml |
-c, --context-file <FILE> | Adds a file path as context. Repeatable. Relative and absolute paths work. | None |
--context-dir <DIR> | Adds a directory as context. Repeatable. Up to 100 files per directory and 1 MB per file; binary files and hidden directories such as .git and .forge are skipped. | None |
--clear | Clears the existing agent session and starts fresh. | Off |
--retry [<INSTRUCTIONS>] | Continues the previous session to complete missing outputs. Requires an existing session; cannot be combined with --clear. | Off |
--auto-retry | Retries once automatically when expected outputs are missing. Cannot be combined with --clear. | Off |
--print-prompt | Prints the compiled prompt without running the agent. | Off |
--tail | Follows agent execution output in real time. | Off |
--bypass-safety-checks | Skips prompt-injection validation. Bypasses are logged. See Prompt Safety. | Off |
-q, --quiet | Suppresses all output except errors. | Off |
Examples:
# Choose a role that matches the question
frg ask --role security_analyst "Are there vulnerabilities in the auth flow?"
# Several context sources
frg ask --context-dir docs/patterns --context-dir examples/ "Which patterns should I follow?"
# Inspect the prompt without running the agent
frg ask --print-prompt "Explain the caching strategy"
Ask a long question from a file
For questions with several paragraphs or code, write question.md and run frg ask without an argument. This example assumes no Issue ID or Ticket ID is set:
mkdir -p .forge/work/ask
cat > .forge/work/ask/question.md << 'EOF'
# Caching strategy
We need a caching layer for the API.
1. Which caching libraries does this project already use?
2. Which existing patterns should a new cache follow?
3. How should cache invalidation be tested?
EOF
frg ask --role software_architect
cat .forge/work/ask/answer.md
When you pass QUESTION on the command line, Forge also writes it to question.md.
Troubleshooting
No question provided
Cause: You ran frg ask without QUESTION, and no question.md exists in the ask directory.
Solution:
- Pass the question:
frg ask "What does this project do?", or - Create
question.mdin the ask directory for your context (see Wherefrg askwrites files).
Question file exists but is empty
Cause: question.md contains only whitespace.
Solution: Add the question to the file, then run frg ask again.
Invalid context file(s): or Invalid context directory/directories:
Cause: A --context-file or --context-dir path does not exist, is not readable, or (for --context-dir) is not a directory.
Solution:
- Correct the path or remove the option. Paths resolve relative to the current directory.
- Run the command again.
The --retry flag requires a previous session to continue
Cause: You used --retry before any session exists.
Solution: Run frg ask without --retry first. Use --retry on a later run when outputs are missing.
The answer misses expected context
Solution:
- Run
frg ask --print-prompt "<question>"to see what the agent receives. - Add the missing files with
--context-fileor--context-dir. - Run
frg statusto check the agent and model.
See Also
- Run (Standalone Task Execution): execute changes instead of asking.
- Issue Management, Code Operations, Pull Requests, Ticket Workflows: context-specific
asksubcommands. - Session Context: how follow-up questions reuse a session.
- Workflow Commands.
- Command Reference.