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

GNU tar

$ tar Foundation Med Risk
GNU Project · Files & Search · GPL-3.0 · macos / linux / windows

tar is installed across virtually every Linux, macOS, and container image. Agents can inspect archive entries read-only with tar -tf before extracting into an isolated -C directory, while avoiding untrusted archive path-traversal or accidental file overwrites.

FCRS-1.0 Score
83 /100
Good
High Confidence
Zero-Friction Install
brew install gnu-tar
CLI vs MCP Decision CLI Only

Archive creation and extraction run natively on local disk/streams with zero reason to wrap in MCP.

Agent-Readiness Checklist

Local Probe Evidence
— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md
Version
bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8
Startup
14 ms
Exit Codes (help / invalid)
0 / 1
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
tar(bsdtar): manipulate archive files
First option must be a mode specifier:
  -c Create  -r Add/Replace  -t List  -u Update  -x Extract
Common Options:
  -b #  Use # 512-byte records per I/O block
  -f <filename>  Location of archive
  -v    Verbose
  -w    Interactive
Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
  <file>, <dir>  add these items to archive
  -z, -j, -J, --lzma  Compress archive with gzip/bzip2/xz/lzma
  --format {ustar|pax|cpio|shar}  Select archive format
  --exclude <pattern>  Skip files that match pattern
  -C <dir>  Change to <dir> before processing remaining files
  @<archive>  Add entries from <archive> to output
List: tar -t [options] [<patterns>]
  <patterns>  If specified, list only entries that match
Extract: tar -x [options] [<patterns>]
  <patterns>  If specified, extract only entries that match
  -k    Keep (don't overwrite) existing files
  -m    Don't restore modification times
  -O    Write entries to stdout, don't restore to disk
  -p    Restore permissions (including ACLs, owner, file flags)
bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 17 / 25

Non-interactive and ubiquitous, but lacks --json output and suffers minor BSD vs GNU flag divergence on macOS.

  • POSIX flags work headlessly; GNU vs BSD long-flag differences exist
Trust & Safety 19 / 25

Extracting archives can overwrite existing files silently unless -k and -C are used.

  • Overwrites files on extract by default without -k (--keep-old-files)
Setup & Portability 14 / 15

Available everywhere (tar preinstalled on Linux/macOS; brew install gnu-tar gives gtar on macOS).

  • Standard system tool across Unix platforms
Utility & Efficiency 15 / 15

Indispensable for reading, verifying, and packaging release tarballs in CI and workspaces.

  • Universal archive format supported across toolchains
Maintenance & Lineage 10 / 10

Foundational GNU Project utility maintained continuously for decades.

  • GNU foundation stewardship under GPL-3.0
Docs & Verifiability 8 / 10

Comprehensive GNU manual and man pages.

  • Official GNU tar manual at gnu.org

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates on local files and stdio.

Side Effects
Read-Only Local Write Destructive
Cost & Quotas

100% free, offline, and open-source (GPL-3.0).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# tar Agent Rules
- ALWAYS inspect untrusted tarballs with `tar -tf` first (check for `..` or absolute paths) and extract into a fresh `-C <dir>`.
- Note GNU `tar` (`gtar` on macOS) vs BSD `tar` flag differences—stick to portable POSIX flags (`-c`, `-x`, `-t`, `-v`, `-f`, `-z`, `-C`).

Agent-Ready Command Recipes

Safe Read-Only Queries

List archive contents read-only before extraction
tar -tvf release.tar.gz

Prints file paths, permissions, and sizes inside the archive without writing to disk.

Controlled Writes & Previews

Extract archive into an explicit target directory without overwriting
tar -xvkf release.tar.gz -C ./staging

Uses -k (--keep-old-files) and -C to prevent overwriting existing files or polluting cwd.

Strengths for Agents

  • + Preinstalled across virtually all Linux containers, CI runners, and macOS hosts.
  • + Supports read-only listing (-tf / -tvf) and directory scoping (-C).

Caveats & Pitfalls

  • ! Default extraction overwrites existing files unless -k (--keep-old-files) is specified.
  • ! GNU-only long flags (like --zstd or --transform) may fail on macOS stock BSD tar.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI