repo copilot - kongusen/loom-agent GitHub Wiki
Use this pattern when the agent acts as a coding or repository assistant for one codebase.
- continuity across follow-up questions
- repository-specific instructions
- read-only file and web capabilities by default
- optional grounded knowledge from local docs
from loom import Agent, Capability, Model, RunContext, Runtime, SessionConfig
agent = Agent(
model=Model.anthropic("claude-sonnet-4"),
instructions=(
"You are a repository copilot. "
"Prefer concrete, code-aware answers and keep changes scoped."
),
capabilities=[
Capability.files(read_only=True),
Capability.web(),
],
runtime=Runtime.long_running(criteria=["answers are grounded in repository evidence"]),
)
session = agent.session(SessionConfig(id="repo-user-123"))
first = await session.run("Summarize the current package layout")
second = await session.run(
"Which API boundaries still look too wide?",
context=RunContext(inputs={"previous_summary": first.output}),
)For repo copilots, keep the agent stable and the session long-lived.
That usually means:
- repository identity belongs in instructions or session metadata
- current question-specific facts belong in
RunContext - broad permissions belong in
Capability - runtime behavior belongs in
Runtime
- start read-only
- add shell/write-capable capabilities only for explicit editing workflows
- prefer session continuity over rebuilding the agent each turn