Skip to content

Access to Local Files ​

UClaw agents run in managed runtime environments. They can read, write, edit, and execute against runtime workspaces when their AgentConfig.capabilities allow it.

Runtime Workspace Capabilities ​

Grant file and execution capabilities explicitly:

ts
const agent = await app.agents.create({
  title: "Workspace assistant",
  config: {
    instructions: "Help inspect and edit files in the runtime workspace.",
    capabilities: ["read", "write", "execute"],
  },
});

Local File Sync ​

Local directory sync is not part of the stable public SDK surface yet. Avoid relying on old SDK sync examples; no stable sync command is available in the current @uclaw/sdk package.

For now, use server-side scripts to upload relevant context or expose project data through an extension.

ts
await agent.updateConfig({
  extensions: [
    {
      environment: "agent",
      name: "read_project_note",
      description: "Return project context supplied by the host app.",
      parameters: {
        type: "object",
        properties: {},
      },
      code: `
export default async function () {
  return "Project context goes here.";
}
`,
    },
  ],
});

To define custom scripts and JS handlers for agents, continue to Create Custom Tools.