New to FORGE? Start a free 30-day trial

Ask (General Q&A)

Updated on Oct 1, 2026

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:

CommandAnswers questions aboutRequired contextOutputDefault role
frg askThe codebase in generalNoneanswer.md in the ask directory (see below)software_engineer
frg issue askThe current issueIssue ID.forge/work/job_<issue_id>/issue/answer.mdproduct_manager
frg code askThe implementation and planIssue ID.forge/work/job_<issue_id>/code/answer.mdsoftware_engineer
frg pr askThe pull requestIssue ID, PR ID.forge/work/job_<issue_id>/pr/pr_<pr_id>/answer.mdsoftware_engineer
frg docs askProject documentationIssue ID.forge/work/job_<issue_id>/docs/answer.mdtechnical_writer
frg backlog askBacklog strategyNone.forge/work/backlog/answer.mdproduct_manager
frg ticket askThe current support ticketTicket ID.forge/work/ticket_<ticket_id>/answer.mdsre
frg sec askSecurity findings and remediationSecurity scanner.forge/work/<job_id>/answer.mdsecurity_analyst

Where frg ask writes files

frg ask resolves the directory for question.md and answer.md from the current context:

text
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

text
question ──► frg ask ──► answer.md ──► follow-up frg ask (same session) ──► frg ask --clear (new topic)
  1. Ask a broad question:

    bash
    frg ask "What is the overall system architecture?"
  2. Read the answer (no Issue ID or Ticket ID set):

    bash
    cat .forge/work/ask/answer.md
  3. Follow up with details, pointing the agent at relevant files:

    bash
    frg ask --context-file docs/architecture.md "How is authentication implemented?"
  4. Start a fresh session when you change topic:

    bash
    frg ask --clear "How are database migrations run?"

frg ask

text
frg ask [OPTIONS] [QUESTION]
OptionDescriptionDefault
[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
--clearClears 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-retryRetries once automatically when expected outputs are missing. Cannot be combined with --clear.Off
--print-promptPrints the compiled prompt without running the agent.Off
--tailFollows agent execution output in real time.Off
--bypass-safety-checksSkips prompt-injection validation. Bypasses are logged. See Prompt Safety.Off
-q, --quietSuppresses all output except errors.Off

Examples:

bash
# 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:

bash
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:

  1. Pass the question: frg ask "What does this project do?", or
  2. Create question.md in the ask directory for your context (see Where frg ask writes 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:

  1. Correct the path or remove the option. Paths resolve relative to the current directory.
  2. 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:

  1. Run frg ask --print-prompt "<question>" to see what the agent receives.
  2. Add the missing files with --context-file or --context-dir.
  3. Run frg status to check the agent and model.

See Also