Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

files-to-prompt

$ files-to-prompt Community Low Risk
Simon Willison · Agent Bridges & Meta · Apache-2.0 · macos / linux / windows

Created by Simon Willison (simonw/files-to-prompt), this focused Unix CLI turns one or more files, directories, or stdin file lists into clean prompt text. Supports -e extension filters, --ignore globs, -c (--cxml) Claude XML tags, -m Markdown fences, and .gitignore respect.

FCRS-1.0 Score
90 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install files-to-prompt
CLI vs MCP Decision CLI Only

files-to-prompt pairs cleanly with fd, rg --files, and ttok in Unix pipelines to assemble exact prompt context without bloat.

Agent-Readiness Checklist

— JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Pure Unix-pipe ergonomics: stdout default, -c/--cxml, -m/--markdown, -e extension filter, --ignore, and stdin file lists.

  • Supports --cxml, --markdown, -e, --ignore, and stdin path lists
Trust & Safety 24 / 25

Read-only stdout stream by default (only writes if -o is explicitly passed) and honors .gitignore automatically.

  • Read-only stdout default; automatic .gitignore exclusion
Setup & Portability 14 / 15

Available via Homebrew, PyPI (pip), and uvx across macOS, Linux, and Windows.

  • Published on Homebrew and PyPI (simonw/files-to-prompt)
Utility & Efficiency 14 / 15

Sharp single-purpose Unix tool that composes effortlessly with rg, find, and ttok.

  • Composable file-to-XML/Markdown prompt assembler
Maintenance & Lineage 8 / 10

Maintained by Simon Willison (simonw/files-to-prompt) under Apache-2.0.

  • Active simonw/files-to-prompt repository
Docs & Verifiability 7 / 10

Clear README and --help documenting all flags and stdin formats.

  • Official README at github.com/simonw/files-to-prompt

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None; pure local filesystem-to-stdout Unix filter.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free and Apache-2.0 open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# files-to-prompt Agent Rules
- Always scope inputs with `-e <ext>`, `--ignore <glob>`, or piped `rg --files` paths.
- Use `-c` (`--cxml`) or `-m` (`--markdown`) for clear file boundary delimiters.
- Pipe into `ttok` when checking token budget before passing output to an LLM.

Agent-Ready Command Recipes

Safe Read-Only Queries

Bundle TypeScript files in Claude XML format
files-to-prompt src/ -e ts -e tsx --cxml

Emits <documents><document> XML blocks for .ts/.tsx files while respecting .gitignore.

Combine rg --files selection with Markdown output
rg --files -g '*.py' | files-to-prompt -m --ignore '*test*'

Accepts file paths from stdin and formats non-test Python files as Markdown.

Controlled Writes & Previews

Write bundled prompt context to a file
files-to-prompt src/ -e md -m -o docs-context.md

Writes the formatted prompt bundle directly to docs-context.md via -o.

Strengths for Agents

  • + --cxml (-c) outputs clean Claude-optimized <document> XML tags.
  • + Accepts file lists via stdin (rg --files | files-to-prompt) and null-delimited -0 input.
  • + Respects .gitignore out of the box with granular -e and --ignore filters.

Caveats & Pitfalls

  • ! Does not count tokens itself—pair with ttok for token budgeting.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI