briefing: Project briefings

View source: R/briefing.R

briefingR Documentation

Project briefings

Description

Generate project context for AI coding agents. Generate a project briefing

Produces a concise markdown briefing combining DESCRIPTION metadata, downstream dependents, 'Claude Code' memory (skipped when agent = "claude" since 'Claude Code' autoloads it), and recent git commits. Written to the user cache directory so both the agent and user see the same context.

Usage

briefing(project = NULL, scan_dir = path.expand("~"), agent = NULL,
         memory_base = file.path(path.expand("~"), ".claude", "projects"),
         briefs_dir = file.path(tools::R_user_dir("saber", "cache"), "briefs"),
         max_memory_lines = 30L)

Arguments

project

Project name. If NULL, inferred from the current working directory basename.

scan_dir

Directory to scan for project directories.

agent

Which coding agent is calling: "claude", "codex", or NULL (interactive / unknown). When "claude", the briefing skips 'Claude Code' memory (which 'Claude Code' autoloads separately). Other values include it.

memory_base

Base directory for 'Claude Code' project memory files.

briefs_dir

Directory to write briefing markdown files.

max_memory_lines

Maximum lines to include from the memory file.

Value

The briefing text (character string), returned invisibly. Printed to stdout and written to briefs_dir/{project}.md.

Examples

d <- file.path(tempdir(), "briefpkg")
dir.create(file.path(d, "R"), recursive = TRUE, showWarnings = FALSE)
writeLines(c("Package: briefpkg", "Title: Demo", "Version: 0.1.0"),
           file.path(d, "DESCRIPTION"))
briefing("briefpkg", scan_dir = tempdir(),
         briefs_dir = file.path(tempdir(), "briefs"))

saber documentation built on April 5, 2026, 9:06 a.m.