Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ pub(crate) struct Args {
/// Suppress non-error CLI/status output for scripting and wrappers
#[arg(long, global = true)]
pub(crate) quiet: bool,
/// Skip loading AGENTS.md and CLAUDE.md context files
#[arg(long, short = 'c', global = true)]
pub(crate) no_context_files: bool,

/// Resume a session by ID, or list sessions if no ID provided
#[arg(long, global = true, num_args = 0..=1, default_missing_value = "")]
Expand Down
5 changes: 5 additions & 0 deletions src/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ pub struct ContextInfo {
pub memory_chars: usize,
/// Prompt overlay section size (chars)
pub prompt_overlay_chars: usize,
/// Skip loading AGENTS.md and CLAUDE.md context files
pub no_context_files: bool,

// === Dynamic (Conversation) ===
/// Tool definitions sent to API (chars)
Expand Down Expand Up @@ -203,6 +205,7 @@ pub fn build_system_prompt_full(
let mut parts = vec![DEFAULT_SYSTEM_PROMPT.to_string()];
let mut info = ContextInfo {
system_prompt_chars: DEFAULT_SYSTEM_PROMPT.len(),
no_context_files: std::env::var("JCODE_NO_CONTEXT_FILES").is_ok() || std::env::var("JCODE_NC").is_ok(),
..Default::default()
};

Expand Down Expand Up @@ -276,6 +279,7 @@ pub fn build_system_prompt_split(
let mut dynamic_parts = Vec::new();
let mut info = ContextInfo {
system_prompt_chars: DEFAULT_SYSTEM_PROMPT.len(),
no_context_files: std::env::var("JCODE_NO_CONTEXT_FILES").is_ok() || std::env::var("JCODE_NC").is_ok(),
..Default::default()
};

Expand Down Expand Up @@ -601,6 +605,7 @@ fn gpu_summary() -> Option<String> {

/// Load AGENTS.md files from a specific working directory
pub fn load_agents_md_files_from_dir(working_dir: Option<&Path>) -> (Option<String>, ContextInfo) {
if std::env::var("JCODE_NO_CONTEXT_FILES").is_ok() || std::env::var("JCODE_NC").is_ok() { return (None, ContextInfo::default()); }
let mut contents = vec![];
let mut info = ContextInfo::default();

Expand Down