/iris-dev:objectscript-debuggingfrom iris-dev
Captures IRIS diagnostic packets, maps .INT offsets to .CLS source lines, and correlates error logs for diagnosing runtime errors and compile failures.
Ships in iris-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ground AI debugging in real IRIS signals — compiler errors, messages.log entries, stack traces, and local variable state — rather than guessing from code alone.
<UNDEFINED>, <SUBSCRIPT>, <PROTECT>, or other IRIS runtime error.INT offset (e.g. +3^MyApp.Foo.1)iris_debugiris_debug is a unified dispatcher that covers all debugging actions in a single tool call.
| Action | What it does |
|---|---|
iris_debug(action="map_int") | Map a .INT offset to the originating .CLS source line |
iris_debug(action="error_logs") | Fetch recent error log entries from messages.log and ^ERRORS |
iris_debug(action="capture") | Capture current error state (packet snapshot with stack + locals) |
iris_debug(action="source_map") | Build the full .INT → .CLS mapping for a routine |
iris_debug is available in the merged toolset. In the baseline toolset, use the individual tools:
debug_map_int_to_cls — maps .INT offset to .CLS source linedebug_capture_packet — captures current error statedebug_get_error_logs — fetches recent error log entriesIf a tool call returns NOT_IMPLEMENTED, switch to toolset = "merged" in your connection config.
# Preferred: structured method signatures + inheritance chain
docs_introspect(class_name="MyPackage.MyClass")
docs_introspect(class_name="%ASQ.Engine") # works on system classes too
# When you need full raw source with macros (e.g. $$$DISPATCH, #define):
# Export from IRIS, then read the file:
docker exec <container> iris session IRIS -U USER \
"set sc = \$system.OBJ.ExportUDL(\"MyClass.cls\",\"/tmp/out.cls\") halt"
docker cp <container>:/tmp/out.cls /tmp/out.cls
# Then use the Read tool on /tmp/out.cls — NEVER cat it
The .INT source is not readable via $TEXT on system classes (stored as object code). Use ExportUDL to get the .cls source instead.
Call iris_debug(action="capture") to snapshot the current IRIS error state:
Tool: iris_debug(action="capture")
Inputs: namespace (default USER), include_locals (default true)
Returns: error_message, stack trace, redacted local variables, timestamp
Always capture before attempting a fix — the packet is your ground truth.
If the error references a .INT routine offset, resolve it to the original .CLS source line:
Tool: iris_debug(action="map_int")
Inputs: error_string (e.g. "<UNDEFINED>x+3^MyApp.Foo.1") OR (routine, offset)
Returns: class name, method name, line number, source snippet
You can pass the raw IRIS error string directly — the tool parses it automatically.
Pull recent errors from messages.log and ^ERRORS global:
Tool: iris_debug(action="error_logs")
Inputs: time_window_hours (default 24), max_entries (default 100)
Returns: unified log with timestamps, error codes, namespaces
# List all registered IRIS instances (named pool + Docker containers):
iris_servers()
# Route a single call to a named instance without changing the default:
iris_execute(server="dev", code="Write $ZV")
# Or switch the default to a different Docker container (legacy):
iris_list_containers()
iris_select_container(name="arno_iris_test")
iris_select_container(name="arno_iris_test", password="SYS2") # if password changed
# Then retry the failing tool
Cross-reference the packet, source mapping, and logs to identify root cause. Apply fix. Recompile. Verify no new errors appear in logs.
| Error | Likely cause | Fix pattern |
|---|---|---|
<UNDEFINED> | Variable used before SET | Check method entry path; add default |
<SUBSCRIPT> | Global subscript too long | Truncate or hash the key |
<PROTECT> | Privilege error on global | Check resource definitions |
ERROR #5002 | ObjectScript compilation error | Read compiler output line by line |
ERROR #5659 | Method signature mismatch | Check superclass method signature |
After diagnosis:
🔍 IRIS diagnostic packet captured:
<packet-id>Error:<error_message>Source:<ClassName>:<MethodName>line<N>Root cause: [explanation] Fix: [proposed change]
Symptom: Embedded SQL compiles but returns wrong/empty results. Agent spends 20+ tool calls investigating SQLCODE, %Get patterns, cached queries — never finds root cause.
Root cause: Wrong SQL table name derived from class name.
Fastest diagnostic step (do this first when SQL gives unexpected results):
// Check the ACTUAL SQL table name for a class
Set rs = ##class(%SQL.Statement).%ExecDirect(,
"SELECT SqlTableName FROM %Dictionary.CompiledClass WHERE Name = ?",
"Bench.Patient")
If rs.%Next() { write rs.SqlTableName }
// Output: "Bench.Patient" — use THIS in your SQL, not "Bench_Patient"
// WRONG (common agent mistake when class has 2-level name):
&sql(SELECT COUNT(*) INTO :n FROM Bench_Patient)
// CORRECT:
&sql(SELECT COUNT(*) INTO :n FROM Bench.Patient)
The rule: last dot = schema/table separator; earlier dots → underscores.
Bench.Patient → Bench.Patient. My.Deep.Patient → My_Deep.Patient.
check_config to verify connection before debuggingWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intersystems-community/iris-agentic-dev --plugin iris-dev40 skills in this plugin
/ensemble-productionManage and observe IRIS Interoperability productions — lifecycle, logs, queues, and message tracing. Covers pyprod Python API, ObjectScript Ens.Director, and MCP tool flow./iris-agentic-devConfigure, connect, and troubleshoot the iris-agentic-dev MCP server (iris_execute/iris_query/iris_doc/docs_introspect/kb/etc.) against an IRIS container or instance. Use when its tools return IRIS_UNREACHABLE, when pointing it at a new IRIS, or when a connection edit "isn't taking effect." Covers the .iris-agentic-dev.toml config, live file-watch reload, the OrbStack port-discovery gotcha, and the docker-exec fallback./iris-agentic-dev-setupOther plugins' skills for the same job