Skip to content

The open-source app everyone uses to manage agents at work

feat(ui): add instructions file path field to adapter config forms

Forgotten86d0c5383ec9
diff --git a/ui/src/adapters/claude-local/config-fields.tsx b/ui/src/adapters/claude-local/config-fields.tsx
index f7887279cf..b57024b648 100644
--- a/ui/src/adapters/claude-local/config-fields.tsx
+++ b/ui/src/adapters/claude-local/config-fields.tsx
@@ -10,8 +10,40 @@ import {
const inputClass =
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
-export function ClaudeLocalConfigFields(_props: AdapterConfigFieldsProps) {
- return null;
+const instructionsFileHint =
+ "Absolute path to a markdown file (e.g. AGENTS.md) that defines this agent's behavior. Injected into the system prompt at runtime.";
+
+export function ClaudeLocalConfigFields({
+ isCreate,
+ values,
+ set,
+ config,
+ eff,
+ mark,
+}: AdapterConfigFieldsProps) {
+ return (
+ <Field label="Agent instructions file" hint={instructionsFileHint}>
+ <DraftInput
+ value={
+ isCreate
+ ? values!.instructionsFilePath ?? ""
+ : eff(
+ "adapterConfig",
+ "instructionsFilePath",
+ String(config.instructionsFilePath ?? ""),
+ )
+ }
+ onCommit={(v) =>
+ isCreate
+ ? set!({ instructionsFilePath: v })
+ : mark("adapterConfig", "instructionsFilePath", v || undefined)
+ }
+ immediate
+ className={inputClass}
+ placeholder="/absolute/path/to/AGENTS.md"
+ />
+ </Field>
+ );
}
export function ClaudeLocalAdvancedFields({
diff --git a/ui/src/adapters/codex-local/config-fields.tsx b/ui/src/adapters/codex-local/config-fields.tsx
index 4de58c750d..e487a7bcc1 100644
--- a/ui/src/adapters/codex-local/config-fields.tsx
+++ b/ui/src/adapters/codex-local/config-fields.tsx
@@ -1,9 +1,16 @@
import type { AdapterConfigFieldsProps } from "../types";
import {
+ Field,
ToggleField,
+ DraftInput,
help,
} from "../../components/agent-config-primitives";
+const inputClass =
+ "w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
+const instructionsFileHint =
+ "Absolute path to a markdown file (e.g. AGENTS.md) that defines this agent's behavior. Injected into the system prompt at runtime.";
+
export function CodexLocalConfigFields({
isCreate,
values,
@@ -17,6 +24,27 @@ export function CodexLocalConfigFields({
return (
<>
+ <Field label="Agent instructions file" hint={instructionsFileHint}>
+ <DraftInput
+ value={
+ isCreate
+ ? values!.instructionsFilePath ?? ""
+ : eff(
+ "adapterConfig",
+ "instructionsFilePath",
+ String(config.instructionsFilePath ?? ""),
+ )
+ }
+ onCommit={(v) =>
+ isCreate
+ ? set!({ instructionsFilePath: v })
+ : mark("adapterConfig", "instructionsFilePath", v || undefined)
+ }
+ immediate
+ className={inputClass}
+ placeholder="/absolute/path/to/AGENTS.md"
+ />
+ </Field>
<ToggleField
label="Bypass sandbox"
hint={help.dangerouslyBypassSandbox}
diff --git a/ui/src/components/agent-config-defaults.ts b/ui/src/components/agent-config-defaults.ts
index b94c23eaca..3434f08d5b 100644
--- a/ui/src/components/agent-config-defaults.ts
+++ b/ui/src/components/agent-config-defaults.ts
@@ -3,6 +3,7 @@ import type { CreateConfigValues } from "@paperclip/adapter-utils";
export const defaultCreateValues: CreateConfigValues = {
adapterType: "claude_local",
cwd: "",
+ instructionsFilePath: "",
promptTemplate: "",
model: "",
thinkingEffort: "",