generalize code context cache access